Merge branch '2.5.x' of github.com:sourcefabric/Airtime into 2.5.x
This commit is contained in:
commit
1854d76f03
2 changed files with 12 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -611,7 +611,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
|
||||
$data = ShowServiceData::getWeeklyRepeatNoEndNoRRData();
|
||||
$data["add_show_start_date"] = "2016-01-29";
|
||||
$data["add_show_day_check"] = array(5);
|
||||
$data["add_show_day_check"] = array(5, 6);
|
||||
$data["add_show_linked"] = 1;
|
||||
$showService = new Application_Service_ShowService(null, $data);
|
||||
$showService->addUpdateShow($data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue