Fix for playlists in the scheduler spanning across day boundaries or even multiple days. Part of .

This commit is contained in:
paul 2006-11-29 17:45:02 +00:00
parent e79a684041
commit 50c781da5d
2 changed files with 41 additions and 14 deletions
campcaster/src/modules/htmlUI/var

View File

@ -69,8 +69,9 @@
{/if}
{if $_entrys[$_hour].span}
{assign var="i" value=$_entrys[$_hour].span}
<div {include file="scheduler/removeitem.tpl"}>
...
&nbsp;&nbsp;&nbsp;&nbsp;... <i><b>{$i.title}</b> ##continued##</i> ...
</div>
{/if}
</td>

View File

@ -397,10 +397,35 @@ class uiScheduler extends uiCalendar {
'startsyesterday' => $startsYesterday);
}
// If the item spans more than one hour
if ( ($endHour - $startHour) > 1) {
for ($i = $startHour + 1; $i < $endHour; $i++) {
$items[$i]['span'][] =
$diffHours = floor(($end - $start)/3600);
// If the item spans three hours or more
if ( $diffHours > 2 ) {
// $skip becomes true if we dont actually have to do
// this section.
$skip = false;
if (strftime('%Y%m%d', $start) === $thisDay) {
// For the edge case of starting at the end of
// today.
if ($startHour == 23) {
$skip = true;
}
$countStart = $startHour + 1;
} else {
$countStart = 0;
}
if (strftime('%Y%m%d', $end) === $thisDay) {
// For the edge case of ending at the beginning
// of today.
if ($endHour == 0) {
$skip = true;
}
$countEnd = $endHour - 1;
} else {
$countEnd = 23;
}
if (!$skip) {
for ($i = $countStart; $i <= $countEnd; $i++) {
$items[$i]['span'] =
array('id' => $id,
'scheduleid' => $val['id'],
'start' => $startTime,
@ -411,6 +436,7 @@ class uiScheduler extends uiCalendar {
}
}
}
}
return $items;
} // fn getDayEntrys