diff --git a/Vagrantfile b/Vagrantfile index f85987c79..a82b48cd0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -60,12 +60,6 @@ Vagrant.configure("2") do |config| os.vm.box = "bento/debian-9.2" provision_libretime(os, "debian.sh", installer_args) end - config.vm.define "debian-wheezy" do |os| - STDERR.puts 'WARNING: The "debian-wheezy" option is deprecated. Please migrate to "debian-stretch".' - STDERR.puts - os.vm.box = "bento/debian-7.11" - provision_libretime(os, "debian.sh", installer_args) - end config.vm.define "centos" do |os| os.vm.box = 'centos/7' provision_libretime(os, "centos.sh", installer_args + "--selinux") diff --git a/airtime_mvc/application/forms/AddShowAutoPlaylist.php b/airtime_mvc/application/forms/AddShowAutoPlaylist.php index bb4cead12..c987480b2 100644 --- a/airtime_mvc/application/forms/AddShowAutoPlaylist.php +++ b/airtime_mvc/application/forms/AddShowAutoPlaylist.php @@ -15,7 +15,7 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm // Add autoplaylist checkbox element $this->addElement('checkbox', 'add_show_has_autoplaylist', array( - 'label' => _('Auto Schedule Playlist ?'), + 'label' => _('Add Autoloading Playlist ?'), 'required' => false, 'class' => 'input_text', 'decorators' => array('ViewHelper') @@ -29,7 +29,7 @@ class Application_Form_AddShowAutoPlaylist extends Zend_Form_SubForm $this->addElement($autoPlaylistSelect); // Add autoplaylist checkbox element $this->addElement('checkbox', 'add_show_autoplaylist_repeat', array( - 'label' => _('Repeat AutoPlaylist Until Show is Full ?'), + 'label' => _('Repeat Playlist Until Show is Full ?'), 'required' => false, 'class' => 'input_text', 'decorators' => array('ViewHelper') diff --git a/airtime_mvc/application/forms/SmartBlockCriteria.php b/airtime_mvc/application/forms/SmartBlockCriteria.php index c05bf6cf2..870faf26d 100644 --- a/airtime_mvc/application/forms/SmartBlockCriteria.php +++ b/airtime_mvc/application/forms/SmartBlockCriteria.php @@ -485,15 +485,6 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm $limitValue->setValue(1); } - //getting block content candidate count that meets criteria - $bl = new Application_Model_Block($p_blockId); - if ($p_isValid) { - $files = $bl->getListofFilesMeetCriteria(); - $showPoolCount = true; - } else { - $files = null; - $showPoolCount = false; - } $generate = new Zend_Form_Element_Button('generate_button'); $generate->setAttrib('class', 'sp-button btn'); diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 9fe070efc..bf61b21a5 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -1475,7 +1475,7 @@ SQL; foreach ($out as $crit) { $criteria = $crit->getDbCriteria(); $modifier = $crit->getDbModifier(); - $value = htmlspecialchars($crit->getDbValue()); + $value = $crit->getDbValue(); $extra = $crit->getDbExtra(); if ($criteria == "limit") { diff --git a/airtime_mvc/application/models/airtime/ImportedPodcast.php.bak b/airtime_mvc/application/models/airtime/ImportedPodcast.php.bak deleted file mode 100644 index fa4804f38..000000000 --- a/airtime_mvc/application/models/airtime/ImportedPodcast.php.bak +++ /dev/null @@ -1,251 +0,0 @@ -get_title(); - $podcastArray["description"] = $rss->get_description(); - $podcastArray["link"] = $rss->get_link(); - $podcastArray["language"] = $rss->get_language(); - $podcastArray["copyright"] = $rss->get_copyright(); - $podcastArray["creator"] = $rss->get_author()->get_name(); - $podcastArray["category"] = $rss->get_categories(); - - $itunesChannel = "http://www.itunes.com/dtds/podcast-1.0.dtd"; - - $itunesSubtitle = $rss->get_channel_tags($itunesChannel, 'subtitle'); - $podcastArray["itunes_subtitle"] = isset($itunesSubtitle[0]["data"]) ? $itunesSubtitle[0]["data"] : ""; - - $itunesCategory = $rss->get_channel_tags($itunesChannel, 'category'); - $categoryArray = array(); - foreach ($itunesCategory as $c => $data) { - foreach ($data["attribs"] as $attrib) { - array_push($categoryArray, $attrib["text"]); - } - } - $podcastArray["itunes_category"] = implode(",", $categoryArray); - - $itunesAuthor = $rss->get_channel_tags($itunesChannel, 'author'); - $podcastArray["itunes_author"] = isset($itunesAuthor[0]["data"]) ? $itunesAuthor[0]["data"] : ""; - - $itunesSummary = $rss->get_channel_tags($itunesChannel, 'summary'); - $podcastArray["itunes_summary"] = isset($itunesSummary[0]["data"]) ? $itunesSummary[0]["data"] : ""; - - $itunesKeywords = $rss->get_channel_tags($itunesChannel, 'keywords'); - $podcastArray["itunes_keywords"] = isset($itunesKeywords[0]["data"]) ? $itunesKeywords[0]["data"] : ""; - - $itunesExplicit = $rss->get_channel_tags($itunesChannel, 'explicit'); - $podcastArray["itunes_explicit"] = isset($itunesExplicit[0]["data"]) ? $itunesExplicit[0]["data"] : ""; - - self::validatePodcastMetadata($podcastArray); - - try { - $podcast = new ImportedPodcast(); - $podcast->fromArray($podcastArray, BasePeer::TYPE_FIELDNAME); - $podcast->setDbOwner(self::getOwnerId()); - $podcast->setDbType(IMPORTED_PODCAST); - $podcast->save(); - - return self::_generatePodcastArray($podcast, $rss); - } catch(Exception $e) { - $podcast->delete(); - throw $e; - } - } - - /** - * Fetches a Podcast's rss feed and returns all its episodes with - * the Podcast object - * - * @param $podcastId - * - * @throws PodcastNotFoundException - * @throws InvalidPodcastException - * @return array - Podcast Array with a full list of episodes - */ - public static function getPodcastById($podcastId) - { - $podcast = PodcastQuery::create()->findPk($podcastId); - if (!$podcast) { - throw new PodcastNotFoundException(); - } - - $rss = Application_Service_PodcastService::getPodcastFeed($podcast->getDbUrl()); - if (!$rss) { - throw new InvalidPodcastException(); - } - - return self::_generatePodcastArray($podcast, $rss); - } - - /** - * Given a podcast object and a SimplePie feed object, - * generate a data array to pass back to the front-end - * - * @param Podcast $podcast Podcast model object - * @param SimplePie $rss SimplePie feed object - * - * @return array - */ - private static function _generatePodcastArray($podcast, $rss) { - $podcastArray = $podcast->toArray(BasePeer::TYPE_FIELDNAME); - - $podcastArray["episodes"] = array(); - foreach ($rss->get_items() as $item) { - /** @var SimplePie_Item $item */ - array_push($podcastArray["episodes"], array( - "guid" => $item->get_id(), - "title" => $item->get_title(), - "author" => $item->get_author()->get_name(), - "description" => $item->get_description(), - "pub_date" => $item->get_date("Y-m-d H:i:s"), - "link" => $item->get_link(), - "enclosure" => $item->get_enclosure() - )); - } - - return $podcastArray; - } - - /** - * Updates a Podcast object with the given metadata - * - * @param $podcastId - * @param $data - * @return array - * @throws Exception - * @throws PodcastNotFoundException - */ - public static function updateFromArray($podcastId, $data) - { - $podcast = PodcastQuery::create()->findPk($podcastId); - if (!$podcast) { - throw new PodcastNotFoundException(); - } - - self::removePrivateFields($data); - self::validatePodcastMetadata($data); - - $podcast->fromArray($data, BasePeer::TYPE_FIELDNAME); - $podcast->save(); - - return $podcast->toArray(BasePeer::TYPE_FIELDNAME); - } - - /** - * Deletes a Podcast and its podcast episodes - * - * @param $podcastId - * @throws Exception - * @throws PodcastNotFoundException - */ - public static function deleteById($podcastId) - { - $podcast = PodcastQuery::create()->findPk($podcastId); - if ($podcast) { - $podcast->delete(); - } else { - throw new PodcastNotFoundException(); - } - } - - /** - * Trims the podcast metadata to fit the table's column max size - * - * @param $podcastArray - */ - private static function validatePodcastMetadata(&$podcastArray) - { - $podcastTable = PodcastPeer::getTableMap(); - - foreach ($podcastArray as $key => &$value) { - try { - // Make sure column exists in table - $columnMaxSize = $podcastTable->getColumn($key)->getSize(); - } catch (PropelException $e) { - continue; - } - - if (strlen($value) > $columnMaxSize) { - $value = substr($value, 0, $podcastTable->getColumn($key)->getSize()); - } - } - } - - private static function removePrivateFields(&$data) - { - foreach (self::$privateFields as $key) { - unset($data[$key]); - } - } - - //TODO move this somewhere where it makes sense - private static function getOwnerId() - { - try { - if (Zend_Auth::getInstance()->hasIdentity()) { - $service_user = new Application_Service_UserService(); - return $service_user->getCurrentUser()->getDbId(); - } else { - $defaultOwner = CcSubjsQuery::create() - ->filterByDbType('A') - ->orderByDbId() - ->findOne(); - if (!$defaultOwner) { - // what to do if there is no admin user? - // should we handle this case? - return null; - } - return $defaultOwner->getDbId(); - } - } catch(Exception $e) { - Logging::info($e->getMessage()); - } - } -} 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 5d5eda5f6..a694866a8 100644 --- a/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml +++ b/airtime_mvc/application/views/scripts/form/add-show-autoplaylist.phtml @@ -7,9 +7,11 @@
More information"); ?>