diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 953cfee52..793dcbfff 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -87,8 +87,8 @@ class ScheduleController extends Zend_Controller_Action $user = new User($userInfo->id); if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { - $show = new ShowInstance($showInstanceId); - $error = $show->moveShow($deltaDay, $deltaMin); + $showInstance = new ShowInstance($showInstanceId); + $error = $showInstance->moveShow($deltaDay, $deltaMin); } if(isset($error)) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index 1311b837a..b6185c094 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -1262,6 +1262,24 @@ class Show { return $event; } + + public function setShowFirstShow($s_date){ + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbFirstShow($s_date) + ->save(); + } + + public function setShowLastShow($e_date){ + $showDay = CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->findOne(); + + $showDay->setDbLastShow($e_date) + ->save(); + } } class ShowInstance { @@ -1464,6 +1482,13 @@ class ShowInstance { $this->setShowStart($new_starts); $this->setShowEnd($new_ends); $this->correctScheduleStartTimes(); + + $show = new Show($this->getShowId()); + if(!$show->isRepeating()){ + $show->setShowFirstShow($new_starts); + $show->setShowLastShow($new_ends); + } + RabbitMq::PushSchedule(); }