From 6edd124688737f6854927e37ff29cdc492171600 Mon Sep 17 00:00:00 2001 From: cfapress Date: Thu, 11 Dec 2008 18:42:27 +0000 Subject: [PATCH] Relocated code block that sets the default facility for a new event --- interface/main/calendar/add_edit_event.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/interface/main/calendar/add_edit_event.php b/interface/main/calendar/add_edit_event.php index c901f71b7..d884f777a 100644 --- a/interface/main/calendar/add_edit_event.php +++ b/interface/main/calendar/add_edit_event.php @@ -813,6 +813,16 @@ if ($_POST['form_action'] == "save") { else { // a NEW event $eventstartdate = $date; // for repeating event stuff - JRM Oct-08 + + //------------------------------------- + //(CHEMED) + //Set default facility for a new event based on the given 'userid' + if ($userid) { + $pref_facility = sqlFetchArray(sqlStatement("SELECT facility_id, facility FROM users WHERE id = $userid")); + $e2f = $pref_facility['facility_id']; + $e2f_name = $pref_facility['facility']; + } + //END of CHEMED ----------------------- } // If we have a patient ID, get the name and phone numbers to display. @@ -828,16 +838,6 @@ if ($_POST['form_action'] == "save") { $ures = sqlStatement("SELECT id, username, fname, lname FROM users WHERE " . "authorized != 0 AND active = 1 ORDER BY lname, fname"); - //------------------------------------- - //(CHEMED) - //Set default facility for a new event based on the given 'userid' - if ($userid) { - $pref_facility = sqlFetchArray(sqlStatement("SELECT facility_id, facility FROM users WHERE id = $userid")); - $e2f = $pref_facility['facility_id']; - $e2f_name = $pref_facility['facility']; - } - //END of CHEMED ----------------------- - // Get event categories. $cres = sqlStatement("SELECT pc_catid, pc_catname, pc_recurrtype, pc_duration, pc_end_all_day " . "FROM openemr_postcalendar_categories ORDER BY pc_catname"); -- 2.11.4.GIT