Removed unused function.

Removed commented out code.
Renamed fillNewLinkedInstances to fillLinkedInstances.
Streamline show instance content if a show goes from unlinked to linked.
This commit is contained in:
drigato 2014-08-21 16:40:01 -04:00
parent 11de8bd988
commit 6249deb1ac
4 changed files with 53 additions and 52 deletions

View file

@ -15,7 +15,6 @@ class Application_Service_ShowService
private $isRebroadcast;
private $repeatType;
private $isUpdate;
/*private $linkedShowContent;*/
private $oldShowTimezone;
private $localShowStartHour;
private $localShowStartMin;
@ -199,6 +198,7 @@ class Application_Service_ShowService
$daysAdded = array();
if ($this->isUpdate) {
if (!$this->ccShow->getCcShowDayss()->isEmpty()) {
$this->storeOrigLocalShowInfo();
}
@ -371,7 +371,7 @@ class Application_Service_ShowService
foreach ($ccShows as $ccShow) {
if (($this->isUpdate || $fillInstances) && $ccShow->isLinked()) {
Application_Service_SchedulerService::fillNewLinkedInstances(
Application_Service_SchedulerService::fillLinkedInstances(
$ccShow, $this->newInstanceIdsCreated[$ccShow->getDbId()]);
}
}
@ -1145,16 +1145,13 @@ SQL;
if ($this->hasInstance($utcStartDateTime)) {
$ccShowInstance = $this->getInstance($utcStartDateTime);
$newInstance = false;
//$updateScheduleStatus = true;
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
//$updateScheduleStatus = false;
}
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
//$updateScheduleStatus = false;
}
/* When editing the start/end time of a repeating show, we don't want to
@ -1247,11 +1244,9 @@ SQL;
if ($this->isUpdate && $this->hasInstance($utcStartDateTime)) {
$ccShowInstance = $this->getInstance($utcStartDateTime);
$newInstance = false;
//$updateScheduleStatus = true;
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
//$updateScheduleStatus = false;
}
/* When editing the start/end time of a repeating show, we don't want to
@ -1520,10 +1515,14 @@ SQL;
$ccShow->setDbLiveStreamUsingCustomAuth($showData['cb_custom_auth'] == 1);
$ccShow->setDbLiveStreamUser($showData['custom_username']);
$ccShow->setDbLiveStreamPass($showData['custom_password']);
// Once a show is unlinked it cannot be linked again
if ($ccShow->getDbLinked() && !$showData["add_show_linked"]) {
$ccShow->setDbIsLinkable(false);
//Here a user has edited a show and linked it.
//We need to grab the existing show instances ids and fill their content
//with the content from the show instance that was clicked on to edit the show.
//We do this because linked show instances need to have the same content in each.
if ($this->isUpdate && (!$ccShow->getDbLinked() && $showData["add_show_linked"])) {
$existingShowInstanceIds = $ccShow->getFutureInstanceIds(new Criteria());
Application_Service_SchedulerService::fillLinkedInstances($ccShow, $existingShowInstanceIds, $showData["add_show_instance_id"]);
}
$ccShow->setDbLinked($showData["add_show_linked"]);