diff --git a/airtime_mvc/application/common/AutoPlaylistManager.php b/airtime_mvc/application/common/AutoPlaylistManager.php index 0e71ae208..36e97b20d 100644 --- a/airtime_mvc/application/common/AutoPlaylistManager.php +++ b/airtime_mvc/application/common/AutoPlaylistManager.php @@ -1,7 +1,6 @@ $lastPolled + self::$_AUTOPLAYLIST_POLL_INTERVAL_SECONDS); } - /* * This function is copied from the TestUser class and is used to instantiate a user so that * the Scheduler model can be utilized by buildAutoPlaylist. @@ -45,7 +43,6 @@ class AutoPlaylistManager { } } - /** * Find all shows with autoplaylists who have yet to have their playlists built and added to the schedule * @@ -70,7 +67,6 @@ class AutoPlaylistManager { Zend_Session::stop(); } - /** * Find all show instances starting in the next hour with autoplaylists not yet added to the schedule * @@ -93,5 +89,4 @@ class AutoPlaylistManager { ->filterByDbAutoPlaylistBuilt(false) ->find(); } - } diff --git a/airtime_mvc/application/common/TaskManager.php b/airtime_mvc/application/common/TaskManager.php index 6f961d7c5..401e9a969 100644 --- a/airtime_mvc/application/common/TaskManager.php +++ b/airtime_mvc/application/common/TaskManager.php @@ -223,7 +223,6 @@ class CeleryTask implements AirtimeTask { } /** - * * Class AutoPlaylistTask * * Checks for shows with an autoplaylist that needs to be filled in @@ -231,7 +230,6 @@ class CeleryTask implements AirtimeTask { */ class AutoPlaylistTask implements AirtimeTask { - /** * Checks whether or not the autoplaylist polling interval has passed * @@ -251,8 +249,6 @@ class AutoPlaylistTask implements AirtimeTask } } - - /** * Class PodcastTask * diff --git a/airtime_mvc/application/configs/airtime-conf.php b/airtime_mvc/application/configs/airtime-conf.php index dd8159a27..ad939b2ce 100644 --- a/airtime_mvc/application/configs/airtime-conf.php +++ b/airtime_mvc/application/configs/airtime-conf.php @@ -1,6 +1,6 @@ array ( @@ -22,14 +22,6 @@ $conf = array ( ), 'default' => 'airtime', ), - 'log' => - array ( - 'type' => 'file', - 'name' => './propel.log', - 'ident' => 'propel', - 'level' => '7', - 'conf' => '', - ), 'generator_version' => '1.7.0', ); $conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php'); diff --git a/airtime_mvc/application/controllers/downgrade_sql/airtime_2.5.15/downgrade.sql b/airtime_mvc/application/controllers/downgrade_sql/airtime_2.5.15/downgrade.sql index ddb9bbc6d..c88134246 100644 --- a/airtime_mvc/application/controllers/downgrade_sql/airtime_2.5.15/downgrade.sql +++ b/airtime_mvc/application/controllers/downgrade_sql/airtime_2.5.15/downgrade.sql @@ -1 +1 @@ -ALTER TABLE third_party_track_references ALTER COLUMN file_id SET NOT NULL; +ALTER TABLE third_party_track_references ALTER COLUMN file_id SET NOT NULL; \ No newline at end of file diff --git a/airtime_mvc/application/forms/AddShowAutoPlaylist.php b/airtime_mvc/application/forms/AddShowAutoPlaylist.php index d976983ba..83b2f9946 100644 --- a/airtime_mvc/application/forms/AddShowAutoPlaylist.php +++ b/airtime_mvc/application/forms/AddShowAutoPlaylist.php @@ -4,14 +4,12 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm { public function init() { - $this->setDecorators(array( + $this->setDecorators(array( array('ViewScript', array('viewScript' => 'form/add-show-autoplaylist.phtml')) )); - - $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); - // retrieves the length limit for each char field + // retrieves the length limit for each char field // and store to assoc array $maxLens = Application_Model_Show::getMaxLengths(); @@ -25,31 +23,12 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm $autoPlaylistSelect = new Zend_Form_Element_Select("add_show_autoplaylist_id"); $autoPlaylistSelect->setLabel(_("Select Playlist")); - $autoPlaylistSelect->setMultiOptions($this->getPlaylistNames()); + $autoPlaylistSelect->setMultiOptions(Application_Model_Library::getPlaylistNames()); $autoPlaylistSelect->setValue(null); $autoPlaylistSelect->setDecorators(array('ViewHelper')); $this->addElement($autoPlaylistSelect); - } - - -private function getPlaylistNames() -{ - $playlistNames = array(NULL => _("None")); - - - $playlists = CcPlaylistQuery::create() - ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) - ->find(); - - foreach ($playlists as $playlist) { - - $playlistNames[$playlist->getDbId()] = $playlist->getDbName(); } - return $playlistNames; -} - - public function disable() { $elements = $this->getElements(); diff --git a/airtime_mvc/application/forms/AddShowWhat.php b/airtime_mvc/application/forms/AddShowWhat.php index ce7353aaf..fd9423c11 100644 --- a/airtime_mvc/application/forms/AddShowWhat.php +++ b/airtime_mvc/application/forms/AddShowWhat.php @@ -39,7 +39,7 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm 'filters' => array('StringTrim'), 'validators' => array($notEmptyValidator, array('StringLength', false, array(0, $maxLens['url']))) )); - + // Add genre element $this->addElement('text', 'add_show_genre', array( 'label' => _('Genre:'), @@ -59,7 +59,6 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm $descText = $this->getElement('add_show_description'); - $descText->setDecorators(array(array('ViewScript', array( 'viewScript' => 'form/add-show-block.phtml', 'class' => 'block-display' @@ -67,51 +66,30 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm // Add the instance description $this->addElement('textarea', 'add_show_instance_description', array( - 'label' => _('Instance Description:'), - 'required' => false, - 'class' => 'input_text_area', - 'validators' => array(array('StringLength', false, array(0, $maxLens['description']))) + 'label' => _('Instance Description:'), + 'required' => false, + 'class' => 'input_text_area', + 'validators' => array(array('StringLength', false, array(0, $maxLens['description']))) )); $instanceDesc = $this->getElement('add_show_instance_description'); - + $instanceDesc->setDecorators(array(array('ViewScript', array( - 'viewScript' => 'form/add-show-block.phtml', - 'class' => 'block-display' + 'viewScript' => 'form/add-show-block.phtml', + 'class' => 'block-display' )))); $instanceDesc->setAttrib('disabled','disabled'); - } - -private function getPlaylistNames() -{ - $playlistNames = array(NULL => _("None")); - - - $playlists = CcPlaylistQuery::create() - ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) - ->find(); - - foreach ($playlists as $playlist) { - - $playlistNames[$playlist->getDbId()] = $playlist->getDbName(); - } - - return $playlistNames; -} - - - -/** + /** * Enable the instance description when editing a show instance */ public function enableInstanceDesc() { - $el = $this->getElement('add_show_instance_description'); - Logging::info($el); - $el->setAttrib('disabled', null); - $el->setAttrib('readonly', null); + $el = $this->getElement('add_show_instance_description'); + Logging::info($el); + $el->setAttrib('disabled', null); + $el->setAttrib('readonly', null); } public function disable() diff --git a/airtime_mvc/application/models/Library.php b/airtime_mvc/application/models/Library.php index 336bd7e7b..36fbbcbba 100644 --- a/airtime_mvc/application/models/Library.php +++ b/airtime_mvc/application/models/Library.php @@ -33,4 +33,18 @@ class Application_Model_Library } } + public static function getPlaylistNames() + { + $playlistNames = array(NULL => _("None")); + + $playlists = CcPlaylistQuery::create() + ->setFormatter(ModelCriteria::FORMAT_ON_DEMAND) + ->find(); + + foreach ($playlists as $playlist) { + $playlistNames[$playlist->getDbId()] = $playlist->getDbName(); + } + + return $playlistNames; + } } diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 6881b9014..9fbe4f759 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -129,7 +129,6 @@ class Application_Model_Show return $this->_showId; } - public function getHasAutoPlaylist() { $show = CcShowQuery::create()->findPK($this->_showId); @@ -156,7 +155,6 @@ class Application_Model_Show $show->setDbAutoPlaylistId($playlistid); } - public function getHosts() { $sql = <<save(); } - public function updateScheduledTime() { $con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME); $this->_showInstance->updateDbTimeFilled($con); } - - - - public function isDeleted() { diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index f5aab77a3..4489f70f0 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -20,7 +20,7 @@ class Application_Service_ShowFormService public function createShowForms() { $formWhat = new Application_Form_AddShowWhat(); - $formAutoPlaylist = new Application_Form_AddShowAutoPlaylist(); + $formAutoPlaylist = new Application_Form_AddShowAutoPlaylist(); $formWho = new Application_Form_AddShowWho(); $formWhen = new Application_Form_AddShowWhen(); $formRepeats = new Application_Form_AddShowRepeats(); @@ -31,7 +31,7 @@ class Application_Service_ShowFormService $formRebroadcast = new Application_Form_AddShowRebroadcastDates(); $formWhat->removeDecorator('DtDdWrapper'); - $formAutoPlaylist->removeDecorator('DtDdWrapper'); + $formAutoPlaylist->removeDecorator('DtDdWrapper'); $formWho->removeDecorator('DtDdWrapper'); $formWhen->removeDecorator('DtDdWrapper'); $formRepeats->removeDecorator('DtDdWrapper'); @@ -43,7 +43,7 @@ class Application_Service_ShowFormService $forms = array(); $forms["what"] = $formWhat; - $forms["autoplaylist"] = $formAutoPlaylist; + $forms["autoplaylist"] = $formAutoPlaylist; $forms["who"] = $formWho; $forms["when"] = $formWhen; $forms["repeats"] = $formRepeats; @@ -61,7 +61,7 @@ class Application_Service_ShowFormService * Popluates the what, autoplaylist, when, and repeat forms * with default values */ - public function populateNewShowForms($formWhat, $formWhen, $formRepeats) + public function populateNewShowForms($formWhat, $formWhen, $formRepeats) { $formWhat->populate( array('add_show_id' => '-1', @@ -96,7 +96,7 @@ class Application_Service_ShowFormService */ $forms["what"]->makeReadonly(); $forms["what"]->enableInstanceDesc(); - $forms["autoplaylist"]->disable(); + $forms["autoplaylist"]->disable(); $forms["repeats"]->disable(); $forms["who"]->disable(); $forms["style"]->disable(); @@ -119,7 +119,7 @@ class Application_Service_ShowFormService { $this->populateFormWhat($forms["what"]); //local show start DT - $this->populateFormAutoPlaylist($forms["autoplaylist"]); + $this->populateFormAutoPlaylist($forms["autoplaylist"]); $showStart = $this->populateFormWhen($forms["when"]); $this->populateFormRepeats($forms["repeats"], $showStart); $this->populateFormWho($forms["who"]); @@ -130,12 +130,11 @@ class Application_Service_ShowFormService $this->populateFormRebroadcastAbsolute($forms["abs_rebroadcast"]); } - private function populateFormWhat($form) + private function populateFormWhat($form) { $ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId); - - $form->populate( + $form->populate( array( 'add_show_instance_id' => $this->instanceId, 'add_show_id' => $this->ccShow->getDbId(), @@ -143,18 +142,15 @@ class Application_Service_ShowFormService 'add_show_url' => $this->ccShow->getDbUrl(), 'add_show_genre' => $this->ccShow->getDbGenre(), 'add_show_description' => $this->ccShow->getDbDescription(), - 'add_show_instance_description' => $ccShowInstance->getDbDescription(), + 'add_show_instance_description' => $ccShowInstance->getDbDescription(), )); } + private function populateFormAutoPlaylist($form) { $ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId); - - if (!$this->ccShow->getDbAutoPlaylistId()) { -// $form->disableAutoPlaylist(); - } - $form->populate( + $form->populate( array( 'add_show_has_autoplaylist' => $this->ccShow->getDbHasAutoPlaylist() ? 1 : 0, 'add_show_autoplaylist_id' => $this->ccShow->getDbAutoPlaylistId() @@ -294,7 +290,7 @@ class Application_Service_ShowFormService //end dates are stored non-inclusively so we need to //subtract one day if (!is_null($repeatEndDate)) { - $repeatEndDate->sub(new DateInterval("P1D")); + $repeatEndDate->sub(new DateInterval("P1D")); } //default monthly repeat type @@ -348,27 +344,27 @@ class Application_Service_ShowFormService private function populateFormStyle($form) { - $src = $this->ccShow->getDbImagePath() ? - $this->imagePathToDataUri($this->ccShow->getDbImagePath()) : ''; - + $src = $this->ccShow->getDbImagePath() ? + $this->imagePathToDataUri($this->ccShow->getDbImagePath()) : ''; + $form->populate( array( 'add_show_background_color' => $this->ccShow->getDbBackgroundColor(), 'add_show_color' => $this->ccShow->getDbColor(), - 'add_show_logo_current' => $src)); + 'add_show_logo_current' => $src)); } /** * Convert a static image from disk to a base64 data URI * * @param unknown $path - * - the path to the image on the disk + * - the path to the image on the disk * @return string - * - the data URI representation of the image + * - the data URI representation of the image */ private function imagePathToDataUri($path) { $imageData = null; - $bytesRead = 0; + $bytesRead = 0; try { ob_start(); header("Content-type: image/*"); @@ -382,9 +378,9 @@ class Application_Service_ShowFormService Logging::error("Failed to read image: " . $path); $imageData = null; } - // return the data URI - data:{mime};base64,{data} - return ($imageData === null || $imageData === '') ? - '' : 'data: '.mime_content_type($path).';base64,'.$imageData; + // return the data URI - data:{mime};base64,{data} + return ($imageData === null || $imageData === '') ? + '' : 'data: '.mime_content_type($path).';base64,'.$imageData; } private function populateFormLive($form) @@ -587,8 +583,8 @@ class Application_Service_ShowFormService public function calculateDuration($start, $end, $timezone) { try { - - $tz = new DateTimeZone($timezone); + + $tz = new DateTimeZone($timezone); $startDateTime = new DateTime($start, $tz); $endDateTime = new DateTime($end, $tz); @@ -606,7 +602,7 @@ class Application_Service_ShowFormService return $duration->format('%r%Hh %Im'); } } catch (Exception $e) { - Logging::info($e->getMessage()); + Logging::info($e->getMessage()); return "Invalid Date"; } } diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index f4b28027b..b4e8c949b 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -1542,8 +1542,8 @@ SQL; $ccShow->setDbLiveStreamPass($showData['custom_password']); $ccShow->setDbHasAutoPlaylist($showData['add_show_has_autoplaylist'] == 1); // added to prevent errors with insert due to a lack of data - if ($showData['add_show_autoplaylist_id'] != '') { - $ccShow->setDbAutoPlaylistId($showData['add_show_autoplaylist_id']); + if ($showData['add_show_autoplaylist_id'] != '') { + $ccShow->setDbAutoPlaylistId($showData['add_show_autoplaylist_id']); } //Here a user has edited a show and linked it. diff --git a/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml b/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml index 2e2c45cdf..9410a4b7e 100644 --- a/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml +++ b/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml @@ -20,4 +20,3 @@ - diff --git a/airtime_mvc/application/views/scripts/form/add-show-block.phtml b/airtime_mvc/application/views/scripts/form/add-show-block.phtml index 1f80164d9..001e0fea6 100644 --- a/airtime_mvc/application/views/scripts/form/add-show-block.phtml +++ b/airtime_mvc/application/views/scripts/form/add-show-block.phtml @@ -13,5 +13,3 @@ } ?> - - diff --git a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml index 82cfcd9d5..73a6591fc 100644 --- a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml +++ b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml @@ -15,7 +15,6 @@
autoplaylist; ?>
-

fieldset:last").hide(); $("#add_show_rebroadcast_relative").hide(); @@ -313,7 +312,6 @@ function setAddShowEvents(form) { } }); - form.find("#add_show_repeats").click(function(){ $(this).blur(); form.find("#schedule-show-when > fieldset:last").toggle();