From 58ac288337d2242b2605db51e1c5b6eea73f1f4e Mon Sep 17 00:00:00 2001 From: Robert Down Date: Thu, 1 Aug 2013 03:18:07 -0400 Subject: [PATCH] This fixes bug #368. Forced the OUT event to act like a regular appointment and split the display so it appointments inside of the OUT event can still be accessed. Also changed the default out background color to a type of red. --- .../default/views/day/ajax_template.html | 34 +++++++++++++++++----- interface/themes/ajax_calendar.css | 7 ++--- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html index 4d466847e..dda11e61f 100644 --- a/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html +++ b/interface/main/calendar/modules/PostCalendar/pntemplates/default/views/day/ajax_template.html @@ -427,10 +427,12 @@ foreach ($providers as $provider) { $events_in_timeslot = array(); foreach ($events as $e1) { - // ignore IN and OUT events - if (($e1['catid'] == 2) || ($e1['catid'] == 3)) { continue; } - // skip events without an ID (why they are in the loop, I have no idea) + // ignore IN event + if (($e1['catid'] == 2)) { continue; } + + // skip events without an ID (why they are in the loop, I have no idea) if ($e1['eid'] == "") { continue; } + // skip events for other providers if ($providerid != $e1['aid']) { continue; } @@ -455,8 +457,14 @@ foreach ($providers as $provider) { || (($e1End > $slotstartmins) && ($e1End <= $slotendmins)) // end-in || (($e1Start < $slotstartmins) && ($e1End > $slotendmins))) // span { - array_push($events_in_timeslot, $e1['eid']); + array_push($events_in_timeslot, $e1['eid']); + if($e1['catid'] == 3) + { + array_pop($events_in_timeslot); + array_unshift($events_in_timeslot, $e1['eid']); + } } + } $leftpos = 0; $width = 100 / count($events_in_timeslot); @@ -465,13 +473,23 @@ foreach ($providers as $provider) { foreach ($events_in_timeslot as $eid) { // set the width if not already set or if the current width is smaller // than was was previously set - if (! isset($eventPositions[$eid]->width)) { $eventPositions[$eid]->width = $width; } - else if ($eventPositions[$eid]->width > $width) { $eventPositions[$eid]->width = $width; } + if (!isset($eventPositions[$eid]->width)) + { + $eventPositions[$eid]->width = $width; + } else if ($eventPositions[$eid]->width > $width) + { + $eventPositions[$eid]->width = $width; + } // set the left position if not already set or if the current left is // greater than what was previously set - if (! isset($eventPositions[$eid]->leftpos)) { $eventPositions[$eid]->leftpos = $leftpos; } - else if ($eventPositions[$eid]->leftpos < $leftpos) { $eventPositions[$eid]->leftpos = $leftpos; } + if (!isset($eventPositions[$eid]->leftpos)) + { + $eventPositions[$eid]->leftpos = $leftpos; + } else if ($eventPositions[$eid]->leftpos < $leftpos) + { + $eventPositions[$eid]->leftpos = $leftpos; + } // increment the leftpos by the width $leftpos += $width; diff --git a/interface/themes/ajax_calendar.css b/interface/themes/ajax_calendar.css index 61a3f46c5..5abaecb34 100644 --- a/interface/themes/ajax_calendar.css +++ b/interface/themes/ajax_calendar.css @@ -271,10 +271,7 @@ div.tiny { width:1px; height:1px; font-size:1px; } background-color: white; z-index:1; } -.event_out { - background-color: lightgray; - z-index:1; -} + .event_appointment { background-color: white; z-index:2; @@ -339,5 +336,5 @@ font-size:10px; .event_out{ z-index: 3; - background-color:#99FFFF; + background-color:#ff7533; } -- 2.11.4.GIT