CC-1985 : Automatic rebroadcast of recorded content
can't move a rebroadcast show infront of it's original recorded show, know how to print form element errors out in a custom view script, removed show content option from a recorded show's context menu.
This commit is contained in:
parent
01ad277984
commit
28b7d8e882
|
@ -168,8 +168,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params,
|
if(!$show->isRecorded()) {
|
||||||
'callback' => 'window["buildContentDialog"]'), 'title' => 'Show Content');
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params,
|
||||||
|
'callback' => 'window["buildContentDialog"]'), 'title' => 'Show Content');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
|
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
|
||||||
|
|
|
@ -177,13 +177,16 @@ class Show {
|
||||||
//adding rows to cc_show_rebroadcast
|
//adding rows to cc_show_rebroadcast
|
||||||
if($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type != -1) {
|
if($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type != -1) {
|
||||||
|
|
||||||
for($i=1; $i<=1; $i++) {
|
for($i=1; $i<=5; $i++) {
|
||||||
|
|
||||||
$showRebroad = new CcShowRebroadcast();
|
if($data['add_show_rebroadcast_date_'.$i]) {
|
||||||
$showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]);
|
|
||||||
$showRebroad->setDbStartTime($data['add_show_start_time_'.$i]);
|
$showRebroad = new CcShowRebroadcast();
|
||||||
$showRebroad->setDbShowId($showId);
|
$showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]);
|
||||||
$showRebroad->save();
|
$showRebroad->setDbStartTime($data['add_show_rebroadcast_time_'.$i]);
|
||||||
|
$showRebroad->setDbShowId($showId);
|
||||||
|
$showRebroad->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type == -1){
|
else if($data['add_show_record'] && $data['add_show_rebroadcast'] && $repeat_type == -1){
|
||||||
|
@ -511,7 +514,7 @@ class ShowInstance {
|
||||||
|
|
||||||
public function isRebroadcast() {
|
public function isRebroadcast() {
|
||||||
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
||||||
return $showInstance->getDbRebroadcast();
|
return $showInstance->getDbOriginalShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isRecorded() {
|
public function isRecorded() {
|
||||||
|
@ -588,6 +591,16 @@ class ShowInstance {
|
||||||
return "Should not overlap shows";
|
return "Should not overlap shows";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rebroadcast = $this->isRebroadcast();
|
||||||
|
if($rebroadcast) {
|
||||||
|
$sql = "SELECT timestamp '{$new_starts}' < (SELECT starts FROM cc_show_instances WHERE id = {$rebroadcast})";
|
||||||
|
$isBeforeRecordedOriginal = $CC_DBC->GetOne($sql);
|
||||||
|
|
||||||
|
if($isBeforeRecordedOriginal === 't'){
|
||||||
|
return "Cannot move a rebroadcast show before its original";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->moveScheduledShowContent($deltaDay, $hours, $mins);
|
$this->moveScheduledShowContent($deltaDay, $hours, $mins);
|
||||||
$this->setShowStart($new_starts);
|
$this->setShowStart($new_starts);
|
||||||
$this->setShowEnd($new_ends);
|
$this->setShowEnd($new_ends);
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?>
|
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_date_'.$i) ?>
|
||||||
<span class="inline-text">@</span>
|
<span class="inline-text">@</span>
|
||||||
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_time_'.$i) ?>
|
<?php echo $this->element->getElement('add_show_rebroadcast_absolute_time_'.$i) ?>
|
||||||
|
<?php if($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->hasErrors()) : ?>
|
||||||
|
<?php echo var_dump($this->element->getElement('add_show_rebroadcast_absolute_time_'.$i)->getMessages()); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue