CC-4961: Show linking
This commit is contained in:
parent
1a2a05c3cf
commit
a9b5d00d87
5 changed files with 240 additions and 129 deletions
|
@ -19,6 +19,7 @@ class Application_Model_ShowBuilder
|
|||
private $contentDT;
|
||||
private $epoch_now;
|
||||
private $currentShow;
|
||||
private $currentShowId;
|
||||
|
||||
private $showInstances = array();
|
||||
|
||||
|
@ -27,6 +28,7 @@ class Application_Model_ShowBuilder
|
|||
"footer" => false,
|
||||
"empty" => false,
|
||||
"allowed" => false,
|
||||
"linked_allowed" => true,
|
||||
"id" => 0,
|
||||
"instance" => "",
|
||||
"starts" => "",
|
||||
|
@ -85,6 +87,18 @@ class Application_Model_ShowBuilder
|
|||
return;
|
||||
}
|
||||
|
||||
if ($this->currentShow) {
|
||||
$this->currentShowId = $p_item["show_id"];
|
||||
}
|
||||
|
||||
/* If any linked show instance is currently playing
|
||||
* we have to disable editing, or else the times
|
||||
* will not make sense for shows scheduled in the future
|
||||
*/
|
||||
if ($p_item["linked"] && $p_item["show_id"] == $this->currentShowId) {
|
||||
$row["linked_allowed"] = false;
|
||||
}
|
||||
|
||||
if ($this->user->canSchedule($p_item["show_id"]) == true) {
|
||||
$row["allowed"] = true;
|
||||
}
|
||||
|
@ -174,7 +188,7 @@ class Application_Model_ShowBuilder
|
|||
private function makeHeaderRow($p_item)
|
||||
{
|
||||
$row = $this->defaultRowArray;
|
||||
$this->isAllowed($p_item, $row);
|
||||
//$this->isAllowed($p_item, $row);
|
||||
$this->getRowTimestamp($p_item, $row);
|
||||
$this->getItemColor($p_item, $row);
|
||||
|
||||
|
@ -218,6 +232,8 @@ class Application_Model_ShowBuilder
|
|||
$this->currentShow = false;
|
||||
}
|
||||
|
||||
$this->isAllowed($p_item, $row);
|
||||
|
||||
$row["header"] = true;
|
||||
$row["starts"] = $showStartDT->format("Y-m-d H:i");
|
||||
$row["startDate"] = $showStartDT->format("Y-m-d");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue