Fixed changing the start date on a non-repeating show

This commit is contained in:
drigato 2014-03-10 17:32:54 -04:00
parent 78d34a6d16
commit 8ad866c2a2
1 changed files with 11 additions and 0 deletions

View File

@ -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();
}