From 94456a5f6a27eeaa83c7826005402946467938c1 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 27 Dec 2012 10:08:23 +0530 Subject: [PATCH] Visolve: Clear Active Patient Changes --- interface/main/left_nav.php | 22 ++++++++++++++++++++-- interface/main/main_title.php | 3 +++ library/ajax/unset_session_ajax.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 library/ajax/unset_session_ajax.php diff --git a/interface/main/left_nav.php b/interface/main/left_nav.php index 0c1be19dc..8703d0840 100644 --- a/interface/main/left_nav.php +++ b/interface/main/left_nav.php @@ -551,6 +551,23 @@ function goHome() { top.frames['RBot'].location='messages/messages.php?form_active=1'; } +//Function to clear active patient and encounter in the server side +function clearactive() { + top.restoreSession(); + //Ajax call to clear active patient in session + $.ajax({ + type: "POST", + url: "/library/ajax/unset_session_ajax.php", + data: { func: "unset_pid"}, + success:function( msg ) { + clearPatient(); + top.frames['RTop'].location=''; + top.frames['RBot'].location='messages/messages.php?form_active=1'; + } + }); + + $(parent.Title.document.getElementById('clear_active')).hide(); +} // Reference to the search.php window. var my_window; @@ -713,6 +730,7 @@ function goHome() { } reloadIssues(pid); + $(parent.Title.document.getElementById('clear_active')).show();//To display Clear Active Patient button on selecting a patient } function setPatientEncounter(EncounterIdArray,EncounterDateArray,CalendarCategoryArray) { //This function lists all encounters of the patient. @@ -790,9 +808,9 @@ function getEncounterTargetFrame( name ) { active_pid = 0; active_encounter = 0; setDivContent('current_patient', ''); - setTitleContent('current_patient', ''); + $(parent.Title.document.getElementById('current_patient_block')).hide(); top.window.parent.Title.document.getElementById('past_encounter').innerHTML=''; - top.window.parent.Title.document.getElementById('current_encounter').innerHTML=""; + $(parent.Title.document.getElementById('current_encounter_block')).hide(); reloadPatient(''); syncRadios(); } diff --git a/interface/main/main_title.php b/interface/main/main_title.php index 71eeddd78..b5d71b436 100644 --- a/interface/main/main_title.php +++ b/interface/main/main_title.php @@ -79,6 +79,9 @@ $res = sqlQuery("select * from users where username='".$_SESSION{"authUser"}."'" +   + diff --git a/library/ajax/unset_session_ajax.php b/library/ajax/unset_session_ajax.php new file mode 100644 index 000000000..8b3a8a13a --- /dev/null +++ b/library/ajax/unset_session_ajax.php @@ -0,0 +1,33 @@ + + * + * LICENSE: This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see ;. + * + * @package OpenEMR + * @author Visolve + * @link http://www.open-emr.org + */ +$fake_register_globals=false; +$sanitize_all_escapes=true; + +require_once("../../interface/globals.php"); +require_once("../pid.inc"); + +//Setpid function is called on receiving an ajax request. +if(($_POST['func']=="unset_pid")) +{ + setpid(0); +} +?> -- 2.11.4.GIT