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:
naomiaro 2011-03-18 00:20:38 -04:00
parent 01ad277984
commit 28b7d8e882
3 changed files with 27 additions and 9 deletions

View file

@ -177,13 +177,16 @@ class Show {
//adding rows to cc_show_rebroadcast
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();
$showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]);
$showRebroad->setDbStartTime($data['add_show_start_time_'.$i]);
$showRebroad->setDbShowId($showId);
$showRebroad->save();
if($data['add_show_rebroadcast_date_'.$i]) {
$showRebroad = new CcShowRebroadcast();
$showRebroad->setDbDayOffset($data['add_show_rebroadcast_date_'.$i]);
$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){
@ -511,7 +514,7 @@ class ShowInstance {
public function isRebroadcast() {
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
return $showInstance->getDbRebroadcast();
return $showInstance->getDbOriginalShow();
}
public function isRecorded() {
@ -587,6 +590,16 @@ class ShowInstance {
if(count($overlap) > 0) {
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->setShowStart($new_starts);