reschedules a show's content when it is successfully moved on the schedule.
This commit is contained in:
parent
3bbc84365e
commit
258157d92c
2 changed files with 30 additions and 11 deletions
|
@ -317,8 +317,6 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
|
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
|
||||||
unset($this->view->showContent);
|
unset($this->view->showContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -389,6 +389,30 @@ class ShowInstance {
|
||||||
return $showInstance->getDbEnds();
|
return $showInstance->getDbEnds();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setShowStart($start) {
|
||||||
|
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
||||||
|
$showInstance->setDbStarts($start)
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setShowEnd($end) {
|
||||||
|
$showInstance = CcShowInstancesQuery::create()->findPK($this->_instanceId);
|
||||||
|
$showInstance->setDbEnds($end)
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function moveScheduledShowContent($deltaDay, $deltaHours, $deltaMin) {
|
||||||
|
global $CC_DBC;
|
||||||
|
|
||||||
|
$sql = "UPDATE cc_schedule
|
||||||
|
SET starts = (starts + interval '{$deltaDay} days' + interval '{$deltaHours}:{$deltaMin}'),
|
||||||
|
ends = (ends + interval '{$deltaDay} days' + interval '{$deltaHours}:{$deltaMin}')
|
||||||
|
WHERE (starts >= '{$this->getShowStart()}')
|
||||||
|
AND (ends <= '{$this->getShowEnd()}')";
|
||||||
|
|
||||||
|
$CC_DBC->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
public function moveShow($deltaDay, $deltaMin){
|
public function moveShow($deltaDay, $deltaMin){
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
|
@ -419,11 +443,10 @@ class ShowInstance {
|
||||||
if(count($overlap) > 0) {
|
if(count($overlap) > 0) {
|
||||||
return $overlap;
|
return $overlap;
|
||||||
}
|
}
|
||||||
|
|
||||||
$showInstance
|
$this->moveScheduledShowContent($deltaDay, $hours, $mins);
|
||||||
->setDbStarts($new_starts)
|
$this->setShowStart($new_starts);
|
||||||
->setDbEnds($new_ends)
|
$this->setShowEnd($new_ends);
|
||||||
->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resizeShow($deltaDay, $deltaMin){
|
public function resizeShow($deltaDay, $deltaMin){
|
||||||
|
@ -452,10 +475,8 @@ class ShowInstance {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$showInstance
|
$this->setShowStart($new_starts);
|
||||||
->setDbEnds($new_ends)
|
$this->setShowEnd($new_ends);
|
||||||
->save();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getNextPos() {
|
private function getNextPos() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue