From e4a32e7c06c3f2b7147423fcf496dd6fc336a651 Mon Sep 17 00:00:00 2001 From: Jerry Padgett Date: Wed, 30 Jun 2021 22:57:26 -0400 Subject: [PATCH] Site Id intermittent error. (#4492) - bug fix for JS variable init - add a date time stamp keep alive to session --- interface/main/tabs/js/tabs_view_model.js | 8 ++++---- interface/main/tabs/main.php | 2 +- library/ajax/dated_reminders_counter.php | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/interface/main/tabs/js/tabs_view_model.js b/interface/main/tabs/js/tabs_view_model.js index c938634be..9bc6f7900 100644 --- a/interface/main/tabs/js/tabs_view_model.js +++ b/interface/main/tabs/js/tabs_view_model.js @@ -103,7 +103,7 @@ function tabRefresh(data,evt) /** * Given a name, refresh that tab. This code is used to support custom code where it is required * to programmatically refresh a tab via javascript. This func may not be used by core code, please do not remove. - * + * * @param name */ function tabRefreshByName(name) { @@ -359,11 +359,11 @@ function menuActionClick(data,evt) } else { - if(data.requirement===1) + if(data.requirement === 1) { - alert((jsGlobals['globals']['enable_group_therapy'] == 1) ? xl('You must first select or add a patient or therapy group.') : xl('You must first select or add a patient.')); + alert((top.jsGlobals.enable_group_therapy == 1) ? xl('You must first select or add a patient or therapy group.') : xl('You must first select or add a patient.')); } - else if((data.requirement===2)||data.requirement===3) + else if((data.requirement === 2)||data.requirement === 3) { alert(xl('You must first select or create an encounter.')); } diff --git a/interface/main/tabs/main.php b/interface/main/tabs/main.php index 714e09ad3..29d3fb89c 100644 --- a/interface/main/tabs/main.php +++ b/interface/main/tabs/main.php @@ -82,7 +82,7 @@ $esignApi = new Api(); var jsLanguageDirection = ; var jsGlobals = {}; // used in tabs_view_model.js. - jsGlobals['globals']['enable_group_therapy'] = $GLOBALS['enable_group_therapy']; + jsGlobals.enable_group_therapy = function goRepeaterServices() { // Ensure send the skip_timeout_reset parameter to not count this as a manual entry in the diff --git a/library/ajax/dated_reminders_counter.php b/library/ajax/dated_reminders_counter.php index 37e52a17d..08a524c49 100644 --- a/library/ajax/dated_reminders_counter.php +++ b/library/ajax/dated_reminders_counter.php @@ -30,6 +30,8 @@ if (SessionTracker::isSessionExpired()) { echo json_encode(['timeoutMessage' => 'timeout']); exit; } +// keep this below above time out check. +OpenEMR\Common\Session\SessionUtil::setSession('keepAliveTime', time()); $portal_count = array(); // if portal is enabled get various alerts -- 2.11.4.GIT