Merge branch 'CC-3174' into devel

This commit is contained in:
Naomi Aro 2012-02-23 22:24:17 +01:00
commit 9c6bd4bf4d
3 changed files with 41 additions and 0 deletions

View File

@ -114,6 +114,29 @@ class Application_Model_ShowBuilder {
}
}
private function getItemStatus($p_item, &$row) {
$showEndDT = new DateTime($p_item["si_ends"]);
$schedStartDT = new DateTime($p_item["sched_starts"]);
$schedEndDT = new DateTime($p_item["sched_ends"]);
$showEndEpoch = intval($showEndDT->format("U"));
$schedStartEpoch = intval($schedStartDT->format("U"));
$schedEndEpoch = intval($schedEndDT->format("U"));
if ($schedEndEpoch < $showEndEpoch) {
$status = 0; //item will playout in full
}
else if ($schedStartEpoch < $showEndEpoch && $schedEndEpoch > $showEndEpoch) {
$status = 1; //item is on boundry
}
else {
$status = 2; //item is overscheduled won't play.
}
$row["status"] = $status;
}
private function getRowTimestamp($p_item, &$row) {
if (is_null($p_item["si_last_scheduled"])) {
@ -163,6 +186,8 @@ class Application_Model_ShowBuilder {
$schedEndDT = new DateTime($p_item["sched_ends"], new DateTimeZone("UTC"));
$schedEndDT->setTimezone(new DateTimeZone($this->timezone));
$this->getItemStatus($p_item, $row);
$runtime = $schedStartDT->diff($schedEndDT);
$row["id"] = intval($p_item["sched_id"]);

View File

@ -22,4 +22,12 @@ table.datatable tr.cursor-selected-row td, table.datatable tr.cursor-selected-ro
}
tr.cursor-selected-row .marker {
background-position: 0 -15px;
}
.sb-boundry {
background-color:#e66a31;
}
.sb-over {
background-color:#ff3030;
}

View File

@ -284,6 +284,14 @@ $(document).ready(function() {
$(nRow).addClass("sb-not-allowed");
}
//status used to colour tracks.
if (aData.status === 1) {
$(nRow).addClass("sb-boundry");
}
else if (aData.status === 2) {
$(nRow).addClass("sb-over");
}
fnPrepareSeparatorRow = function(sRowContent, sClass, iNodeIndex) {
node = nRow.children[iNodeIndex];