From 4864f9b2fba34b9c5130b9af518a2430afedeb75 Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Wed, 28 Jun 2006 17:49:00 +0000 Subject: [PATCH] calendar updates: support for preferred category in IN event, visual improvements, some bug fixes --- interface/main/calendar/add_edit_event.php | 99 ++- interface/main/calendar/find_appt_popup.php | 71 +- .../pntemplates/default/views/day/default.html | 101 ++- .../pntemplates/default/views/week/default.html | 100 ++- .../calendar/modules/PostCalendar/pnuserapi.php | 720 +++++++++++---------- sql/2_8_1-to-2_8_2_upgrade.sql | 4 +- sql/database.sql | 1 + 7 files changed, 678 insertions(+), 418 deletions(-) diff --git a/interface/main/calendar/add_edit_event.php b/interface/main/calendar/add_edit_event.php index f4ef4567c..8745b71ec 100644 --- a/interface/main/calendar/add_edit_event.php +++ b/interface/main/calendar/add_edit_event.php @@ -1,5 +1,5 @@ + // Copyright (C) 2005-2006 Rod Roark // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -10,10 +10,11 @@ //------------------------------------------------------------// // Category __________________V O All day event // - // Date _____________ [?] O Date ___:___ __V // - // Title ___________________ Duration ____ minutes // - // Provider __________________V X Repeats _____________V // - // Patient ___________________ Until ___________ [?] // + // Date _____________ [?] O Time ___:___ __V // + // Title ___________________ duration ____ minutes // + // Patient _(Click_to_select)_ // + // Provider __________________V X Repeats ______V ______V // + // Status __________________V until __________ [?] // // Comments ________________________________________________ // // // // [Save] [Find Available] [Delete] [Cancel] // @@ -24,9 +25,10 @@ // Things that might be passed by our opener. // - $eid = $_GET['eid']; // only for existing events - $date = $_GET['date']; // this and below only for new events - $userid = $_GET['userid']; + $eid = $_GET['eid']; // only for existing events + $date = $_GET['date']; // this and below only for new events + $userid = $_GET['userid']; + $default_catid = $_GET['catid'] ? $_GET['catid'] : '5'; // if ($date) $date = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6); @@ -113,14 +115,15 @@ "pc_startTime = '$starttime', " . "pc_endTime = '$endtime', " . "pc_alldayevent = '" . $_POST['form_allday'] . "', " . - "pc_apptstatus = '" . $_POST['form_apptstatus'] . "' " . + "pc_apptstatus = '" . $_POST['form_apptstatus'] . "', " . + "pc_prefcatid = '" . $_POST['form_prefcat'] . "' " . "WHERE pc_eid = '$eid'"); } else { sqlInsert("INSERT INTO openemr_postcalendar_events ( " . "pc_catid, pc_aid, pc_pid, pc_title, pc_time, pc_hometext, " . "pc_informant, pc_eventDate, pc_endDate, pc_duration, pc_recurrtype, " . "pc_recurrspec, pc_startTime, pc_endTime, pc_alldayevent, " . - "pc_apptstatus, pc_location, pc_eventstatus, pc_sharing " . + "pc_apptstatus, pc_prefcatid, pc_location, pc_eventstatus, pc_sharing " . ") VALUES ( " . "'" . $_POST['form_category'] . "', " . "'" . $_POST['form_provider'] . "', " . @@ -138,6 +141,7 @@ "'$endtime', " . "'" . $_POST['form_allday'] . "', " . "'" . $_POST['form_apptstatus'] . "', " . + "'" . $_POST['form_prefcat'] . "', " . "'$locationspec', " . "1, " . "1 )"); @@ -260,6 +264,7 @@ td { font-size:10pt; } // Read the event categories, generate their options list, and get // the default event duration from them if this is a new event. $catoptions = ""; + $prefcat_options = " \n"; $thisduration = 0; if ($eid) { $thisduration = $row['pc_alldayevent'] ? 1440 : round($row['pc_duration'] / 60); @@ -273,12 +278,22 @@ td { font-size:10pt; } if ($eid) { if ($crow['pc_catid'] == $row['pc_catid']) $catoptions .= " selected"; } else { - if ($crow['pc_catid'] == '5') { // office visit + if ($crow['pc_catid'] == $default_catid) { $catoptions .= " selected"; $thisduration = $duration; } } $catoptions .= ">" . $crow['pc_catname'] . "\n"; + + // This section is to build the list of preferred categories: + if ($duration) { + $prefcat_options .= "