From 8ad866c2a258b0bd4b98dd99de540e651cb93fef Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 10 Mar 2014 17:32:54 -0400 Subject: [PATCH] Fixed changing the start date on a non-repeating show --- airtime_mvc/application/services/ShowService.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index f0c547ff5..de134f2fa 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -20,6 +20,7 @@ class Application_Service_ShowService private $localShowStartHour; private $localShowStartMin; private $origCcShowDay; + private $origShowRepeatStatus; private $instanceIdsForScheduleUpdates; public function __construct($showId=null, $showData=null, $isUpdate=false) @@ -158,8 +159,10 @@ class Application_Service_ShowService { if ($this->ccShow->isRepeating()) { $this->origCcShowDay = clone $this->ccShow->getFirstRepeatingCcShowDay(); + $this->origShowRepeatStatus = true; } else { $this->origCcShowDay = clone $this->ccShow->getFirstCcShowDay(); + $this->origShowRepeatStatus = false; } $this->oldShowTimezone = $this->origCcShowDay->getDbTimezone(); @@ -1565,6 +1568,10 @@ SQL; if ($this->origCcShowDay->getDbRepeatType() == 2 || $this->origCcShowDay->getDbRepeatType() == 3) { $day = null; + } else if (!$this->origShowRepeatStatus) { + //keep current show day to use for updating cc_show_day rule + $keepDay = $day; + $day = $this->origCcShowDay->getDbDay(); } $showDay = CcShowDaysQuery::create() ->filterByDbShowId($showId) @@ -1577,6 +1584,10 @@ SQL; //type has changed $showDay = new CcShowDays(); } + + if (isset($keepDay)) { + $day = $keepDay; + } } else { $showDay = new CcShowDays(); }