diff --git a/airtime_mvc/application/layouts/scripts/login.phtml b/airtime_mvc/application/layouts/scripts/login.phtml index 6a9879673..b12f00d34 100644 --- a/airtime_mvc/application/layouts/scripts/login.phtml +++ b/airtime_mvc/application/layouts/scripts/login.phtml @@ -21,9 +21,9 @@ $companySiteAnchor = "" . $company . ""; - echo sprintf(_('%1$s copyright © %2$s All rights reserved.%3$s' - . 'Maintained and distributed under the %4$s by %5$s'), - PRODUCT_NAME, $company, "
", + echo sprintf(_('%1$s copyright © %2$s All rights reserved.
' + . 'Maintained and distributed under the %3$s by %4$s'), + PRODUCT_NAME, $company, $licenseSiteAnchor, $companySiteAnchor); ?> diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 39415beaa..4208ff5c7 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -1112,35 +1112,36 @@ class Application_Model_Scheduler $removedItems = CcScheduleQuery::create()->findPks($scheduledIds); - //check to make sure all items selected are up to date - foreach ($removedItems as $removedItem) { + // This array is used to keep track of every show instance that was + // effected by the track deletion. It will be used later on to + // remove gaps in the schedule and adjust crossfade times. + $effectedInstanceIds = array(); + foreach ($removedItems as $removedItem) { $instance = $removedItem->getCcShowInstances($this->con); + $effectedInstanceIds[] = $instance->getDbId(); //check if instance is linked and if so get the schedule items //for all linked instances so we can delete them too if (!$cancelShow && $instance->getCcShow()->isLinked()) { //returns all linked instances if linked $ccShowInstances = $this->getInstances($instance->getDbId()); + $instanceIds = array(); foreach ($ccShowInstances as $ccShowInstance) { $instanceIds[] = $ccShowInstance->getDbId(); } - /* - * Find all the schedule items that are in the same position - * as the selected item by the user. - * The position of each track is the same across each linked instance - */ + $effectedInstanceIds = array_merge($effectedInstanceIds, $instanceIds); + + // Delete the same track, represented by $removedItem, in + // each linked show instance. $itemsToDelete = CcScheduleQuery::create() ->filterByDbPosition($removedItem->getDbPosition()) ->filterByDbInstanceId($instanceIds, Criteria::IN) - ->find(); - foreach ($itemsToDelete as $item) { - if (!$removedItems->contains($item)) { - $removedItems->append($item); - } - } + ->filterByDbId($removedItem->getDbId(), Criteria::NOT_EQUAL) + ->delete($this->con); } + //check to truncate the currently playing item instead of deleting it. if ($removedItem->isCurrentItem($this->epochNow)) { @@ -1165,29 +1166,11 @@ class Application_Model_Scheduler } else { $removedItem->delete($this->con); } - - // update is_scheduled in cc_files but only if - // the file is not scheduled somewhere else - $fileId = $removedItem->getDbFileId(); - // check if the removed item is scheduled somewhere else - $futureScheduledFiles = Application_Model_Schedule::getAllFutureScheduledFiles(); - if (!is_null($fileId) && !in_array($fileId, $futureScheduledFiles)) { - $db_file = CcFilesQuery::create()->findPk($fileId, $this->con); - $db_file->setDbIsScheduled(false)->save($this->con); - } } + Application_Model_StoredFile::updatePastFilesIsScheduled(); if ($adjustSched === true) { - //get the show instances of the shows we must adjust times for. - foreach ($removedItems as $item) { - - $instance = $item->getDBInstanceId(); - if (!in_array($instance, $showInstances)) { - $showInstances[] = $instance; - } - } - - foreach ($showInstances as $instance) { + foreach ($effectedInstanceIds as $instance) { $this->removeGaps($instance); $this->calculateCrossfades($instance); } @@ -1195,7 +1178,7 @@ class Application_Model_Scheduler //update the status flag in cc_schedule. $instances = CcShowInstancesQuery::create() - ->filterByPrimaryKeys($showInstances) + ->filterByPrimaryKeys($effectedInstanceIds) ->find($this->con); foreach ($instances as $instance) { diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index b0507dba6..987b5a6c2 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1131,7 +1131,6 @@ SELECT s.name, s.genre, s.id, si.id AS instance_id, - si.description AS instance_description, si.record, s.url, s.image_path, @@ -1220,7 +1219,6 @@ SELECT si.starts AS start_timestamp, s.description, s.id, si.id AS instance_id, - si.description AS instance_description, si.record, s.url, s.image_path, @@ -1267,7 +1265,6 @@ SQL; $results['previousShow'][0] = array( "id" => $rows[$i-1]['id'], "instance_id" => $rows[$i-1]['instance_id'], - "instance_description" => $rows[$i-1]['instance_description'], "name" => $rows[$i-1]['name'], "description" => $rows[$i-1]['description'], "url" => $rows[$i-1]['url'], @@ -1286,7 +1283,6 @@ SQL; $results['nextShow'][0] = array( "id" => $rows[$i+1]['id'], "instance_id" => $rows[$i+1]['instance_id'], - "instance_description" => $rows[$i+1]['instance_description'], "name" => $rows[$i+1]['name'], "description" => $rows[$i+1]['description'], "url" => $rows[$i+1]['url'], @@ -1309,7 +1305,6 @@ SQL; $results['nextShow'][0] = array( "id" => $rows[$i]['id'], "instance_id" => $rows[$i]['instance_id'], - "instance_description" => $rows[$i]['instance_description'], "name" => $rows[$i]['name'], "description" => $rows[$i]['description'], "url" => $rows[$i]['url'], @@ -1329,7 +1324,6 @@ SQL; $results['previousShow'][0] = array( "id" => $rows[$previousShowIndex]['id'], "instance_id" => $rows[$previousShowIndex]['instance_id'], - "instance_description" => $rows[$previousShowIndex]['instance_description'], "name" => $rows[$previousShowIndex]['name'], "description" => $rows[$previousShowIndex]['description'], "start_timestamp" => $rows[$previousShowIndex]['start_timestamp'], diff --git a/airtime_mvc/application/views/scripts/form/register-dialog.phtml b/airtime_mvc/application/views/scripts/form/register-dialog.phtml index 999eb045d..358cc692a 100644 --- a/airtime_mvc/application/views/scripts/form/register-dialog.phtml +++ b/airtime_mvc/application/views/scripts/form/register-dialog.phtml @@ -3,10 +3,10 @@
-
") ?> + " + ."Click the box below and we'll make sure the features you use are constantly improving."), + PRODUCT_NAME)?>