CC-3174 : showbuilder
This commit is contained in:
parent
3bfbe036c7
commit
1c43edb40b
3 changed files with 31 additions and 1 deletions
|
@ -30,7 +30,8 @@ class Application_Model_ShowBuilder {
|
||||||
"cuein" => "",
|
"cuein" => "",
|
||||||
"cueout" => "",
|
"cueout" => "",
|
||||||
"fadein" => "",
|
"fadein" => "",
|
||||||
"fadeout" => ""
|
"fadeout" => "",
|
||||||
|
"current" => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -76,6 +77,7 @@ class Application_Model_ShowBuilder {
|
||||||
return $formatted;
|
return $formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check to see if this row should be editable.
|
||||||
private function isAllowed($p_item, &$row) {
|
private function isAllowed($p_item, &$row) {
|
||||||
|
|
||||||
$showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC"));
|
$showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC"));
|
||||||
|
@ -104,6 +106,16 @@ class Application_Model_ShowBuilder {
|
||||||
$row["timestamp"] = $ts;
|
$row["timestamp"] = $ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function isCurrent($p_epochItemStart, $p_epochItemEnd) {
|
||||||
|
$current = false;
|
||||||
|
|
||||||
|
if ($this->epoch_now >= $p_epochItemStart && $this->epoch_now < $p_epochItemEnd) {
|
||||||
|
$current = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $current;
|
||||||
|
}
|
||||||
|
|
||||||
private function makeHeaderRow($p_item) {
|
private function makeHeaderRow($p_item) {
|
||||||
|
|
||||||
$row = $this->defaultRowArray;
|
$row = $this->defaultRowArray;
|
||||||
|
@ -140,9 +152,19 @@ class Application_Model_ShowBuilder {
|
||||||
$schedStartDT->setTimezone(new DateTimeZone($this->timezone));
|
$schedStartDT->setTimezone(new DateTimeZone($this->timezone));
|
||||||
$schedEndDT = new DateTime($p_item["sched_ends"], new DateTimeZone("UTC"));
|
$schedEndDT = new DateTime($p_item["sched_ends"], new DateTimeZone("UTC"));
|
||||||
$schedEndDT->setTimezone(new DateTimeZone($this->timezone));
|
$schedEndDT->setTimezone(new DateTimeZone($this->timezone));
|
||||||
|
$showEndDT = new DateTime($p_item["si_ends"], new DateTimeZone("UTC"));
|
||||||
|
|
||||||
$this->getItemStatus($p_item, $row);
|
$this->getItemStatus($p_item, $row);
|
||||||
|
|
||||||
|
$startsEpoch = intval($schedStartDT->format("U"));
|
||||||
|
$endsEpoch = intval($schedEndDT->format("U"));
|
||||||
|
$showEndEpoch = intval($showEndDT->format("U"));
|
||||||
|
|
||||||
|
//don't want an overbooked item to stay marked as current.
|
||||||
|
if ($this->isCurrent($startsEpoch, min($endsEpoch, $showEndEpoch))) {
|
||||||
|
$row["current"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
$row["id"] = intval($p_item["sched_id"]);
|
$row["id"] = intval($p_item["sched_id"]);
|
||||||
$row["instance"] = intval($p_item["si_id"]);
|
$row["instance"] = intval($p_item["si_id"]);
|
||||||
$row["starts"] = $schedStartDT->format("H:i:s");
|
$row["starts"] = $schedStartDT->format("H:i:s");
|
||||||
|
|
|
@ -36,6 +36,10 @@ tr.cursor-selected-row .marker {
|
||||||
background-color:#ff3030;
|
background-color:#ff3030;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sb-now-playing {
|
||||||
|
background-color:#17eb25 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.ui-dialog .wrapper {
|
.ui-dialog .wrapper {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 10px 0 0 0;
|
padding: 10px 0 0 0;
|
||||||
|
|
|
@ -183,6 +183,10 @@ var AIRTIME = (function(AIRTIME){
|
||||||
//save some info for reordering purposes.
|
//save some info for reordering purposes.
|
||||||
$(nRow).data({"aData": aData});
|
$(nRow).data({"aData": aData});
|
||||||
|
|
||||||
|
if (aData.current === true) {
|
||||||
|
$(nRow).addClass("sb-now-playing");
|
||||||
|
}
|
||||||
|
|
||||||
if (aData.allowed !== true) {
|
if (aData.allowed !== true) {
|
||||||
$(nRow).addClass("sb-not-allowed");
|
$(nRow).addClass("sb-not-allowed");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue