From 05b98a180cbe7731a1e927960385c9df47d2d920 Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Wed, 31 May 2017 02:17:20 -0700 Subject: [PATCH] remove unused calendar styles --- .../pntemplates/default/user/search.html | 4 - .../pntemplates/default/views/day/default.html | 20 +- .../default/views/day/fancy_template.html | 629 --------------------- .../default/views/day/orig_default.html | 581 ------------------- .../default/views/global/fancy_navigation.html | 364 ------------ .../default/views/global/navigation.html | 10 +- .../pntemplates/default/views/header.html | 2 - .../pntemplates/default/views/month/default.html | 8 - .../default/views/month/orig_default.html | 136 ----- .../pntemplates/default/views/week/default.html | 13 +- .../default/views/week/orig_default.html | 311 ---------- interface/main/main_info.php | 2 +- interface/usergroup/user_admin.php | 26 +- interface/usergroup/usergroup_admin.php | 14 - interface/usergroup/usergroup_admin_add.php | 12 +- library/authentication/login_operations.php | 3 +- 16 files changed, 11 insertions(+), 2124 deletions(-) rewrite interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/default.html (64%) delete mode 100644 interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/fancy_template.html delete mode 100644 interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/orig_default.html delete mode 100644 interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/fancy_navigation.html delete mode 100644 interface/main/calendar/modules/PostCalendar/pntemplates/default/views/month/orig_default.html delete mode 100644 interface/main/calendar/modules/PostCalendar/pntemplates/default/views/week/orig_default.html diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/user/search.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/user/search.html index 91b847cb9..5b5d0b0f2 100644 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/user/search.html +++ b/interface/main/calendar/modules/PostCalendar/pntemplates/default/user/search.html @@ -1,7 +1,3 @@ -[-* Different search for different calendar UI *-] -[-php-] - $this->assign('cal_ui', $_SESSION['cal_ui']); -[-/php-] [-if $PRINT_VIEW == 1-] [-include file="$TPL_NAME/user/ajax_search_print.html"-] [-else-] diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/default.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/default.html dissimilarity index 64% index 0015b650f..1983541b1 100644 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/default.html +++ b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/default.html @@ -1,15 +1,5 @@ -[-*(CHEMED) if user prefers a fancy calendar switch to a different template*-] -[-php-] - $this->assign('cal_ui', $_SESSION['cal_ui']); -[-/php-] -[-if $cal_ui eq 2-] - [-include file="$TPL_NAME/views/day/fancy_template.html"-] -[-elseif $cal_ui eq 3-] - [-if $PRINT_VIEW == 1-] - [-include file="$TPL_NAME/views/day_print/outlook_ajax_template.html"-] - [-else-] - [-include file="$TPL_NAME/views/day/ajax_template.html"-] - [-/if-] -[-else-] [-*Use default template*-] - [-include file="$TPL_NAME/views/day/orig_default.html"-] -[-/if-] + [-if $PRINT_VIEW == 1-] + [-include file="$TPL_NAME/views/day_print/outlook_ajax_template.html"-] + [-else-] + [-include file="$TPL_NAME/views/day/ajax_template.html"-] + [-/if-] diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/fancy_template.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/fancy_template.html deleted file mode 100644 index 34afd4bd7..000000000 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/fancy_template.html +++ /dev/null @@ -1,629 +0,0 @@ -[-*Smarty*-] -[-*********************************************************************************-] -[-* Copyright (C) 2005-2006 Rod Roark and others *-] -[-* Copyright (C) 2008 CHEMED (Nethanel Vilensky) *-] -[-* *-] -[-* 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 2 *-] -[-* of the License, or (at your option) any later version. *-] -[-*********************************************************************************-] - -[-if $PRINT_VIEW == 1-] - [-* The new calendar interface is not printed correctly by Firefox (because of abs. positioned DOM elements) *-] - [-* so we have to use the older interface instead *-] - [-include file="$TPL_NAME/views/day/orig_default.html"-] -[-else-] - -[-config_load file="default.conf"-] -[-*Load the Language Definitions*-] -[-config_load file="lang.$USER_LANG"-] -[-include file="$TPL_NAME/views/header.html"-] -[-* we want to include out stylesheet for this view*-] -[-fetch file="$TPL_STYLE_PATH/day.css" assign="css"-] -[-eval var=$css-] - -[-*Main Navigation*-] -[-include file="$TPL_NAME/views/global/navigation.html"-] - -[-assign var="dayname" value=$DATE|date_format:"%w"-] -[-assign var="day" value=$DATE|date_format:"%d"|string_format:"%1d"-] -[-assign var="month" value=$DATE|date_format:"%m"|string_format:"%1d"-] -[-assign var="year" value=$DATE|date_format:"%Y"|string_format:"%4d"-] - -[-pc_sort_events var="S_EVENTS" sort="time" order="asc" value=$A_EVENTS-] - -
[-* START Column labels *-] - [-foreach from=$providers item=provider-] -
-
[-$provider.lname-]
- [-/foreach-] -
[-* END Column labels *-] - - -
[-* Main scrollable container *-] - -[-php-] -$A_EVENTS =& $this->_tpl_vars['A_EVENTS']; -$providers =& $this->_tpl_vars['providers']; - -//Used for sorting the event later -function compareEvents($a,$b) { - $start_a = $a['start_slot']; - $start_b = $b['start_slot']; - $end_a = $a['end_slot']; - $end_b = $b['end_slot']; - $dur_a = $a['data']['duration']; - $dur_b = $b['data']['duration']; - $cat_a = $a['data']['catid']; - $cat_b = $b['data']['catid']; - - //IN-OUT events are always the lowest in the list and show up right-most in the UI - if (($cat_a == '2') || ($cat_a == '3') || ($cat_a == '4') || ($cat_a == '8') || ($cat_a == '11')) { - return 1; - } - if (($cat_b == '2') || ($cat_b == '3') || ($cat_b == '4') || ($cat_b == '8') || ($cat_b == '11')) { - return -1; - } - - if (($start_a == $start_b) && - ($end_a == $end_b) && - ($dur_a == $dur_b)) {return 0;} //Events are alike - - if ($start_a == $start_b) { //Events start together - if ($dur_a != $dur_b) { //Simply sort by duration - return ($dur_a > $dur_b) ? -1 : 1; - } else { - return 0; - } - } - - if ($start_a < $start_b) { //a starts earlier than b - if ($end_a >= $end_b) { //events share slots - if ($dur_a != $dur_b) { //Simply sort by duration - return ($dur_a > $dur_b) ? -1 : 1; - } else { - return 0; - } - } else { //events do not share slots and $a is earlier than $b - return -1; - } - } - - if ($start_b < $start_a) { //b starts earlier than a - if ($end_b >= $end_a) { //events share slots - if ($dur_a != $dur_b) { //Simply sort by duration - return ($dur_a > $dur_b) ? -1 : 1; - } else { - return 0; - } - } else { //events do not share slots and $b is earlier than $a - return 1; - } - } -} - - //Configuration - - /* - ------------------------ <= $calendar_width => ------------------------------------------- - |<= $line_label_width => | <= $column_width => ||... |... | - ------------------------------------------------------------------------------------------ - |... | ... ||... |... | - ------------------------------------------------------------------------------------------ - - In a couple of places I am adding +1 to sizes. This is to account for extra 1px wide border around elements. - */ - - $day_start_y = 30; //Used for multiday display - - $start_hour = $GLOBALS['schedule_start']; - $end_hour = $GLOBALS['schedule_end']; - - $slot_minutes = $GLOBALS['calendar_interval']; - - if ($PRINT_VIEW != 1) { - $container_width = $_SESSION['pc_framewidth'] - 20; - } else { - $container_width = 900; //Make it fit to a landscape letter-sized paper - } - - $line_height = 80; - - $line_label_width = 40; - $scrollbar_width = 30; - - $calendar_width = $container_width - $scrollbar_width; - - $columns = count($providers); - $column_width = ($calendar_width / $columns) - $line_label_width; - - $hour_slots = 60 / $slot_minutes; - $hour_height = $hour_slots * $slot_height; - - $slots_count = ($end_hour - $start_hour) * $hour_slots + 1; //How many slots will we have per day - $calendar_height = $line_height * ($slots_count + 1) + 20; - - //Generate columns (each column is a provider) - // ['count'] how many columns we have altogether - // ['pid']['index'] which column is it counting from the left (0 based) - // ['pid']['x'] how far from the left edge the column starts (in pixels) - $columns = array('count' => 0); - foreach ($providers as $provider) { - $pid = $provider['id']; - $columns[$pid]['index'] = $columns['count']++; - $columns[$pid]['x'] = (($columns[$pid]['index'] + 1) * ($line_label_width + 1)) + ($column_width * $columns[$pid]['index']); - } - - //Re-Index categories array to make it more usefull - $categories = array(); - foreach ($A_CATEGORY as $category) { - $categories[$category['id']] = $category; - } - - //For each day... - foreach ($A_EVENTS as $date => $event_list) { - - //Generate labels and positions for all the calendar lines - $lines = array(); //This will hold metadata for each visual calendar line - $hour = $start_hour; - $minutes = 0; - - for ($i = 1; $i <= $slots_count; $i++) { - $lines[$i] = array(); - $lines[$i]['index'] = $i; - $lines[$i]['ampm'] = $hour >= 12 ? '2' : '1'; //For the links - $lines[$i]['ampm_char'] = $hour >= 12 ? 'pm' : 'am'; //Visual representation - $lines[$i]['hour'] = $hour > 12 ? $hour - 12 : $hour; - $lines[$i]['min'] = $minutes; - $lines[$i]['date'] = $date; - $lines[$i]['label'] = $lines[$i]['hour'].":".str_pad($minutes, 2, '0', STR_PAD_LEFT).' 
'.$lines[$i]['ampm_char'].' '; - $lines[$i]['y'] = ($i-1) * ($line_height + 1) + $day_start_y; //Where to absolutely position the line - - //Go to the next slot - $minutes += $slot_minutes; - if (($i % $hour_slots) == 0) { //New hour starts - $hour++; - $minutes = 0; - } - } - - $arr_events = $A_EVENTS[$date]; - - $events = array(); //Temporary array for enumerating the events - $slots = array(); //This is the map of slots showing how many events share the slot and the CSS style for IN-OUT events - $provstat = array(); //Used to gray out the slots for which the provider is not available (out of office) - - //Initialize the slot map with defaul values - // ['adj'] Used for adjusting the chip's width and position from the left column edge (see further below) - // ['n'] How many events share the same slot - // ['provstat'] CSS style name as a visual cue that provider is available or not - foreach($providers as $provider) { - $slots[$provider['id']] = array(); - for ($i = 1; $i <= $slots_count; $i++) { - $slots[$provider['id']][$i] = array('adj' => 0, 'n' => 0, 'provstat' => 'cal_slot_out'); - } - } - - //Go through all the events for the day - list($slotkey, $slotevent) = each($arr_events); - for (; isset($slotkey); list($slotkey, $slotevent) = each($arr_events)) { - $starth = substr($slotevent['startTime'], 0, 2); - $startm = substr($slotevent['startTime'], 3, 2); - $providerid = $slotevent['aid']; - - $start_slot = ($starth - $start_hour) * $hour_slots + floor($startm / $slot_minutes) + 1; - $durminutes = ceil($slotevent['duration'] / 60); //Convert from seconds to minutes - - //$durslots is the amount of slots the chip touches, even if it does not fill a complete slot - $durslots = ceil((($startm % $slot_minutes) + $durminutes) / $slot_minutes); - if ($durslots == 0) { //Event should take up at least one slot - $durslots = 1; - $durminutes = $slot_minutes; - } - - if (($start_slot + $durslots) > $slots_count) { //Event should not be longer than visible calendar - $durslots = $slots_count - $start_slot + 1; - $durminutes = $durslots * $slot_minutes; - } - - $end_slot = $start_slot + $durslots; - - //Events such as IN, OUT etc. require special handling (setting the CSS class name in the $slots map) - if ($slotevent['catid'] == 2) { - for ($i = $start_slot; $i <= $slots_count; $i++) { - $slots[$providerid][$i]['provstat'] = 'cal_slot_in'; - } - } - - if ($slotevent['catid'] == 3) { - for ($i = $start_slot; $i <= $slots_count; $i++) { - $slots[$providerid][$i]['provstat'] = 'cal_slot_out'; - } - } - - if ($slotevent['catid'] == 4) { - for ($i = $start_slot; $i < $start_slot + $durslots; $i++) { - $slots[$providerid][$i]['provstat'] = 'cal_slot_out'; - } - } - - if ($slotevent['catid'] == 8) { - for ($i = $start_slot; $i < $start_slot + $durslots; $i++) { - $slots[$providerid][$i]['provstat'] = 'cal_slot_out'; - } - } - //END special events handling - - //Mark slots as taken and count the chips in each slot - for ($i = $start_slot; $i < $end_slot; $i++) { - $slots[$providerid][$i]['n']++; - } - - //Calculate event chip dimensions - $x = $columns[$providerid]['x']; - $y = $lines[$start_slot]['y']; - $w = $column_width; - $h = $durslots * ($line_height + 1) - 2; - - $slotevent['duration'] = $durminutes; //Convert from seconds to minutes - - //Add event to the list for rendering - //attaching the category and event data from the database - if ($slotevent['eid'] != '') { //For some reason empty $slotevent sometimes exist. TODO: Figure out why - $events[$providerid][] = array( - 'left' => $x, - 'top' => $y, - 'width' => $w, - 'height' => $h, - 'start_slot' => $start_slot, - 'end_slot' => $end_slot, - 'category' => $categories[$slotevent['catid']], - 'data' => $slotevent - ); - } - - } - - $ready_events = array(); //This array will hold events with fully adjusted position - - - list($providerid, $events_list) = each($events); - for (; isset($providerid); list($providerid, $events_list) = each($events)) { - -/* Sorting debug: foreach ($events_list as $ev) { - print('ID: '.$ev['data']['eid'].' '); - print('Start: '.$ev['start_slot'].' End:'.$ev['end_slot'].' '); - print('Duration: '.$ev['data']['duration'].' '); - print('Top: '.$ev['top'].' Left:'.$ev['left'].' '); - print('---------------
'); - } - print "#########################################################################Sorting...
";*/ - - //Sort events so that they as much as possible do NOT overlap - usort($events_list, "compareEvents"); - -/* Sorting debug: foreach ($events_list as $ev) { - print('ID: '.$ev['data']['eid'].' '); - print('Start: '.$ev['start_slot'].' End:'.$ev['end_slot'].' '); - print('Duration: '.$ev['data']['duration'].' '); - print('Top: '.$ev['top'].' Left:'.$ev['left'].' '); - print('---------------
'); - } - exit;*/ - - if (!isset($ready_events[$providerid])) {$ready_events[$providerid] = array();} - foreach ($events_list as $event) { - $neighbors = 1; - //Find the max neccesary width divisor (how thin to make this chip) - //by going over each slot the chip overlays and seeing how many others are there - for ($i = $event['start_slot']; $i < $event['end_slot']; $i++) { - if ($slots[$providerid][$i]['n'] > $neighbors) {$neighbors = $slots[$providerid][$i]['n'];} - $slots[$providerid][$i]['adj']++; - } - //Adjust chip position and width (the magic number 3 adjusts for chip borders and the space between chips) - $event['width'] = floor(($column_width - ($neighbors * 3)) / $neighbors); - $event['left'] = $event['left'] + (($event['width'] + 3) * ($slots[$providerid][$event['start_slot']]['adj'] - 1)); - $ready_events[$providerid][] = $event; - } - //usort($ready_events[$providerid], "compareEvents"); - } - - - //Marshall some variables to Smarty engine - $this->assign('container_width', $container_width); - $this->assign('calendar_width', $calendar_width); - $this->assign('date', $date); - $this->assign_by_ref('lines', $lines); - $this->assign('line_height', $line_height); - $this->assign('hour_height', $hour_height); - $this->assign('line_label_width', $line_label_width); - $this->assign('column_width', $column_width); - $this->assign_by_ref('events', $ready_events); - $this->assign_by_ref('slots', $slots); - $this->assign('date_label_y', $day_start_y - 30); - $this->assign('calendar_height', $calendar_height); - -[-/php-] - - -
-
[-php-]echo dateformat(strtotime($date),true); [-/php-]
- [-foreach from=$lines item=line-] [-* START Lines *-] -
- [-foreach from=$providers item=provider-] [-* START Columns (Providers) *-] - [-* Line label (hour:min) *-] - - [-assign var=pid value=$provider.id-] - [-assign var=lineindex value=$line.index-] -
 
- [-*php-]print_r($slots);Exit;[-/php*-] - [-/foreach-] [-* END Columns (Providers) *-] -
- [-/foreach-] [-* END Lines *-] -
- -
[-* START Events overlay *-] - [-* We should access $events through $provider.id index to only show events for selected providers *-] - [-foreach from=$providers item=provider-] [-* START Columns (Providers) *-] - [-assign var=pid value=$provider.id-] - [-assign var=column value=$events.$pid-] - [-foreach from=$column item=event-] [-* START Events *-] - [-if $event.data.catid eq 2 || $event.data.catid eq 3 || $event.data.catid eq 4 || $event.data.catid eq 8 || $event.data.catid eq 11-] - - [-else-] -
-

- [-$event.data.apptstatus-] - - [-$event.data.startTime|date_format:"%I:%M %p"-] - -

- -

- [-$event.data.facility.name-] -

- -

[-$event.data.duration-][-php-] xl('min','e'); [-/php-]

- - [-if $event.data.pid gt 0-] -

[-$event.data.patient_name|default:'No name'-]

-

[-if $event.data.patient_dob ne ''-][-php-] xl('Age','e'); [-/php-]: [-$event.data.patient_age-][-/if-]

- [-/if-] - [-if $event.data.title ne ''-]

[-$event.data.title|escape-]

[-/if-] - [-if $event.data.hometext ne ''-]

([-$event.data.hometext|escape-])

[-/if-] - -
- [-/if-] - [-/foreach-] [-* END Events *-] - [-/foreach-] [-* END Columns (Providers) *-] -
[-* END Events overlay *-] - - -[-php-] - //For multiday display we have to make the calendar larger - $day_start_y += ($line_height * ($slots_count+1)) + 50; - $calendar_height += $calendar_height; - } - -[-/php-] -
[-* END Main scrollable container *-] - - - - -[-/if-] diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/orig_default.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/orig_default.html deleted file mode 100644 index d25193e4a..000000000 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/orig_default.html +++ /dev/null @@ -1,581 +0,0 @@ -[-*Smarty*-] -[-*****************************************************************************-] -[-* Copyright (C) 2005-2006 Rod Roark and others *-] -[-* *-] -[-* 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 Rod Roark *-] -[-* @author Roberto Vasquez *-] -[-* @link http://www.open-emr.org *-] -[-* *-] -[-*****************************************************************************-] -[-config_load file="default.conf"-] -[-*Load the Language Definitions*-] -[-config_load file="lang.$USER_LANG"-] -[-include file="$TPL_NAME/views/header.html"-] -[-* we want to include out stylesheet for this view*-] -[-fetch file="$TPL_STYLE_PATH/day.css" assign="css"-] -[-eval var=$css-] - - - - - - - -[-php-] include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); [-/php-] - - - - - - - -[-php-] - - // A_CATEGORY is an ordered array of associative-array categories. - // Keys of interest are: id, name, color, desc, event_duration. - // - // echo "\n"; // debugging - // echo "\n"; // debugging - - $A_CATEGORY =& $this->_tpl_vars['A_CATEGORY']; - - // [-if $PRINT_VIEW != 1-] - // [-*Main Navigation*-] - // [-include file="$TPL_NAME/views/global/navigation.html"-] - // [-/if-] - - $A_EVENTS =& $this->_tpl_vars['A_EVENTS']; - // $S_EVENTS =& $this->_tpl_vars['S_EVENTS']; // Deleted by Rod - $providers =& $this->_tpl_vars['providers']; - $times =& $this->_tpl_vars['times']; - $interval = $this->_tpl_vars['interval']; - $viewtype = $this->_tpl_vars['VIEW_TYPE']; - $PREV_WEEK_URL = $this->_tpl_vars['PREV_WEEK_URL']; - $NEXT_WEEK_URL = $this->_tpl_vars['NEXT_WEEK_URL']; - $PREV_DAY_URL = $this->_tpl_vars['PREV_DAY_URL']; - $NEXT_DAY_URL = $this->_tpl_vars['NEXT_DAY_URL']; - - $Date = postcalendar_getDate(); - if (!isset($y)) $y = substr($Date, 0, 4); - if (!isset($m)) $m = substr($Date, 4, 2); - if (!isset($d)) $d = substr($Date, 6, 2); - - // echo "\n"; - - $MULTIDAY = count($A_EVENTS) > 1; - - $facilities = getUserFacilities($_SESSION['authId']); // from users_facility - if (count($facilities) == 1 || !$_SESSION['pc_facility']) { - $_SESSION['pc_facility'] = $facilities[0]['id']; - } - if ( $_SESSION['pc_facility'] ) { - $provinfo = getProviderInfo('%', true, $_SESSION['pc_facility']); - } else { - $provinfo = getProviderInfo(); - } - // echo "
\n"; - echo "
\n"; - echo "\n"; - echo " \n"; - echo " \n"; - - // Build the scrolling selection list of providers. - echo " \n"; - - // Build the date and view type selectors and the Go button and the Today button. - echo " \n"; - - // Show the Add and Search buttons. - echo " \n"; - echo " \n"; - - // Show the date/range and its previous- and next-day/week selectors. - echo " \n"; - echo " \n"; - echo " \n"; - - echo " \n"; - echo "
\n"; - echo " \n"; - -/********************************************************************* - // ============================== - // FACILITY FILTERING (lemonsoftware) - $facilities = getFacilities(); - echo " \n"; -*********************************************************************/ -// ============================== -// FACILITY FILTERING (lemonsoftware) -if ($_SESSION['authorizeduser'] == 1) { - $facilities = getFacilities(); -} else { - $facilities = getUserFacilities($_SESSION['authId']); // from users_facility - if (count($facilities) == 1) - $_SESSION['pc_facility'] = ($facilities[0]['id']); -} -if (count($facilities) > 1) { - echo " \n"; -} -/********************************************************************/ - - // EOS FF - // ============================== - - echo " \n"; - - echo " \n" . - " [?]\n"; - - echo "  \n"; - echo "  \n"; - echo "  \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; - $atmp = array_keys($A_EVENTS); - -if ($MULTIDAY) { - echo "<< \n"; - echo dateformat(strtotime($atmp[0])); - echo " - "; - echo dateformat(strtotime($atmp[count($atmp)-1])); - echo " >>\n"; - } else { - echo "<< \n"; - echo dateformat(strtotime($atmp[0]), true); - echo " >>\n"; - } - echo " \n"; - echo "  \n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - -[-/php-] - - - -[-assign var="dayname" value=$DATE|date_format:"%w"-] -[-assign var="day" value=$DATE|date_format:"%d"|string_format:"%1d"-] -[-assign var="month" value=$DATE|date_format:"%m"|string_format:"%1d"-] -[-assign var="year" value=$DATE|date_format:"%Y"|string_format:"%4d"-] - -[-pc_sort_events var="S_EVENTS" sort="time" order="asc" value=$A_EVENTS-] - -[-php-] - - echo "\n"; - $tdstylearr = array('bordyy', 'bordny', 'bordyn', 'bordnn'); - - // For each day... - foreach ($A_EVENTS as $date => $events) { - $need_headers = true; - $eventdate = substr($date, 0, 4) . substr($date, 5, 2) . substr($date, 8, 2); - - // If multiple days then show a date header for each. - if ($MULTIDAY) { - echo " \n"; - echo " "; - echo " \n"; - } - - $arr_events = $A_EVENTS[$date]; - list($slotkey, $slotevent) = each($arr_events); - - // This is an array of provider status information for this day, - // used to properly assign table cell attributes. - $provstat = array(); - - $slotindex = 0; - $lastslotindex = count($times) - 1; - - // For each time slot... - foreach ($times as $slottime) { - $startampm = ($slottime['mer']) == "pm" ? 2 : 1; - $starttimeh = $slottime['hour']; - $starttimem = $slottime['minute']; - $slotendmins = $starttimeh * 60 + $starttimem + $interval; - - // Repeat doc names at 1PM. This is a kludge; omit it for released code. - // if ($starttimeh == 13 && $starttimem == 0) $need_headers = true; - - // Get all events for all providers just for this time slot now, because we - // can pick up where we left off and because we don't want to re-scan all - // events for the day for each table cell. - // - $arr_slot = array(); - for (; isset($slotkey); list($slotkey, $slotevent) = each($arr_events)) { - $starth = substr($slotevent['startTime'], 0, 2); - $startm = substr($slotevent['startTime'], 3, 2); - - if (($starth * 60 + $startm) >= $slotendmins) break; - - $arr_slot[$slotkey] = $slotevent; - - $catid = $slotevent['catid']; - $providerid = $slotevent['aid']; - $durminutes = ceil($slotevent['duration'] / 60); - $durslots = ceil($durminutes / $interval); - - // While we're here, collect information for cell cosmetics. - if ($catid == 2) { // in office - $provstat[$providerid]['in'] = true; - - // Save preferred category info for this IN event. - $provstat[$providerid]['in_cat'] = -1; - $provstat[$providerid]['in_slot0'] = $slotindex; - $provstat[$providerid]['in_slots'] = 1; - if ($slotevent['prefcatid']) { - foreach ($A_CATEGORY as $catkey => $catval) { - if ($catval['id'] == $slotevent['prefcatid']) { - $provstat[$providerid]['in_cat'] = $catkey; - $provstat[$providerid]['in_slots'] = - ceil(ceil($catval['event_duration'] / 60) / $interval); - break; - } - } - // Debugging: - if ($provstat[$providerid]['in_cat'] < 0) { - echo "\n"; // debugging - } - } - - } - else if ($catid == 3) { // out of office - $provstat[$providerid]['in'] = false; - } - else if ($catid == 4 || $catid == 8 || $catid == 11) { // unavailable types - // unavailable slots are marked 'res' for appropriate coloring. - $endindex = $slotindex + $durslots; - for ($i = $slotindex; $i < $endindex; ++$i) { - $provstat[$providerid][$i]['res'] = true; - } - } - // If duration > slot size then mark slots for border control. A slot - // marked 'ext' is not to have a border between itself and the slot below. - if ($durslots > 1) { - $endindex = $slotindex + $durslots - 1; - for ($i = $slotindex; $i < $endindex; ++$i) { - $provstat[$providerid][$i]['ext'] = true; - } - } - } - // Finished getting event information for this time slot. - - // Write a header row with the provider names if appropriate. - if ($need_headers) { - $need_headers = false; - echo " \n"; - foreach ($providers as $provider) { - echo " \n"; - } - echo " \n"; - } - - echo " \n"; - - // We are now ready to write the table row for the current time slot. - // This loops once for each provider to be displayed. - // - foreach ($providers as $provider) { - $providerid = $provider['id']; - - // Mark this as a no-bottom-border slot if the preferred category - // duration extends beyond it. - // - // echo "\n"; // debugging - // - if ($provstat[$providerid]['in']) { - if (($slotindex + 1 - $provstat[$providerid]['in_slot0']) % $provstat[$providerid]['in_slots']) - $provstat[$providerid][$slotindex]['ext'] = true; - } - - $content = ""; // this will be the event cell content - - $clsuffix = "acell"; - if ($provstat[$providerid][$slotindex]['res'] || ! $provstat[$providerid]['in']) { - $clsuffix = "ucell"; - } - - // Remove top and/or bottom table cell borders using CSS when events span - // time slots or when the practitioner is not in-office. Using "rowspan" - // would be a difficult and inferior solution to this problem. - // - $tdstyleix = 0; - $timelabel = true; - if ($slotindex < $lastslotindex && - ($provstat[$providerid][$slotindex]['ext'] || !$provstat[$providerid]['in'])) { - $tdstyleix += 1; // no bottom - } - if ($slotindex > 0 && ($provstat[$providerid][$slotindex-1]['ext'] || - !($provstat[$providerid]['in'] || $provstat[$providerid]['wasin']))) { - $tdstyleix += 2; // no top - $timelabel = false; - } - $tdstyle = ' ' . $tdstylearr[$tdstyleix]; - - $disptimeh = ($starttimeh > 12) ? ($starttimeh - 12) : $starttimeh; - - $in_cat_id = 0; - if ($provstat[$providerid]['in_cat'] >= 0) { - $category =& $A_CATEGORY[$provstat[$providerid]['in_cat']]; - if ($category['id']) $in_cat_id = $category['id']; - } - - // If a slot omits the top border, then we omit the TOD cell's top border - // and skip writing its time-of-day text. This way we can get some rows - // with no content at all, which should produce a more compact and readable - // calendar display. - - echo " \n"; - - echo " \n"; - - // Keep track of whether the doc was in during the previous time slot. - $provstat[$providerid]['wasin'] = $provstat[$providerid]['in']; - - } // end provider - - echo " \n"; - - ++$slotindex; - } // end time slot - } // end day - - echo "
" . - dateformat(strtotime($date), true) . "
"; - echo $provider['fname'][0] . " " . $provider['lname']; - echo "
"; - if ($timelabel) { - echo ""; - echo "$disptimeh:$starttimem"; - } else { - echo "
"; // 1x1 px content so the browser does not suppress borders - } - echo "
"; - - // Scan all events for this time slot and generate the associated HTML for - // this doc. JavaScript is used in hrefs to reduce the volume of output. - // - reset($arr_slot); - while (list($eventkey, $event) = each($arr_slot)) { - if ($event['aid'] != $providerid) continue; - if ($content) $content .= " "; - $starth = substr($event['startTime'], 0, 2); - $startm = substr($event['startTime'], 3, 2); - $eventid = $event['eid']; - $patientid = $event['pid']; - $commapos = strpos($event['patient_name'], ","); - $lname = substr($event['patient_name'], 0, $commapos); - $fname = substr($event['patient_name'], $commapos + 2); - $patient_dob = $event['patient_dob']; - $patient_age = $event['patient_age']; - $title = xl('Age') . " $patient_age ($patient_dob)"; - $catid = $event['catid']; - $comment = addslashes($event['hometext']); - $catname = $event['catname']; - if ($comment && $GLOBALS['calendar_appt_style'] < 4) - $title .= " " . $comment; - if ($catid == 2 || $catid == 3 || $catid == 4 || $catid == 8 || $catid == 11) { - if ($catid == 2) $catname = xl('IN'); - else if ($catid == 3) $catname = xl('OUT'); - else if ($catid == 4) $catname = xl('VACATION'); - else if ($catid == 8) $catname = xl('LUNCH'); - else if ($catid == 11) $catname = xl('RESERVED'); - // Omit lunch, vacation, etc. if the doc is not in-office. - if ($provstat[$providerid]['in'] || $catid < 4) { - $content .= ""; - $content .= $catname; - if ($comment) $content .= " - $comment"; - $content .= ""; - } - } - else if ($patientid) { // some sort of patient appointment - $content .= ""; - // $content .= $starth . ':' . $startm . htmlspecialchars($event['apptstatus']) . ""; - $content .= $starth . ':' . $startm . ' ' . htmlspecialchars($event['apptstatus']) . " "; - $content .= ""; - if ($catid == 1) $content .= ""; - $content .= htmlspecialchars($lname); - if ($GLOBALS['calendar_appt_style'] != 1) { - $content .= "," . htmlspecialchars($fname); - if ($event['title'] && $GLOBALS['calendar_appt_style'] >= 3) { - $content .= "(" . $event['title']; - if ($event['hometext'] && $GLOBALS['calendar_appt_style'] >= 4) - $content .= ": " . htmlspecialchars(trim($event['hometext'])) . ""; - $content .= ")"; - } - } - if ($catid == 1) $content .= ""; - $content .= ""; - } - else { // some other non-patient event - $content .= ""; - $content .= $starth . ':' . $startm . ' ' . htmlspecialchars($event['apptstatus']) . " "; - if ($GLOBALS['calendar_appt_style'] != 1) { - if ($event['title'] && $GLOBALS['calendar_appt_style'] >= 3) { - $content .= $event['title']; - if ($event['hometext'] && $GLOBALS['calendar_appt_style'] >= 4) - $content .= ": " . htmlspecialchars(trim($event['hometext'])); - } - } - $content .= ""; - } - } // end while - - if (! $content) $content = "
"; // so the browser does not suppress borders - echo $content . "
\n"; - - // [-*footer*-] - // [-include file="$TPL_NAME/views/global/footer.html"-] - // [-include file="$TPL_NAME/views/footer.html"-] - -[-/php-] - - - diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/fancy_navigation.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/fancy_navigation.html deleted file mode 100644 index ebe4fd83b..000000000 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/fancy_navigation.html +++ /dev/null @@ -1,364 +0,0 @@ - - - - - - -[-php-] include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); [-/php-] - - - - - - - -[-php-] - - // A_CATEGORY is an ordered array of associative-array categories. - // Keys of interest are: id, name, color, desc, event_duration. - // - // echo "\n"; // debugging - // echo "\n"; // debugging - - $A_CATEGORY =& $this->_tpl_vars['A_CATEGORY']; - - $A_EVENTS =& $this->_tpl_vars['A_EVENTS']; - // $S_EVENTS =& $this->_tpl_vars['S_EVENTS']; // Deleted by Rod - $providers =& $this->_tpl_vars['providers']; - $times =& $this->_tpl_vars['times']; - $interval = $this->_tpl_vars['interval']; - $viewtype = $this->_tpl_vars['VIEW_TYPE']; - $PREV_WEEK_URL = $this->_tpl_vars['PREV_WEEK_URL']; - $NEXT_WEEK_URL = $this->_tpl_vars['NEXT_WEEK_URL']; - $PREV_DAY_URL = $this->_tpl_vars['PREV_DAY_URL']; - $NEXT_DAY_URL = $this->_tpl_vars['NEXT_DAY_URL']; - - $Date = postcalendar_getDate(); - if (!isset($y)) $y = substr($Date, 0, 4); - if (!isset($m)) $m = substr($Date, 4, 2); - if (!isset($d)) $d = substr($Date, 6, 2); - - // echo "\n"; - - // $MULTIDAY = count($A_EVENTS) > 1; // (CHEMED) not needed after week_view template changes - - $provinfo = getProviderInfo('%', true, $_SESSION['pc_facility']); //(CHEMED) - - [-/php-] - -
- -
- - [?] - - - - - - - -
- - - - - -
-
-
- -
- - - - [-php-] - // ============================== - // FACILITY FILTERING (lemonsoftware)(CHEMED) - // $facilities = getFacilities(); // (CHEMED) commented this out - // We only want to see facilities that are a 'service location', - // as 'billing location' facilities should not have any patient appointments - // TODO: Is the above statement true? - $facilities = getServiceFacilities(); - [-/php-] - - - -
- -
- -
- -

-[-php-] - // Show the date/range and its previous- and next-day/week selectors. - $atmp = array_keys($A_EVENTS); - -if ($MULTIDAY) { - echo "<< \n"; - echo dateformat(strtotime($atmp[0])); - echo " - "; - echo dateformat(strtotime($atmp[count($atmp)-1])); - echo " >>\n"; - } else { - echo "<< \n"; - echo dateformat(strtotime($atmp[0]), true); - echo " >>\n"; - } - -[-/php-] -

- - diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/navigation.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/navigation.html index 86d216b70..ccc6b05fd 100644 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/navigation.html +++ b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/global/navigation.html @@ -1,9 +1 @@ -[-*(CHEMED) if user prefers a fancy calendar switch to a different template*-] -[-php-] - $this->assign('cal_ui', $_SESSION['cal_ui']); -[-/php-] -[-if $cal_ui eq 2-] - [-include file="$TPL_NAME/views/global/fancy_navigation.html"-] -[-else-] [-*Use default template*-] - [-include file="$TPL_NAME/views/global/orig_navigation.html"-] -[-/if-] \ No newline at end of file + [-include file="$TPL_NAME/views/global/orig_navigation.html"-] \ No newline at end of file diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/header.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/header.html index be0ffbcfb..bfb6cbd0f 100644 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/header.html +++ b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/header.html @@ -4,7 +4,6 @@ -[-if $cal_ui eq 3-] \n"; // debugging - } - } - - } - else if ($catid == 3) { // out of office - $provstat[$providerid]['in'] = false; - } - else if ($catid == 4 || $catid == 8 || $catid == 11) { // unavailable types - // unavailable slots are marked 'res' for appropriate coloring. - $endindex = $slotindex + $durslots; - for ($i = $slotindex; $i < $endindex; ++$i) { - $provstat[$providerid][$i]['res'] = true; - } - } - // If duration > slot size then mark slots for border control. A slot - // marked 'ext' is not to have a border between itself and the slot below. - if ($durslots > 1) { - $endindex = $slotindex + $durslots - 1; - for ($i = $slotindex; $i < $endindex; ++$i) { - $provstat[$providerid][$i]['ext'] = true; - } - } - } - // Finished getting event information for this time slot. - - // Write a header row with the provider names if appropriate. - if ($need_headers) { - $need_headers = false; - echo " \n"; - foreach ($providers as $provider) { - echo " "; - echo $provider['fname'][0] . " " . $provider['lname']; - echo "\n"; - } - echo " \n"; - } - - echo " \n"; - - // We are now ready to write the table row for the current time slot. - // This loops once for each provider to be displayed. - // - foreach ($providers as $provider) { - $providerid = $provider['id']; - - // Mark this as a no-bottom-border slot if the preferred category - // duration extends beyond it. - // - // echo "\n"; // debugging - // - if ($provstat[$providerid]['in']) { - if (($slotindex + 1 - $provstat[$providerid]['in_slot0']) % $provstat[$providerid]['in_slots']) - $provstat[$providerid][$slotindex]['ext'] = true; - } - - $content = ""; // this will be the event cell content - - $clsuffix = "acell"; - if ($provstat[$providerid][$slotindex]['res'] || ! $provstat[$providerid]['in']) { - $clsuffix = "ucell"; - } - - // Remove top and/or bottom table cell borders using CSS when events span - // time slots or when the practitioner is not in-office. Using "rowspan" - // would be a difficult and inferior solution to this problem. - // - $tdstyleix = 0; - $timelabel = true; - if ($slotindex < $lastslotindex && - ($provstat[$providerid][$slotindex]['ext'] || !$provstat[$providerid]['in'])) { - $tdstyleix += 1; // no bottom - } - if ($slotindex > 0 && ($provstat[$providerid][$slotindex-1]['ext'] || - !($provstat[$providerid]['in'] || $provstat[$providerid]['wasin']))) { - $tdstyleix += 2; // no top - $timelabel = false; - } - $tdstyle = ' ' . $tdstylearr[$tdstyleix]; - - $disptimeh = ($starttimeh > 12) ? ($starttimeh - 12) : $starttimeh; - - $in_cat_id = 0; - if ($provstat[$providerid]['in_cat'] >= 0) { - $category =& $A_CATEGORY[$provstat[$providerid]['in_cat']]; - if ($category['id']) $in_cat_id = $category['id']; - } - - // If a slot omits the top border, then we omit the TOD cell's top border - // and skip writing its time-of-day text. This way we can get some rows - // with no content at all, which should produce a more compact and readable - // calendar display. - - echo " "; -// (CHEMED) always show timelabel if ($timelabel) { - echo ""; - echo "$disptimeh:$starttimem"; -// } else { -// echo "
"; // 1x1 px content so the browser does not suppress borders -// END (CHEMED) } - echo "\n"; - - echo " "; - - // Scan all events for this time slot and generate the associated HTML for - // this doc. JavaScript is used in hrefs to reduce the volume of output. - // - reset($arr_slot); - while (list($eventkey, $event) = each($arr_slot)) { - if ($event['aid'] != $providerid) continue; - if ($content) $content .= " "; - $starth = substr($event['startTime'], 0, 2); - $startm = substr($event['startTime'], 3, 2); - $eventid = $event['eid']; - $patientid = $event['pid']; - $commapos = strpos($event['patient_name'], ","); - $lname = addslashes(ucfirst(strtolower(substr($event['patient_name'], 0, $commapos)))); - $fname = addslashes(ucfirst(strtolower(substr($event['patient_name'], $commapos + 2)))); - $patient_dob = $event['patient_dob']; - $patient_age = $event['patient_age']; - $catid = $event['catid']; - $comment = addslashes($event['hometext']); - $catname = $event['catname']; - $title = "Age $patient_age ($patient_dob)"; - if ($comment && $GLOBALS['calendar_appt_style'] < 4) - $title .= " " . $comment; - if ($catid == 2 || $catid == 3 || $catid == 4 || $catid == 8 || $catid == 11) { - if ($catid == 2) $catname = "IN"; - else if ($catid == 3) $catname = "OUT"; - else if ($catid == 4) $catname = "VACATION"; - else if ($catid == 8) $catname = "LUNCH"; - else if ($catid == 11) $catname = "RESERVED"; - // Omit lunch, vacation, etc. if the doc is not in-office. - // Omit lunch, vacation, etc. if the doc is not in-office. - if ($provstat[$providerid]['in'] || $catid < 4) { - $content .= ""; -// $content .=""; //(CHEMED) Color events by category start - $content .= $catname; - if ($comment) $content .= " - $comment"; -// $content .=""; //(CHEMED) Color events by category end - $content .= ""; - } - } - else { // some sort of patient appointment - $content .= ""; - $content .=" "; //(CHEMED) Color events by category start - $content .= $starth . ':' . $startm . "".htmlspecialchars($event['apptstatus']).""; //(CHEMED) added 'span' to apptstatus - $content .=""; //(CHEMED) Color events by category end - $content .= ""; - $content .= ""; - $content .=""; //(CHEMED) Color events by category start - if ($catid == 1) $content .= ""; - $content .= $lname; - if ($GLOBALS['calendar_appt_style'] != 1) { - $content .= "," . $fname; - if ($event['title'] && $GLOBALS['calendar_appt_style'] >= 3) { - $content .= "(" . $event['title']; - if ($event['hometext'] && $GLOBALS['calendar_appt_style'] >= 4) - $content .= ": " . htmlspecialchars(trim($event['hometext'])) . ""; - $content .= ")"; - } - } - if ($catid == 1) $content .= ""; - $content .=" "; //(CHEMED) Color events by category end - $content .= ""; - } - } // end while - - if (! $content) $content = "
"; // so the browser does not suppress borders - echo $content . "\n"; - - // Keep track of whether the doc was in during the previous time slot. - $provstat[$providerid]['wasin'] = $provstat[$providerid]['in']; - - } // end provider - - echo " \n"; - - ++$slotindex; - } // end time slot - } // end day - - echo "\n"; - - // [-*footer*-] - // [-include file="$TPL_NAME/views/global/footer.html"-] - // [-include file="$TPL_NAME/views/footer.html"-] - -[-/php-] - - - diff --git a/interface/main/main_info.php b/interface/main/main_info.php index 0779bdbd8..237dbe256 100644 --- a/interface/main/main_info.php +++ b/interface/main/main_info.php @@ -102,7 +102,7 @@ framesrc += '&framewidth='+x+'" name="Calendar" scrolling="auto" frameborder="