Fix for playlists in the scheduler spanning across day boundaries or even multiple days. Part of #2050.
This commit is contained in:
parent
e79a684041
commit
50c781da5d
|
@ -69,8 +69,9 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $_entrys[$_hour].span}
|
{if $_entrys[$_hour].span}
|
||||||
|
{assign var="i" value=$_entrys[$_hour].span}
|
||||||
<div {include file="scheduler/removeitem.tpl"}>
|
<div {include file="scheduler/removeitem.tpl"}>
|
||||||
...
|
... <i><b>{$i.title}</b> ##continued##</i> ...
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -397,10 +397,35 @@ class uiScheduler extends uiCalendar {
|
||||||
'startsyesterday' => $startsYesterday);
|
'startsyesterday' => $startsYesterday);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the item spans more than one hour
|
$diffHours = floor(($end - $start)/3600);
|
||||||
if ( ($endHour - $startHour) > 1) {
|
// If the item spans three hours or more
|
||||||
for ($i = $startHour + 1; $i < $endHour; $i++) {
|
if ( $diffHours > 2 ) {
|
||||||
$items[$i]['span'][] =
|
// $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,
|
array('id' => $id,
|
||||||
'scheduleid' => $val['id'],
|
'scheduleid' => $val['id'],
|
||||||
'start' => $startTime,
|
'start' => $startTime,
|
||||||
|
@ -411,6 +436,7 @@ class uiScheduler extends uiCalendar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $items;
|
return $items;
|
||||||
} // fn getDayEntrys
|
} // fn getDayEntrys
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue