CC-5085: Linked show: Changing a regular show to linked show and updating the weekday, all the contents will lost
This commit is contained in:
parent
ea73d98c49
commit
0e5ba2f07f
|
@ -155,7 +155,14 @@ class CcShow extends BaseCcShow {
|
||||||
*/
|
*/
|
||||||
public function getCcShowInstancess($criteria = null, PropelPDO $con = null)
|
public function getCcShowInstancess($criteria = null, PropelPDO $con = null)
|
||||||
{
|
{
|
||||||
if(null === $this->collCcShowInstancess || null !== $criteria) {
|
return CcShowInstancesQuery::create(null, $criteria)
|
||||||
|
->filterByCcShow($this)
|
||||||
|
->filterByDbModifiedInstance(false)
|
||||||
|
->filterByDbEnds(gmdate("Y-m-d H:i:s"), criteria::GREATER_THAN)
|
||||||
|
->orderByDbId()
|
||||||
|
->find($con);
|
||||||
|
|
||||||
|
/*if(null === $this->collCcShowInstancess || null !== $criteria) {
|
||||||
if ($this->isNew() && null === $this->collCcShowInstancess) {
|
if ($this->isNew() && null === $this->collCcShowInstancess) {
|
||||||
// return empty collection
|
// return empty collection
|
||||||
$this->initCcShowInstancess();
|
$this->initCcShowInstancess();
|
||||||
|
@ -172,7 +179,7 @@ class CcShow extends BaseCcShow {
|
||||||
$this->collCcShowInstancess = $collCcShowInstancess;
|
$this->collCcShowInstancess = $collCcShowInstancess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->collCcShowInstancess;
|
return $this->collCcShowInstancess;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInstanceIds() {
|
public function getInstanceIds() {
|
||||||
|
|
|
@ -201,23 +201,23 @@ class Application_Service_ShowService
|
||||||
break;
|
break;
|
||||||
case REPEAT_WEEKLY:
|
case REPEAT_WEEKLY:
|
||||||
$this->createRepeatingInstances($day, $populateUntil, REPEAT_WEEKLY,
|
$this->createRepeatingInstances($day, $populateUntil, REPEAT_WEEKLY,
|
||||||
new DateInterval("P7D"), $daysAdded, $fillInstances);
|
new DateInterval("P7D"), $daysAdded);
|
||||||
break;
|
break;
|
||||||
case REPEAT_BI_WEEKLY:
|
case REPEAT_BI_WEEKLY:
|
||||||
$this->createRepeatingInstances($day, $populateUntil, REPEAT_BI_WEEKLY,
|
$this->createRepeatingInstances($day, $populateUntil, REPEAT_BI_WEEKLY,
|
||||||
new DateInterval("P14D"), $daysAdded, $fillInstances);
|
new DateInterval("P14D"), $daysAdded);
|
||||||
break;
|
break;
|
||||||
case REPEAT_MONTHLY_MONTHLY:
|
case REPEAT_MONTHLY_MONTHLY:
|
||||||
$this->createMonthlyMonthlyRepeatInstances($day, $populateUntil, $fillInstances);
|
$this->createMonthlyMonthlyRepeatInstances($day, $populateUntil);
|
||||||
break;
|
break;
|
||||||
case REPEAT_MONTHLY_WEEKLY:
|
case REPEAT_MONTHLY_WEEKLY:
|
||||||
$this->createRepeatingInstances($day, $populateUntil, REPEAT_MONTHLY_WEEKLY,
|
$this->createRepeatingInstances($day, $populateUntil, REPEAT_MONTHLY_WEEKLY,
|
||||||
null, $daysAdded, $fillInstances);
|
null, $daysAdded);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->ccShow) && $fillInstances) {
|
if (isset($this->ccShow) && ($this->isUpdate || $fillInstances)) {
|
||||||
Application_Service_SchedulerService::fillLinkedShows(
|
Application_Service_SchedulerService::fillLinkedShows(
|
||||||
$this->ccShow);
|
$this->ccShow);
|
||||||
}
|
}
|
||||||
|
@ -824,7 +824,7 @@ SQL;
|
||||||
* @param unknown_type $isRebroadcast
|
* @param unknown_type $isRebroadcast
|
||||||
*/
|
*/
|
||||||
private function createRepeatingInstances($showDay, $populateUntil,
|
private function createRepeatingInstances($showDay, $populateUntil,
|
||||||
$repeatType, $repeatInterval, $daysAdded=null, $fillInstances)
|
$repeatType, $repeatInterval, $daysAdded=null)
|
||||||
{
|
{
|
||||||
$show_id = $showDay->getDbShowId();
|
$show_id = $showDay->getDbShowId();
|
||||||
$first_show = $showDay->getDbFirstShow(); //non-UTC
|
$first_show = $showDay->getDbFirstShow(); //non-UTC
|
||||||
|
|
Loading…
Reference in New Issue