diff --git a/CREDITS b/CREDITS index b52ae289e..aba40df17 100644 --- a/CREDITS +++ b/CREDITS @@ -2,7 +2,24 @@ CREDITS ======= +<<<<<<< HEAD Version 2.5.3 +======= +Version 2.5.2 + +Albert Santoni (albert.santoni@sourcefabric.org) +Denise Rigato (denise.rigato@sourcefabric.org) +Cliff Wang (cliff.wang@sourcefabric.org) +Nareg Asmarian (nareg.asmarian@sourcefabric.org) +Daniel James (daniel.james@sourcefabric.org) + +Community Contributors: +Robbt E + + + +Version 2.5.1 +>>>>>>> 2.5.x Albert Santoni (albert.santoni@sourcefabric.org) Role: Developer Team Lead @@ -25,6 +42,7 @@ Community Contributors: John Chewter + Version 2.5.0 ------------- diff --git a/README b/README index 0c003c7e7..d83dbde3b 100644 --- a/README +++ b/README @@ -43,7 +43,7 @@ For installation from git on Debian wheezy, run: Quick links to our resources ---------------------------- -User manuals: http://www.sourcefabric.org/en/airtime/manuals/ +User manual: http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/ Forums and mailing lists: http://forum.sourcefabric.org Bug tracker: http://dev.sourcefabric.org Source code: http://github.com/sourcefabric/Airtime diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 805a28500..2ebbac4ce 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -11,11 +11,13 @@ require_once __DIR__."/configs/constants.php"; require_once 'Preference.php'; require_once 'Locale.php'; require_once "DateHelper.php"; +require_once "HTTPHelper.php"; require_once "OsPath.php"; require_once "Database.php"; require_once "Timezone.php"; require_once "Auth.php"; require_once __DIR__.'/forms/helpers/ValidationTypes.php'; +require_once __DIR__.'/forms/helpers/CustomDecorators.php'; require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php'; require_once __DIR__.'/controllers/plugins/Maintenance.php'; diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index ba280d285..354b8f3dc 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -443,5 +443,59 @@ class Application_Common_DateHelper return $res; } + + /** + * Returns date fields from give start and end teimstamp strings + * if no start or end parameter is passed start will be set to 1 + * in the past and end to now + * + * @param string startTimestamp Y-m-d H:i:s + * @param string endTImestamp Y-m-d H:i:s + * @param string timezone (ex UTC) of the start and end parameters + * @return array (start DateTime, end DateTime) in UTC timezone + */ + public static function getStartEnd($startTimestamp, $endTimestamp, $timezone) + { + $prefTimezone = Application_Model_Preference::GetTimezone(); + $utcTimezone = new DateTimeZone("UTC"); + $utcNow = new DateTime("now", $utcTimezone); + + if (empty($timezone)) { + $userTimezone = new DateTimeZone($prefTimezone); + } else { + $userTimezone = new DateTimeZone($timezone); + } + + // default to 1 day + if (empty($startTimestamp) || empty($endTimestamp)) { + $startsDT = clone $utcNow; + $startsDT->sub(new DateInterval("P1D")); + $endsDT = clone $utcNow; + } else { + + try { + $startsDT = new DateTime($startTimestamp, $userTimezone); + $startsDT->setTimezone($utcTimezone); + + $endsDT = new DateTime($endTimestamp, $userTimezone); + $endsDT->setTimezone($utcTimezone); + + if ($startsDT > $endsDT) { + throw new Exception("start greater than end"); + } + } + catch (Exception $e) { + Logging::info($e); + Logging::info($e->getMessage()); + + $startsDT = clone $utcNow; + $startsDT->sub(new DateInterval("P1D")); + $endsDT = clone $utcNow; + } + + } + + return array($startsDT, $endsDT); + } } diff --git a/airtime_mvc/application/common/HTTPHelper.php b/airtime_mvc/application/common/HTTPHelper.php new file mode 100644 index 000000000..db314bb0b --- /dev/null +++ b/airtime_mvc/application/common/HTTPHelper.php @@ -0,0 +1,20 @@ +getParam("start", null), + $request->getParam("end", null), + $request->getParam("timezone", null) + ); + } +} diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index 7b27bc891..5ecf5d21e 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -11,7 +11,7 @@ define('COMPANY_SITE_URL' , 'http://sourcefabric.org/'); define('WHOS_USING_URL' , 'http://sourcefabric.org/en/airtime/whosusing'); define('TERMS_AND_CONDITIONS_URL' , 'http://www.sourcefabric.org/en/about/policy/'); define('PRIVACY_POLICY_URL' , 'http://www.sourcefabric.org/en/about/policy/'); -define('USER_MANUAL_URL' , 'http://www.sourcefabric.org/en/airtime/manuals/'); +define('USER_MANUAL_URL' , 'http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/'); define('LICENSE_VERSION' , 'GNU AGPL v.3'); define('LICENSE_URL' , 'http://www.gnu.org/licenses/agpl-3.0-standalone.html'); diff --git a/airtime_mvc/application/configs/navigation.php b/airtime_mvc/application/configs/navigation.php index f3149f146..21a603900 100644 --- a/airtime_mvc/application/configs/navigation.php +++ b/airtime_mvc/application/configs/navigation.php @@ -123,7 +123,7 @@ $pages = array( ), array( 'label' => _('User Manual'), - 'uri' => "http://www.sourcefabric.org/en/airtime/manuals/", + 'uri' => "http://sourcefabric.booktype.pro/airtime-25-for-broadcasters/", 'target' => "_blank" ), array( diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 808a14ade..2e3be6644 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -5,8 +5,17 @@ class ApiController extends Zend_Controller_Action public function init() { - $ignoreAuth = array("live-info", "live-info-v2", "week-info", - "station-metadata", "station-logo"); + $ignoreAuth = array("live-info", + "live-info-v2", + "week-info", + "station-metadata", + "station-logo", + "show-history-feed", + "item-history-feed", + "shows", + "show-tracks", + "show-schedules" + ); $params = $this->getRequest()->getParams(); if (!in_array($params['action'], $ignoreAuth)) { @@ -274,10 +283,10 @@ class ApiController extends Zend_Controller_Action $utcTimeEnd = $end->format("Y-m-d H:i:s"); $result = array( - "env" => APPLICATION_ENV, - "schedulerTime" => $utcTimeNow, - "currentShow" => Application_Model_Show::getCurrentShow($utcTimeNow), - "nextShow" => Application_Model_Show::getNextShows($utcTimeNow, $limit, $utcTimeEnd) + "env" => APPLICATION_ENV, + "schedulerTime" => $utcTimeNow, + "currentShow" => Application_Model_Show::getCurrentShow($utcTimeNow), + "nextShow" => Application_Model_Show::getNextShows($utcTimeNow, $limit, $utcTimeEnd) ); } else { $result = Application_Model_Schedule::GetPlayOrderRangeOld($limit); @@ -484,9 +493,9 @@ class ApiController extends Zend_Controller_Action $shows, array("starts", "ends", "start_timestamp","end_timestamp"), $timezone - ); + ); - $result[$dow[$i]] = $shows; + $result[$dow[$i]] = $shows; } // XSS exploit prevention @@ -1322,4 +1331,175 @@ class ApiController extends Zend_Controller_Action Application_Model_StreamSetting::SetListenerStatError($k, $v); } } + + /** + * display played items for a given time range and show instance_id + * + * @return json array + */ + public function itemHistoryFeedAction() + { + try { + $request = $this->getRequest(); + $params = $request->getParams(); + $instance = $request->getParam("instance_id", null); + + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); + + $historyService = new Application_Service_HistoryService(); + $results = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance); + + $this->_helper->json->sendJson($results['history']); + } + catch (Exception $e) { + Logging::info($e); + Logging::info($e->getMessage()); + } + } + + /** + * display show schedules for a given time range and show instance_id + * + * @return json array + */ + public function showHistoryFeedAction() + { + try { + $request = $this->getRequest(); + $params = $request->getParams(); + $userId = $request->getParam("user_id", null); + + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); + + $historyService = new Application_Service_HistoryService(); + $shows = $historyService->getShowList($startsDT, $endsDT, $userId); + + $this->_helper->json->sendJson($shows); + } + catch (Exception $e) { + Logging::info($e); + Logging::info($e->getMessage()); + } + } + + /** + * display show info (without schedule) for given show_id + * + * @return json array + */ + public function showsAction() + { + try { + $request = $this->getRequest(); + $params = $request->getParams(); + $showId = $request->getParam("show_id", null); + $results = array(); + + if (empty($showId)) { + $shows = CcShowQuery::create()->find(); + foreach($shows as $show) { + $results[] = $show->getShowInfo(); + } + } else { + $show = CcShowQuery::create()->findPK($showId); + $results[] = $show->getShowInfo(); + } + + $this->_helper->json->sendJson($results); + } + catch (Exception $e) { + Logging::info($e); + Logging::info($e->getMessage()); + } + } + + /** + * display show schedule for given show_id + * + * @return json array + */ + public function showSchedulesAction() + { + try { + $request = $this->getRequest(); + $params = $request->getParams(); + $showId = $request->getParam("show_id", null); + + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); + + if ((!isset($showId)) || (!is_numeric($showId))) { + //if (!isset($showId)) { + $this->_helper->json->sendJson( + array("jsonrpc" => "2.0", "error" => array("code" => 400, "message" => "missing invalid type for required show_id parameter. use type int.".$showId)) + ); + } + + $shows = Application_Model_Show::getShows($startsDT, $endsDT, FALSE, $showId); + + // is this a valid show? + if (empty($shows)) { + $this->_helper->json->sendJson( + array("jsonrpc" => "2.0", "error" => array("code" => 204, "message" => "no content for requested show_id")) + ); + } + + $this->_helper->json->sendJson($shows); + } + catch (Exception $e) { + Logging::info($e); + Logging::info($e->getMessage()); + } + + } + + /** + * displays track listing for given instance_id + * + * @return json array + */ + public function showTracksAction() + { + $baseUrl = Application_Common_OsPath::getBaseDir(); + $prefTimezone = Application_Model_Preference::GetTimezone(); + + $instanceId = $this->_getParam('instance_id'); + + if ((!isset($instanceId)) || (!is_numeric($instanceId))) { + $this->_helper->json->sendJson( + array("jsonrpc" => "2.0", "error" => array("code" => 400, "message" => "missing invalid type for required instance_id parameter. use type int")) + ); + } + + $showInstance = new Application_Model_ShowInstance($instanceId); + $showInstanceContent = $showInstance->getShowListContent($prefTimezone); + + // is this a valid show instance with content? + if (empty($showInstanceContent)) { + $this->_helper->json->sendJson( + array("jsonrpc" => "2.0", "error" => array("code" => 204, "message" => "no content for requested instance_id")) + ); + } + + $result = array(); + $position = 0; + foreach ($showInstanceContent as $track) { + + $elementMap = array( + 'title' => isset($track['track_title']) ? $track['track_title'] : "", + 'artist' => isset($track['creator']) ? $track['creator'] : "", + 'position' => $position, + 'id' => ++$position, + 'mime' => isset($track['mime'])?$track['mime']:"", + 'starts' => isset($track['starts']) ? $track['starts'] : "", + 'length' => isset($track['length']) ? $track['length'] : "", + 'file_id' => ($track['type'] == 0) ? $track['item_id'] : $track['filepath'] + ); + + $result[] = $elementMap; + } + + $this->_helper->json($result); + + } + } diff --git a/airtime_mvc/application/controllers/ListenerstatController.php b/airtime_mvc/application/controllers/ListenerstatController.php index 5f5250b9c..6e2b93aee 100644 --- a/airtime_mvc/application/controllers/ListenerstatController.php +++ b/airtime_mvc/application/controllers/ListenerstatController.php @@ -10,49 +10,6 @@ class ListenerstatController extends Zend_Controller_Action ->initContext(); } - private function getStartEnd() - { - $request = $this->getRequest(); - - $userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); - $utcTimezone = new DateTimeZone("UTC"); - $utcNow = new DateTime("now", $utcTimezone); - - $start = $request->getParam("start"); - $end = $request->getParam("end"); - - if (empty($start) || empty($end)) { - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - else { - - try { - $startsDT = new DateTime($start, $userTimezone); - $startsDT->setTimezone($utcTimezone); - - $endsDT = new DateTime($end, $userTimezone); - $endsDT->setTimezone($utcTimezone); - - if ($startsDT > $endsDT) { - throw new Exception("start greater than end"); - } - } - catch (Exception $e) { - Logging::info($e); - Logging::info($e->getMessage()); - - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - - } - - return array($startsDT, $endsDT); - } - public function indexAction() { $CC_CONFIG = Config::getConfig(); @@ -69,7 +26,7 @@ class ListenerstatController extends Zend_Controller_Action $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); $startsDT->setTimezone($userTimezone); $endsDT->setTimezone($userTimezone); @@ -98,7 +55,7 @@ class ListenerstatController extends Zend_Controller_Action } public function getDataAction(){ - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest()); $data = Application_Model_ListenerStat::getDataPointsWithinRange($startsDT->format("Y-m-d H:i:s"), $endsDT->format("Y-m-d H:i:s")); $this->_helper->json->sendJson($data); diff --git a/airtime_mvc/application/controllers/PlayouthistoryController.php b/airtime_mvc/application/controllers/PlayouthistoryController.php index 077cce0b2..7b82f7dfd 100644 --- a/airtime_mvc/application/controllers/PlayouthistoryController.php +++ b/airtime_mvc/application/controllers/PlayouthistoryController.php @@ -19,56 +19,13 @@ class PlayouthistoryController extends Zend_Controller_Action ->initContext(); } - private function getStartEnd() - { - $request = $this->getRequest(); - - $userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); - $utcTimezone = new DateTimeZone("UTC"); - $utcNow = new DateTime("now", $utcTimezone); - - $start = $request->getParam("start"); - $end = $request->getParam("end"); - - if (empty($start) || empty($end)) { - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - else { - - try { - $startsDT = new DateTime($start, $userTimezone); - $startsDT->setTimezone($utcTimezone); - - $endsDT = new DateTime($end, $userTimezone); - $endsDT->setTimezone($utcTimezone); - - if ($startsDT > $endsDT) { - throw new Exception("start greater than end"); - } - } - catch (Exception $e) { - Logging::info($e); - Logging::info($e->getMessage()); - - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - - } - - return array($startsDT, $endsDT); - } - public function indexAction() { $CC_CONFIG = Config::getConfig(); $baseUrl = Application_Common_OsPath::getBaseDir(); - list($startsDT, $endsDT) = $this->getStartEnd(); - + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest()); + $userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); $startsDT->setTimezone($userTimezone); $endsDT->setTimezone($userTimezone); @@ -123,7 +80,7 @@ class PlayouthistoryController extends Zend_Controller_Action $params = $request->getParams(); $instance = $request->getParam("instance_id", null); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $historyService = new Application_Service_HistoryService(); $r = $historyService->getFileSummaryData($startsDT, $endsDT, $params); @@ -146,7 +103,7 @@ class PlayouthistoryController extends Zend_Controller_Action $params = $request->getParams(); $instance = $request->getParam("instance_id", null); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $historyService = new Application_Service_HistoryService(); $r = $historyService->getPlayedItemData($startsDT, $endsDT, $params, $instance); @@ -169,7 +126,7 @@ class PlayouthistoryController extends Zend_Controller_Action $params = $request->getParams(); $instance = $request->getParam("instance_id", null); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $historyService = new Application_Service_HistoryService(); $shows = $historyService->getShowList($startsDT, $endsDT); diff --git a/airtime_mvc/application/controllers/ShowbuilderController.php b/airtime_mvc/application/controllers/ShowbuilderController.php index 7df1bb7ad..9abbeb167 100644 --- a/airtime_mvc/application/controllers/ShowbuilderController.php +++ b/airtime_mvc/application/controllers/ShowbuilderController.php @@ -236,49 +236,6 @@ class ShowbuilderController extends Zend_Controller_Action $this->view->dialog = $this->view->render('showbuilder/builderDialog.phtml'); } - private function getStartEnd() - { - $request = $this->getRequest(); - - $userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); - $utcTimezone = new DateTimeZone("UTC"); - $utcNow = new DateTime("now", $utcTimezone); - - $start = $request->getParam("start"); - $end = $request->getParam("end"); - - if (empty($start) || empty($end)) { - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - else { - - try { - $startsDT = new DateTime($start, $userTimezone); - $startsDT->setTimezone($utcTimezone); - - $endsDT = new DateTime($end, $userTimezone); - $endsDT->setTimezone($utcTimezone); - - if ($startsDT > $endsDT) { - throw new Exception("start greater than end"); - } - } - catch (Exception $e) { - Logging::info($e); - Logging::info($e->getMessage()); - - $startsDT = clone $utcNow; - $startsDT->sub(new DateInterval("P1D")); - $endsDT = clone $utcNow; - } - - } - - return array($startsDT, $endsDT); - } - public function checkBuilderFeedAction() { $request = $this->getRequest(); @@ -287,7 +244,7 @@ class ShowbuilderController extends Zend_Controller_Action $timestamp = intval($request->getParam("timestamp", -1)); $instances = $request->getParam("instances", array()); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $opts = array("myShows" => $my_shows, "showFilter" => $show_filter); $showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts); @@ -307,7 +264,7 @@ class ShowbuilderController extends Zend_Controller_Action $show_instance_filter = intval($request->getParam("showInstanceFilter", 0)); $my_shows = intval($request->getParam("myShows", 0)); - list($startsDT, $endsDT) = $this->getStartEnd(); + list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($request); $opts = array("myShows" => $my_shows, "showFilter" => $show_filter, diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index 9644535b9..02fd5271b 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -209,8 +209,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $interval = 'P21D'; } elseif ($formData["add_show_repeat_type"] == 5) { $interval = 'P28D'; - } elseif ($formData["add_show_repeat_type"] == 2) { + } elseif ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 2) { $interval = 'P1M'; + } elseif ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) { + list($weekNumberOfMonth, $dayOfWeek) = + Application_Service_ShowService::getMonthlyWeeklyRepeatInterval( + new DateTime($start_time, $showTimezone)); } /* Check first show @@ -287,12 +291,26 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $this->getElement('add_show_duration')->setErrors(array(_('Cannot schedule overlapping shows'))); break 1; } else { - $repeatShowStart->setTimezone($showTimezone); - $repeatShowEnd->setTimezone($showTimezone); - $repeatShowStart->add(new DateInterval($interval)); - $repeatShowEnd->add(new DateInterval($interval)); - $repeatShowStart->setTimezone($utc); - $repeatShowEnd->setTimezone($utc); + if ($formData["add_show_repeat_type"] == 2 && $formData["add_show_monthly_repeat_type"] == 3) { + $monthlyWeeklyStart = new DateTime($repeatShowStart->format("Y-m"), + new DateTimeZone("UTC")); + $monthlyWeeklyStart->add(new DateInterval("P1M")); + $repeatShowStart = clone Application_Service_ShowService::getNextMonthlyWeeklyRepeatDate( + $monthlyWeeklyStart, + $formData["add_show_timezone"], + $formData['add_show_start_time'], + $weekNumberOfMonth, + $dayOfWeek); + $repeatShowEnd = clone $repeatShowStart; + $repeatShowEnd->add(new DateInterval("PT".$hours."H".$minutes."M")); + } else { + $repeatShowStart->setTimezone($showTimezone); + $repeatShowEnd->setTimezone($showTimezone); + $repeatShowStart->add(new DateInterval($interval)); + $repeatShowEnd->add(new DateInterval($interval)); + $repeatShowStart->setTimezone($utc); + $repeatShowEnd->setTimezone($utc); + } } } } diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 34b60e704..d956b8d1e 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -5,6 +5,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm public function init() { + $maxLens = Application_Model_Show::getMaxLengths(); $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); $rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9); @@ -14,90 +15,90 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $defaultFadeIn = Application_Model_Preference::GetDefaultFadeIn(); $defaultFadeOut = Application_Model_Preference::GetDefaultFadeOut(); - + //Station name $this->addElement('text', 'stationName', array( - 'class' => 'input_text', - 'label' => _('Station Name'), - 'required' => false, - 'filters' => array('StringTrim'), + 'class' => 'input_text', + 'label' => _('Station Name'), + 'required' => false, + 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetStationName(), - 'decorators' => array( - 'ViewHelper' - ) )); - - //Default station fade in + + // Station description + $stationDescription = new Zend_Form_Element_Textarea("stationDescription"); + $stationDescription->setLabel(_('Station Description')); + $stationDescription->setValue(Application_Model_Preference::GetStationDescription()); + $stationDescription->setRequired(false); + $stationDescription->setValidators(array(array('StringLength', false, array(0, $maxLens['description'])))); + $stationDescription->setAttrib('rows', 4); + $this->addElement($stationDescription); + + //Default station crossfade duration $this->addElement('text', 'stationDefaultCrossfadeDuration', array( - 'class' => 'input_text', - 'label' => _('Default Crossfade Duration (s):'), - 'required' => true, - 'filters' => array('StringTrim'), - 'validators' => array( - array( - $rangeValidator, - $notEmptyValidator, - 'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')) - ) - ), - 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(), - 'decorators' => array( - 'ViewHelper' - ) + 'class' => 'input_text', + 'label' => _('Default Crossfade Duration (s):'), + 'required' => true, + 'filters' => array('StringTrim'), + 'validators' => array( + $rangeValidator, + $notEmptyValidator, + array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)'))) + ), + 'value' => Application_Model_Preference::GetDefaultCrossfadeDuration(), )); //Default station fade in $this->addElement('text', 'stationDefaultFadeIn', array( - 'class' => 'input_text', - 'label' => _('Default Fade In (s):'), - 'required' => true, - 'filters' => array('StringTrim'), + 'class' => 'input_text', + 'label' => _('Default Fade In (s):'), + 'required' => true, + 'filters' => array('StringTrim'), 'validators' => array( - array( - $rangeValidator, - $notEmptyValidator, - 'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')) - ) + $rangeValidator, + $notEmptyValidator, + array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)'))) ), 'value' => $defaultFadeIn, - 'decorators' => array( - 'ViewHelper' - ) )); - + //Default station fade out $this->addElement('text', 'stationDefaultFadeOut', array( - 'class' => 'input_text', - 'label' => _('Default Fade Out (s):'), - 'required' => true, - 'filters' => array('StringTrim'), - 'validators' => array( - array( - $rangeValidator, - $notEmptyValidator, - 'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')) - ) - ), - 'value' => $defaultFadeOut, - 'decorators' => array( - 'ViewHelper' - ) + 'class' => 'input_text', + 'label' => _('Default Fade Out (s):'), + 'required' => true, + 'filters' => array('StringTrim'), + 'validators' => array( + $rangeValidator, + $notEmptyValidator, + array('regex', false, array('/^[0-9]+(\.\d+)?$/', 'messages' => _('Please enter a time in seconds (eg. 0.5)'))) + ), + 'value' => $defaultFadeOut, )); $third_party_api = new Zend_Form_Element_Radio('thirdPartyApi'); - $third_party_api->setLabel( - sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '')); - $third_party_api->setMultiOptions(array(_("Disabled"), - _("Enabled"))); + $third_party_api->setLabel(_('Public Airtime API')); + $third_party_api->setDescription(_('Required for embeddable schedule widget.')); + $third_party_api->setMultiOptions(array( + _("Disabled"), + _("Enabled"), + )); $third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi()); - $third_party_api->setDecorators(array('ViewHelper')); + $third_party_api->setDescription(_('Enabling this feature will allow Airtime to provide schedule data + to external widgets that can be embedded in your website. Enable this + feature to reveal the embeddable code.')); + $third_party_api->setSeparator(' '); //No between radio buttons + //$third_party_api->addDecorator(new Zend_Form_Decorator_Label(array('tag' => 'dd', 'class' => 'radio-inline-list'))); + $third_party_api->addDecorator('HtmlTag', array('tag' => 'dd', + 'id'=>"thirdPartyApi-element", + 'class' => 'radio-inline-list', + )); $this->addElement($third_party_api); $locale = new Zend_Form_Element_Select("locale"); - $locale->setLabel(_("Default Interface Language")); + $locale->setLabel(_("Default Language")); $locale->setMultiOptions(Application_Model_Locale::getLocales()); $locale->setValue(Application_Model_Preference::GetDefaultLocale()); - $locale->setDecorators(array('ViewHelper')); $this->addElement($locale); /* Form Element for setting the Timezone */ @@ -105,7 +106,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $timezone->setLabel(_("Station Timezone")); $timezone->setMultiOptions(Application_Common_Timezone::getTimezones()); $timezone->setValue(Application_Model_Preference::GetDefaultTimezone()); - $timezone->setDecorators(array('ViewHelper')); $this->addElement($timezone); /* Form Element for setting which day is the start of the week */ @@ -113,7 +113,6 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $week_start_day->setLabel(_("Week Starts On")); $week_start_day->setMultiOptions($this->getWeekStartDays()); $week_start_day->setValue(Application_Model_Preference::GetWeekStartDay()); - $week_start_day->setDecorators(array('ViewHelper')); $this->addElement($week_start_day); } diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index 3058080c0..35b6909a9 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -10,9 +10,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true"; $defaultFade = Application_Model_Preference::GetDefaultTransitionFade(); - if ($defaultFade == "") { - $defaultFade = '00.000000'; - } // automatic trasition on source disconnection $auto_transition = new Zend_Form_Element_Checkbox("auto_transition"); @@ -32,8 +29,8 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade->setLabel(_("Switch Transition Fade (s)")) ->setFilters(array('StringTrim')) - ->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,6})?$/', - 'messages' => _('enter a time in seconds 00{.000000}'))) + ->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,3})?$/', + 'messages' => _('enter a time in seconds 0{.000}'))) ->setValue($defaultFade) ->setDecorators(array('ViewHelper')); $this->addElement($transition_fade); diff --git a/airtime_mvc/application/forms/SmartBlockCriteria.php b/airtime_mvc/application/forms/SmartBlockCriteria.php index 990d5bde9..5423ab657 100644 --- a/airtime_mvc/application/forms/SmartBlockCriteria.php +++ b/airtime_mvc/application/forms/SmartBlockCriteria.php @@ -4,6 +4,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm private $criteriaOptions; private $stringCriteriaOptions; private $numericCriteriaOptions; + private $sortOptions; private $limitOptions; /* We need to know if the criteria value will be a string @@ -122,6 +123,17 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm } return $this->limitOptions; } + private function getSortOptions() + { + if (!isset($this->sortOptions)) { + $this->sortOptions = array( + "random" => _("random"), + "newest" => _("newest"), + "oldest" => _("oldest") + ); + } + return $this->sortOptions; + } public function init() @@ -288,6 +300,15 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm } $this->addElement($repeatTracks); + $sort = new Zend_Form_Element_Select('sp_sort_options'); + $sort->setAttrib('class', 'sp_input_select') + ->setDecorators(array('viewHelper')) + ->setMultiOptions($this->getSortOptions()); + if (isset($storedCrit["sort"])) { + $sort->setValue($storedCrit["sort"]["value"]); + } + $this->addElement($sort); + $limit = new Zend_Form_Element_Select('sp_limit_options'); $limit->setAttrib('class', 'sp_input_select') ->setDecorators(array('viewHelper')) @@ -344,7 +365,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm public function preValidation($params) { - $data = Application_Model_Block::organizeSmartPlyalistCriteria($params['data']); + $data = Application_Model_Block::organizeSmartPlaylistCriteria($params['data']); // add elelments that needs to be added // set multioption for modifier according to criteria_field $modRowMap = array(); diff --git a/airtime_mvc/application/forms/helpers/CustomDecorators.php b/airtime_mvc/application/forms/helpers/CustomDecorators.php new file mode 100644 index 000000000..a4abe2daf --- /dev/null +++ b/airtime_mvc/application/forms/helpers/CustomDecorators.php @@ -0,0 +1,2 @@ +" . $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/Block.php b/airtime_mvc/application/models/Block.php index babef06a5..4cb183569 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -1156,7 +1156,7 @@ SQL; */ public function saveSmartBlockCriteria($p_criteria) { - $data = $this->organizeSmartPlyalistCriteria($p_criteria); + $data = $this->organizeSmartPlaylistCriteria($p_criteria); // saving dynamic/static flag $blockType = $data['etc']['sp_type'] == 0 ? 'static':'dynamic'; $this->saveType($blockType); @@ -1224,6 +1224,16 @@ SQL; } } + // insert sort info + $qry = new CcBlockcriteria(); + $qry->setDbCriteria("sort") + ->setDbModifier("N/A") + ->setDbValue($p_criteriaData['etc']['sp_sort_options']) + ->setDbBlockId($this->id) + ->save(); + + + // insert limit info $qry = new CcBlockcriteria(); $qry->setDbCriteria("limit") @@ -1231,7 +1241,8 @@ SQL; ->setDbValue($p_criteriaData['etc']['sp_limit_value']) ->setDbBlockId($this->id) ->save(); - + + // insert repeate track option $qry = new CcBlockcriteria(); $qry->setDbCriteria("repeat_tracks") @@ -1352,6 +1363,7 @@ SQL; "isrc_number" => _("ISRC"), "label" => _("Label"), "language" => _("Language"), + "utime" => _("Upload Time"), "mtime" => _("Last Modified"), "lptime" => _("Last Played"), "length" => _("Length"), @@ -1399,6 +1411,8 @@ SQL; "display_modifier"=>_($modifier)); } else if($criteria == "repeat_tracks") { $storedCrit["repeat_tracks"] = array("value"=>$value); + } else if($criteria == "sort") { + $storedCrit["sort"] = array("value"=>$value); } else { $storedCrit["crit"][$criteria][] = array( "criteria"=>$criteria, @@ -1507,8 +1521,20 @@ SQL; // check if file exists $qry->add("file_exists", "true", Criteria::EQUAL); $qry->add("hidden", "false", Criteria::EQUAL); + if (isset($storedCrit['sort'])) { + $sortTracks = $storedCrit['sort']['value']; + } + if ($sortTracks == 'newest') { + $qry->addDescendingOrderByColumn('utime'); + } + else if ($sortTracks == 'oldest') { + $qry->addAscendingOrderByColumn('utime'); + } + else { $qry->addAscendingOrderByColumn('random()'); } + + } // construct limit restriction $limits = array(); @@ -1537,9 +1563,8 @@ SQL; Logging::info($e); } } - - public static function organizeSmartPlyalistCriteria($p_criteria) - { + public static function organizeSmartPlaylistCriteria($p_criteria) + { $fieldNames = array('sp_criteria_field', 'sp_criteria_modifier', 'sp_criteria_value', 'sp_criteria_extra'); $output = array(); foreach ($p_criteria as $ele) { diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 747e9d49f..f4a9ed9de 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -263,7 +263,7 @@ class Application_Model_Preference if ($fade === "") { // the default value of the fade is 00.5 - return "00.5"; + return "0.5"; } return $fade; @@ -279,8 +279,8 @@ class Application_Model_Preference $fade = self::getValue("default_fade_out"); if ($fade === "") { - // the default value of the fade is 00.5 - return "00.5"; + // the default value of the fade is 0.5 + return "0.5"; } return $fade; @@ -291,33 +291,6 @@ class Application_Model_Preference self::setValue("default_fade", $fade); } - public static function GetDefaultFade() - { - $fade = self::getValue("default_fade"); - - if ($fade === "") { - // the default value of the fade is 00.5 - return "00.5"; - } - - // we need this function to work with 2.0 version on default_fade value in cc_pref - // it has 00:00:00.000000 format where in 2.1 we have 00.000000 format - if (preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{6})/", $fade, $matches) == 1 && count($matches) == 5) { - $out = 0; - $out += intval($matches[1] * 3600); - $out += intval($matches[2] * 60); - $out += intval($matches[3]); - $out .= ".$matches[4]"; - $fade = $out; - } - - $fade = number_format($fade, 1, '.', ''); - //fades need 2 leading zeros for DateTime conversion - $fade = str_pad($fade, 4, "0", STR_PAD_LEFT); - - return $fade; - } - public static function SetDefaultTransitionFade($fade) { self::setValue("default_transition_fade", $fade); @@ -330,7 +303,7 @@ class Application_Model_Preference public static function GetDefaultTransitionFade() { $transition_fade = self::getValue("default_transition_fade"); - return ($transition_fade == "") ? "00.000000" : $transition_fade; + return ($transition_fade == "") ? "0.000" : $transition_fade; } public static function SetStreamLabelFormat($type) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 987b5a6c2..a08e563d1 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -862,9 +862,11 @@ SQL; * In UTC time. * @param unknown_type $excludeInstance * @param boolean $onlyRecord + * @param int $showId + * limits the results to instances of a given showId only * @return array */ - public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE) + public static function getShows($start_timestamp, $end_timestamp, $onlyRecord=FALSE, $showId=null) { self::createAndFillShowInstancesPastPopulatedUntilDate($end_timestamp); @@ -895,13 +897,21 @@ SQL; //only want shows that are starting at the time or later. $start_string = $start_timestamp->format("Y-m-d H:i:s"); $end_string = $end_timestamp->format("Y-m-d H:i:s"); + + $params = array(); + + if ($showId) { + $sql .= " AND (si1.show_id = :show_id)"; + $params[':show_id'] = $showId; + } + if ($onlyRecord) { $sql .= " AND (si1.starts >= :start::TIMESTAMP AND si1.starts < :end::TIMESTAMP)"; $sql .= " AND (si1.record = 1)"; - return Application_Common_Database::prepareAndExecute( $sql, - array( ':start' => $start_string, - ':end' => $end_string ), 'all'); + $params[':start'] = $start_string; + $params[':end'] = $end_string; + return Application_Common_Database::prepareAndExecute( $sql, $params, 'all'); } else { $sql .= " ". <<= :start1::TIMESTAMP AND si1.starts < :end1::TIMESTAMP) OR (si1.starts <= :start3::TIMESTAMP AND si1.ends >= :end3::TIMESTAMP)) ORDER BY si1.starts SQL; - return Application_Common_Database::prepareAndExecute( $sql, - array( + $params = array_merge($params, array( 'start1' => $start_string, 'start2' => $start_string, 'start3' => $start_string, 'end1' => $end_string, 'end2' => $end_string, 'end3' => $end_string - ), 'all'); + ) + ); + return Application_Common_Database::prepareAndExecute( $sql, $params, 'all'); } } @@ -1013,10 +1024,10 @@ SQL; //for putting the now playing icon on the show. if ($now > $startsDT && $now < $endsDT) { - $event["nowPlaying"] = true; + $event["nowPlaying"] = true; } else { - $event["nowPlaying"] = false; + $event["nowPlaying"] = false; } //event colouring @@ -1045,9 +1056,9 @@ SQL; **/ private static function getPercentScheduled($p_starts, $p_ends, $p_time_filled) { - $utcTimezone = new DatetimeZone("UTC"); - $startDt = new DateTime($p_starts, $utcTimezone); - $endDt = new DateTime($p_ends, $utcTimezone); + $utcTimezone = new DatetimeZone("UTC"); + $startDt = new DateTime($p_starts, $utcTimezone); + $endDt = new DateTime($p_ends, $utcTimezone); $durationSeconds = intval($endDt->format("U")) - intval($startDt->format("U")); $time_filled = Application_Common_DateHelper::playlistTimeToSeconds($p_time_filled); if ($durationSeconds != 0) { //Prevent division by zero if the show duration somehow becomes zero. @@ -1305,16 +1316,16 @@ SQL; $results['nextShow'][0] = array( "id" => $rows[$i]['id'], "instance_id" => $rows[$i]['instance_id'], - "name" => $rows[$i]['name'], + "name" => $rows[$i]['name'], "description" => $rows[$i]['description'], - "url" => $rows[$i]['url'], + "url" => $rows[$i]['url'], "start_timestamp" => $rows[$i]['start_timestamp'], "end_timestamp" => $rows[$i]['end_timestamp'], "starts" => $rows[$i]['starts'], "ends" => $rows[$i]['ends'], "record" => $rows[$i]['record'], "image_path" => $rows[$i]['image_path'], - "type" => "show"); + "type" => "show"); break; } } @@ -1448,4 +1459,5 @@ SQL; return array($start, $end); } + } diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index f5fbf1aa7..7631f9e9c 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -548,7 +548,7 @@ SQL; } - public function getShowListContent() + public function getShowListContent($timezone = null) { $con = Propel::getConnection(); @@ -599,9 +599,14 @@ SQL; ':instance_id2' => $this->_instanceId )); $results = $stmt->fetchAll(PDO::FETCH_ASSOC); - - $userTimezone = Application_Model_Preference::GetUserTimezone(); - $displayTimezone = new DateTimeZone($userTimezone); + + if (isset($timezone)) { + $displayTimezone = new DateTimeZone($timezone); + } else { + $userTimezone = Application_Model_Preference::GetUserTimezone(); + $displayTimezone = new DateTimeZone($userTimezone); + } + $utcTimezone = new DateTimeZone("UTC"); foreach ($results as &$row) { diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 21c794b07..007e78938 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -88,11 +88,19 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable public static function deleteStreams($p_ids, $p_userId) { - $leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId); - if (count($leftOver) == 0) { - CcWebstreamQuery::create()->findPKs($p_ids)->delete(); + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + + if (!$isAdminOrPM) { + $leftOver = self::streamsNotOwnedByUser($p_ids, $p_userId); + if (count($leftOver) == 0) { + CcWebstreamQuery::create()->findPKs($p_ids)->delete(); + } else { + throw new WebstreamNoPermissionException; + } } else { - throw new WebstreamNoPermissionException; + CcWebstreamQuery::create()->findPKs($p_ids)->delete(); } } @@ -309,7 +317,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable $media_url = self::getXspfUrl($url); } elseif (preg_match("/pls\+xml/", $mime) || preg_match("/x-scpls/", $mime)) { $media_url = self::getPlsUrl($url); - } elseif (preg_match("/(mpeg|ogg|audio\/aacp)/", $mime)) { + } elseif (preg_match("/(mpeg|ogg|audio\/aacp|audio\/aac)/", $mime)) { if ($content_length_found) { throw new Exception(_("Invalid webstream - This appears to be a file download.")); } diff --git a/airtime_mvc/application/models/airtime/CcShow.php b/airtime_mvc/application/models/airtime/CcShow.php index b9f140e3e..ee0c75454 100644 --- a/airtime_mvc/application/models/airtime/CcShow.php +++ b/airtime_mvc/application/models/airtime/CcShow.php @@ -304,4 +304,23 @@ class CcShow extends BaseCcShow { ->filterByDbId($instanceId, Criteria::NOT_EQUAL) ->find(); } + + public function getShowInfo() + { + $info = array(); + if ($this->getDbId() == null) { + return $info; + } else { + $info['name'] = $this->getDbName(); + $info['id'] = $this->getDbId(); + $info['url'] = $this->getDbUrl(); + $info['genre'] = $this->getDbGenre(); + $info['description'] = $this->getDbDescription(); + $info['color'] = $this->getDbColor(); + $info['background_color'] = $this->getDbBackgroundColor(); + $info['linked'] = $this->getDbLinked(); + return $info; + } + + } } // CcShow diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index 73821ce92..181e55a67 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -204,30 +204,34 @@ class Application_Service_HistoryService //------------------------------------------------------------------------ //Using Datatables parameters to sort the data. - $numOrderColumns = $opts["iSortingCols"]; - $orderBys = array(); + if (empty($opts["iSortingCols"])) { + $orderBys = array(); + } else { + $numOrderColumns = $opts["iSortingCols"]; + $orderBys = array(); - for ($i = 0; $i < $numOrderColumns; $i++) { + for ($i = 0; $i < $numOrderColumns; $i++) { - $colNum = $opts["iSortCol_".$i]; - $key = $opts["mDataProp_".$colNum]; - $sortDir = $opts["sSortDir_".$i]; + $colNum = $opts["iSortCol_".$i]; + $key = $opts["mDataProp_".$colNum]; + $sortDir = $opts["sSortDir_".$i]; - if (in_array($key, $required)) { + if (in_array($key, $required)) { - $orderBys[] = "history_range.{$key} {$sortDir}"; - } - else if (in_array($key, $filemd_keys)) { + $orderBys[] = "history_range.{$key} {$sortDir}"; + } + else if (in_array($key, $filemd_keys)) { - $orderBys[] = "file_info.{$key} {$sortDir}"; - } - else if (in_array($key, $general_keys)) { + $orderBys[] = "file_info.{$key} {$sortDir}"; + } + else if (in_array($key, $general_keys)) { - $orderBys[] = "{$key}_filter.{$key} {$sortDir}"; - } - else { - //throw new Exception("Error: $key is not part of the template."); - } + $orderBys[] = "{$key}_filter.{$key} {$sortDir}"; + } + else { + //throw new Exception("Error: $key is not part of the template."); + } + } } if (count($orderBys) > 0) { @@ -241,7 +245,7 @@ class Application_Service_HistoryService //--------------------------------------------------------------- //using Datatables parameters to add limits/offsets - $displayLength = intval($opts["iDisplayLength"]); + $displayLength = empty($opts["iDisplayLength"]) ? -1 : intval($opts["iDisplayLength"]); //limit the results returned. if ($displayLength !== -1) { $mainSqlQuery.= @@ -275,14 +279,14 @@ class Application_Service_HistoryService foreach ($fields as $index=>$field) { if ($field["type"] == TEMPLATE_BOOLEAN) { - $boolCast[] = $field["name"]; + $boolCast[] = $field; } } foreach ($rows as $index => &$result) { - foreach ($boolCast as $name) { - $result[$name] = (bool) $result[$name]; + foreach ($boolCast as $field) { + $result[$field['label']] = (bool) $result[$field['name']]; } //need to display the results in the station's timezone. @@ -311,7 +315,7 @@ class Application_Service_HistoryService } return array( - "sEcho" => intval($opts["sEcho"]), + "sEcho" => empty($opts["sEcho"]) ? null : intval($opts["sEcho"]), //"iTotalDisplayRecords" => intval($totalDisplayRows), "iTotalDisplayRecords" => intval($totalRows), "iTotalRecords" => intval($totalRows), @@ -445,9 +449,13 @@ class Application_Service_HistoryService ); } - public function getShowList($startDT, $endDT) + public function getShowList($startDT, $endDT, $userId = null) { - $user = Application_Model_User::getCurrentUser(); + if (empty($userId)) { + $user = Application_Model_User::getCurrentUser(); + } else { + $user = new Application_Model_User($userId); + } $shows = Application_Model_Show::getShows($startDT, $endDT); Logging::info($startDT->format("Y-m-d H:i:s")); @@ -456,7 +464,7 @@ class Application_Service_HistoryService Logging::info($shows); //need to filter the list to only their shows - if ($user->isHost()) { + if ((!empty($user)) && ($user->isHost())) { $showIds = array(); @@ -1524,4 +1532,4 @@ class Application_Service_HistoryService throw $e; } } -} \ No newline at end of file +} diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index 5a2f22e63..0ffff6c77 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -1109,7 +1109,7 @@ SQL; $start = $this->getNextRepeatingPopulateStartDateTime($showDay); if (is_null($repeatInterval)&& $repeatType == REPEAT_MONTHLY_WEEKLY) { - $repeatInterval = $this->getMonthlyWeeklyRepeatInterval($start, $timezone); + $repeatInterval = self::getMonthlyWeeklyRepeatInterval($start, $timezone); } //DatePeriod in user's local time @@ -1212,7 +1212,7 @@ SQL; // We will only need this if the repeat type is MONTHLY_WEEKLY list($weekNumberOfMonth, $dayOfWeek) = - $this->getMonthlyWeeklyRepeatInterval( + self::getMonthlyWeeklyRepeatInterval( new DateTime($first_show, new DateTimeZone($timezone))); $this->repeatType = $showDay->getDbRepeatType(); @@ -1272,7 +1272,7 @@ SQL; $monthlyWeeklyStart = new DateTime($utcStartDateTime->format("Y-m"), new DateTimeZone("UTC")); $monthlyWeeklyStart->add(new DateInterval("P1M")); - $start = $this->getNextMonthlyWeeklyRepeatDate( + $start = self::getNextMonthlyWeeklyRepeatDate( $monthlyWeeklyStart, $timezone, $showDay->getDbStartTime(), @@ -1294,7 +1294,7 @@ SQL; * @param string $showStart * @param string $timezone user's local timezone */ - private function getMonthlyWeeklyRepeatInterval($showStart) + public static function getMonthlyWeeklyRepeatInterval($showStart) { $start = clone $showStart; $dayOfMonth = $start->format("j"); @@ -1369,7 +1369,7 @@ SQL; * @param string (i.e. 'first', 'second') $weekNumberOfMonth * @param string (i.e. 'Monday') $dayOfWeek */ - private function getNextMonthlyWeeklyRepeatDate( + public static function getNextMonthlyWeeklyRepeatDate( $start, $timezone, $startTime, diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index a438fb446..de3f6b13d 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -1,138 +1,23 @@ - - element->getElement('stationName')->getLabel() ?>: - - - - element->getElement('stationName') ?> - element->getElement('stationName')->hasErrors()) : ?> - - element->getElement('stationName')->getMessages() as $error): ?> - - - - - - - element->getElement('stationDefaultFadeIn')->getLabel() ?> - - - element->getElement('stationDefaultFadeIn') ?> - element->getElement('stationDefaultFadeIn')->hasErrors()) : ?> - - element->getElement('stationDefaultFadeIn')->getMessages() as $error): ?> - - - - - - - element->getElement('stationDefaultFadeOut')->getLabel() ?> - - - element->getElement('stationDefaultFadeOut') ?> - element->getElement('stationDefaultFadeOut')->hasErrors()) : ?> - - element->getElement('stationDefaultFadeOut')->getMessages() as $error): ?> - - - - - - - element->getElement('stationDefaultCrossfadeDuration')->getLabel() ?> - - - element->getElement('stationDefaultCrossfadeDuration') ?> - element->getElement('stationDefaultCrossfadeDuration')->hasErrors()) : ?> - - element->getElement('stationDefaultCrossfadeDuration')->getMessages() as $error): ?> - - - - - - - element->getElement('thirdPartyApi')->getLabel() ?> - - - element->getElement('thirdPartyApi')->getValue(); - ?> - element->getElement('thirdPartyApi')->getMultiOptions() as $radio) : ?> - - > - - - - - - element->getElement('thirdPartyApi')->hasErrors()) : ?> - - element->getElement('thirdPartyApi')->getMessages() as $error): ?> - - - - - - - element->getElement('locale')->getLabel() ?>: - - - - element->getElement('locale') ?> - element->getElement('locale')->hasErrors()) : ?> - - element->getElement('locale')->getMessages() as $error): ?> - - - - - + element->getElement('stationName')->render() ?> - - element->getElement('timezone')->getLabel() ?>: - - - - - element->getElement('timezone') ?> - element->getElement('timezone')->hasErrors()) : ?> - - element->getElement('timezone')->getMessages() as $error): ?> - - - - - + element->getElement('stationDescription')->render() ?> - - - element->getElement('weekStartDay')->getLabel() ?>: - - - - element->getElement('weekStartDay')->getValue(); - ?> - - element->getElement('weekStartDay')->getMultiOptions() as $option) : ?> - > - - - - - + element->getElement('locale')->render() ?> + + element->getElement('timezone')->render() ?> + + element->getElement('weekStartDay')->render() ?> + + element->getElement('stationDefaultFadeIn')->render() ?> + + element->getElement('stationDefaultFadeOut')->render() ?> + + element->getElement('stationDefaultCrossfadeDuration')->render() ?> + + element->getElement('thirdPartyApi')->render() ?> - element->getElement('weekStartDay')->hasErrors()) : ?> - - element->getElement('weekStartDay')->getMessages() as $error): ?> - - - - - 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)?> diff --git a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml index b0ccc274a..9da7ca765 100644 --- a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml +++ b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml @@ -95,7 +95,18 @@ - + + Sort tracks by + element->getElement('sp_sort_options') ?> + element->getElement("sp_sort_options")->hasErrors()) : ?> + element->getElement("sp_sort_options")->getMessages() as $error): ?> + + + + + + + element->getElement('sp_limit_value')->getLabel() ?> element->getElement('sp_limit_value')?> diff --git a/airtime_mvc/application/views/scripts/form/support-setting.phtml b/airtime_mvc/application/views/scripts/form/support-setting.phtml index b23925d70..b1c0a3e37 100644 --- a/airtime_mvc/application/views/scripts/form/support-setting.phtml +++ b/airtime_mvc/application/views/scripts/form/support-setting.phtml @@ -2,10 +2,10 @@ - ")?> + " + ."Click the box below and we'll make sure the features you use are constantly improving."), + PRODUCT_NAME)?> element->getElement('SupportFeedback') ?> diff --git a/airtime_mvc/build/schema.xml b/airtime_mvc/build/schema.xml index 684497769..1d1c7f0d9 100644 --- a/airtime_mvc/build/schema.xml +++ b/airtime_mvc/build/schema.xml @@ -136,9 +136,13 @@ + + + diff --git a/airtime_mvc/build/sql/schema.sql b/airtime_mvc/build/sql/schema.sql index a7a4c0d66..a63318d1a 100644 --- a/airtime_mvc/build/sql/schema.sql +++ b/airtime_mvc/build/sql/schema.sql @@ -158,6 +158,7 @@ CREATE TABLE "cc_show" "live_stream_pass" VARCHAR(255), "linked" BOOLEAN default 'f' NOT NULL, "is_linkable" BOOLEAN default 't' NOT NULL, + "image_path" VARCHAR(255), PRIMARY KEY ("id") ); @@ -175,6 +176,7 @@ DROP TABLE "cc_show_instances" CASCADE; CREATE TABLE "cc_show_instances" ( "id" serial NOT NULL, + "description" VARCHAR(512), "starts" TIMESTAMP NOT NULL, "ends" TIMESTAMP NOT NULL, "show_id" INTEGER NOT NULL, diff --git a/airtime_mvc/locale/az/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/az/LC_MESSAGES/airtime.mo index 6785de678..b09021a2c 100644 Binary files a/airtime_mvc/locale/az/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/az/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/az/LC_MESSAGES/airtime.po b/airtime_mvc/locale/az/LC_MESSAGES/airtime.po index 2f983ee6b..0f71795bf 100644 --- a/airtime_mvc/locale/az/LC_MESSAGES/airtime.po +++ b/airtime_mvc/locale/az/LC_MESSAGES/airtime.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Airtime\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-11-13 13:55-0500\n" -"PO-Revision-Date: 2014-12-05 10:32+0000\n" +"PO-Revision-Date: 2015-01-15 11:11+0000\n" "Last-Translator: Daniel James \n" "Language-Team: Azerbaijani (http://www.transifex.com/projects/p/airtime/language/az/)\n" "MIME-Version: 1.0\n" diff --git a/airtime_mvc/locale/de_AT/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/de_AT/LC_MESSAGES/airtime.mo index 76942ed77..e07f4df00 100644 Binary files a/airtime_mvc/locale/de_AT/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/de_AT/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/en_GB/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/en_GB/LC_MESSAGES/airtime.mo index 4ca8d6170..9e6d68da7 100644 Binary files a/airtime_mvc/locale/en_GB/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/en_GB/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/fr_FR/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/fr_FR/LC_MESSAGES/airtime.mo index 6a2e72329..c07671388 100644 Binary files a/airtime_mvc/locale/fr_FR/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/fr_FR/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.mo index 761abbc13..aa2396685 100644 Binary files a/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.po b/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.po index 8c702f19e..0e397883a 100644 --- a/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.po +++ b/airtime_mvc/locale/hu_HU/LC_MESSAGES/airtime.po @@ -55,11 +55,10 @@ msgstr "Média Hozzáadása" msgid "Library" msgstr "Médiatár" -<<<<<<< HEAD #: airtime_mvc/application/configs/navigation.php:33 msgid "Calendar" msgstr "Naptár" -======= + #: airtime_mvc/application/services/HistoryService.php:1106 #: airtime_mvc/application/services/HistoryService.php:1146 #: airtime_mvc/application/services/HistoryService.php:1163 @@ -69,7 +68,6 @@ msgstr "Naptár" #: airtime_mvc/application/forms/SmartBlockCriteria.php:57 msgid "Creator" msgstr "Előadó/Szerző" ->>>>>>> 2.5.x #: airtime_mvc/application/configs/navigation.php:40 msgid "System" @@ -421,12 +419,11 @@ msgstr "Új Adásfolyam" msgid "Empty playlist content" msgstr "Üres lejátszási lista tartalom" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:21 #: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:21 msgid "Clear" msgstr "Törlés" -======= + #: airtime_mvc/application/views/scripts/form/support-setting.phtml:5 #, php-format msgid "" @@ -435,7 +432,6 @@ msgid "" "experience.%sClick the 'Send support feedback' box and we'll make sure the " "features you use are constantly improving." msgstr "Segítse az Airtime fejlesztését azáltal, hogy a Sourcefabric tudja, hogy Ön, hogyan használja azt. Információk összegyűjtése céljából, rendszerezve azokat, hogy fokozza a felhasználás élményét.%sKlikkeljen a 'Támogatási Visszajelzés Küldése' mezőbe és győződjön meg arról, hogy a funkciók használatának minősége folyamatosan javul." ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:24 msgid "Shuffle playlist" @@ -467,16 +463,14 @@ msgstr "Lejátszási lista mentése" msgid "Save" msgstr "Mentés" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:34 #: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:31 msgid "Playlist crossfade" msgstr "Lejátszási lista átúsztatása" -======= + #: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:109 msgid "Master Source Connection URL:" msgstr "Mester Forrási URL Kapcsolat:" ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:53 #: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:55 @@ -497,17 +491,15 @@ msgstr "Leírás" msgid "Fade in: " msgstr "Felúsztatás:" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:70 #: airtime_mvc/application/views/scripts/playlist/set-fade.phtml:6 #: airtime_mvc/application/views/scripts/playlist/smart-block.phtml:75 msgid "Fade out: " msgstr "Leúsztatás:" -======= + #: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:153 msgid "Show Source Connection URL:" msgstr "Műsor Forrási URL Kapcsolat:" ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/playlist/playlist.phtml:85 msgid "No open playlist" @@ -585,18 +577,7 @@ msgid "Here's how you can get started using Airtime to automate your broadcasts: msgstr "Itt van pár tipp, hogy hogyan is automatizálhatja adásait az Airtime segítségével:" #: airtime_mvc/application/views/scripts/dashboard/help.phtml:7 -<<<<<<< HEAD -msgid "Begin by adding your files to the library using the 'Add Media' menu button. You can drag and drop your files to this window too." -msgstr "Kezdje médiafájlok hozzáadásával a 'Média Hozzáadása' menü gombon. A hozd és vidd fájlokat ugyanebben az ablakban szerkesztheti." -#: airtime_mvc/application/views/scripts/dashboard/help.phtml:8 -msgid "Create a show by going to 'Calendar' in the menu bar, and then clicking the '+ Show' icon. This can be either a one-time or repeating show. Only admins and program managers can add shows." -msgstr "Hozzon létre egy műsort a 'Naptár' menüsorban, majd kattintson a '+ Műsor' ikonra. Ez lehet egyszeri vagy ismétlődő műsor. Csak az adminisztrátorok és a programok vezetői adhatnak hozzá műsort." - -#: airtime_mvc/application/views/scripts/dashboard/help.phtml:9 -msgid "Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting 'Add / Remove Content'" -msgstr "Adjon hozzá médiát, hogy a műsora futni tudjon, az Ütemezett naptárban, bal egérgombbal kattintva, és itt válassza ki a 'Tartalom Hozzáadása/Eltávolítása' opciót" -======= msgid "" "Begin by adding your files to the library using the 'Add Media' menu button." " You can drag and drop your files to this window too." @@ -614,7 +595,6 @@ msgid "" "Add media to the show by going to your show in the Schedule calendar, left-" "clicking on it and selecting 'Add / Remove Content'" msgstr "Adjon hozzá médiatartalmakat, hogy műsorokat tudjon ütemezni, a 'Naptár' menüpontban, bal egérgombbal kattintva, és itt válassza ki a 'Tartalom Hozzáadása/Eltávolítása' opciót" ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/dashboard/help.phtml:10 msgid "Select your media from the left pane and drag them to your show in the right pane." @@ -1114,15 +1094,13 @@ msgstr "Adásfolyam/Patak Beállítások" msgid "Global Settings" msgstr "Általános Beállítások" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:87 msgid "dB" msgstr "dB" -======= + #: airtime_mvc/application/views/scripts/playouthistorytemplate/template-contents.phtml:4 msgid "Creating Log Sheet Template" msgstr "Naplózási Sablon Létrehozása" ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/preference/stream-setting.phtml:106 msgid "Output Stream Settings" @@ -1200,18 +1178,16 @@ msgstr "Új Mező Hozzáadása" msgid "Set Default Template" msgstr "Alapértelmezett Sablon" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/login/password-change.phtml:3 msgid "New password" msgstr "Új jelszó" -======= + #: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:10 #: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:34 #: airtime_mvc/application/views/scripts/library/get-file-metadata.ajax.phtml:148 #: airtime_mvc/application/forms/EditAudioMD.php:26 msgid "Creator:" msgstr "Előadó/Szerző:" ->>>>>>> 2.5.x #: airtime_mvc/application/views/scripts/login/password-change.phtml:6 msgid "Please enter and confirm your new password in the fields below." @@ -1329,7 +1305,6 @@ msgstr "id" msgid "Username" msgstr "Felhasználónév" -<<<<<<< HEAD #: airtime_mvc/application/views/scripts/user/add-user.phtml:19 msgid "First Name" msgstr "Vezetéknév" @@ -1341,7 +1316,7 @@ msgstr "Keresztnév" #: airtime_mvc/application/views/scripts/user/add-user.phtml:21 msgid "User Type" msgstr "Felhasználói Típus" -======= + #: airtime_mvc/application/views/scripts/playouthistory/index.phtml:7 msgid "Log Sheet" msgstr "Napló" @@ -1353,7 +1328,7 @@ msgstr "Fájl Összegző" #: airtime_mvc/application/views/scripts/playouthistory/index.phtml:10 msgid "Show Summary" msgstr "Műsor Összegző" ->>>>>>> 2.5.x + #: airtime_mvc/application/views/scripts/partialviews/header.phtml:3 msgid "Previous:" @@ -2865,7 +2840,6 @@ msgstr "Válasszon Tároló Mappát" msgid "Choose Folder to Watch" msgstr "Válasszon Vizsgált Mappát" -<<<<<<< HEAD #: airtime_mvc/application/controllers/LocaleController.php:155 msgid "" "Are you sure you want to change the storage folder?\n" @@ -2873,11 +2847,11 @@ msgid "" msgstr "" "Biztos benne, hogy meg akarja változtatni a tároló mappát?\n" "Ezzel eltávolítja a fájlokat az Airtime médiatárából!" -======= + #: airtime_mvc/application/controllers/LocaleController.php:389 msgid "Create Entry" msgstr "Napló Létrehozása" ->>>>>>> 2.5.x + #: airtime_mvc/application/controllers/LocaleController.php:157 msgid "Are you sure you want to remove the watched folder?" @@ -3111,35 +3085,30 @@ msgstr "Nov" msgid "Dec" msgstr "Dec" -<<<<<<< HEAD #: airtime_mvc/application/controllers/LocaleController.php:236 msgid "today" msgstr "ma" -======= + #: airtime_mvc/application/forms/LiveStreamingPreferences.php:87 msgid "Master Source Port" msgstr "Mester Forrás Port" ->>>>>>> 2.5.x #: airtime_mvc/application/controllers/LocaleController.php:237 msgid "day" msgstr "nap" -<<<<<<< HEAD #: airtime_mvc/application/controllers/LocaleController.php:238 msgid "week" msgstr "hét" -======= + #: airtime_mvc/application/forms/LiveStreamingPreferences.php:96 msgid "Master Source Mount Point" msgstr "Mester Forrási Csatolási Pont" ->>>>>>> 2.5.x #: airtime_mvc/application/controllers/LocaleController.php:239 msgid "month" msgstr "hónap" -<<<<<<< HEAD #: airtime_mvc/application/controllers/LocaleController.php:254 msgid "Shows longer than their scheduled time will be cut off by a following show." msgstr "Ha egy műsor hosszabb az ütemezett időnél, meg lesz vágva és követi azt a következő műsor." @@ -3147,7 +3116,7 @@ msgstr "Ha egy műsor hosszabb az ütemezett időnél, meg lesz vágva és köve #: airtime_mvc/application/controllers/LocaleController.php:255 msgid "Cancel Current Show?" msgstr "A Jelenlegi Műsor Megszakítása?" -======= + #: airtime_mvc/application/forms/LiveStreamingPreferences.php:106 msgid "Show Source Port" msgstr "Műsor Forrás Port" @@ -3155,7 +3124,6 @@ msgstr "Műsor Forrás Port" #: airtime_mvc/application/forms/LiveStreamingPreferences.php:115 msgid "Show Source Mount Point" msgstr "Műsor Forrási Csatolási Pont" ->>>>>>> 2.5.x #: airtime_mvc/application/controllers/LocaleController.php:256 #: airtime_mvc/application/controllers/LocaleController.php:300 @@ -3914,14 +3882,11 @@ msgstr "" #~ msgid "can't resize a past show" #~ msgstr "elhangzott adást nem lehet átméretezni" -<<<<<<< HEAD #~ msgid "Should not overlap shows" #~ msgstr "Nem kellene, hogy a műsorok fedjék egymást" -======= #: airtime_mvc/application/configs/navigation.php:104 msgid "History Templates" msgstr "Naplózási Sablonok" ->>>>>>> 2.5.x #~ msgid "Failed to create 'organize' directory." #~ msgstr "Nem sikerült létrehozni 'szervező' könyvtárat." diff --git a/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.mo index 114eb85d3..76a62ff71 100644 Binary files a/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.po b/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.po index 4b1c353b4..73f4bbe98 100644 --- a/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.po +++ b/airtime_mvc/locale/hy_AM/LC_MESSAGES/airtime.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Airtime\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-11-13 13:55-0500\n" -"PO-Revision-Date: 2014-12-05 10:32+0000\n" +"PO-Revision-Date: 2015-01-15 11:11+0000\n" "Last-Translator: Daniel James \n" "Language-Team: Armenian (Armenia) (http://www.transifex.com/projects/p/airtime/language/hy_AM/)\n" "MIME-Version: 1.0\n" diff --git a/airtime_mvc/locale/ka/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/ka/LC_MESSAGES/airtime.mo index 1cd4bb1ac..6411fcaf9 100644 Binary files a/airtime_mvc/locale/ka/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/ka/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/ka/LC_MESSAGES/airtime.po b/airtime_mvc/locale/ka/LC_MESSAGES/airtime.po index 6cfc03736..cb3f7f1c1 100644 --- a/airtime_mvc/locale/ka/LC_MESSAGES/airtime.po +++ b/airtime_mvc/locale/ka/LC_MESSAGES/airtime.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Airtime\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-11-13 13:55-0500\n" -"PO-Revision-Date: 2014-12-05 10:32+0000\n" +"PO-Revision-Date: 2015-01-15 11:11+0000\n" "Last-Translator: Daniel James \n" "Language-Team: Georgian (http://www.transifex.com/projects/p/airtime/language/ka/)\n" "MIME-Version: 1.0\n" diff --git a/airtime_mvc/locale/pt_BR/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/pt_BR/LC_MESSAGES/airtime.mo index abd94d09d..8267a2179 100644 Binary files a/airtime_mvc/locale/pt_BR/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/pt_BR/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index dac9be3c4..101ad9d6d 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -10,10 +10,11 @@ body { } html, body { height: 100%; + background: #7f7f7f; } #login-page { - background: #1f1f1f url(images/login_page_bg.png) no-repeat center 0;` + background: #1f1f1f url(images/login_page_bg.png) no-repeat center 0; margin: 0; padding: 0; height:100%; @@ -1002,7 +1003,28 @@ input[type="checkbox"] { display:block; } -dt.block-display, dd.block-display { +#pref_form dt, #pref_form dd, +#pref_form textarea { + display:block; + float:none; + margin-left:0; + padding-left:0; + width: 100%; +} +#pref_form textarea { + width: 98.5%; +} +#pref_form select { + width: 100%; +} + +#pref_form p.description { + color: #3b3b3b; + font-size: 12px; + float: left; +} + + dt.block-display, dd.block-display { display:block; float:none; margin-left:0; diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 4f03e6dfa..139660dd7 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -1059,7 +1059,10 @@ var AIRTIME = (function(AIRTIME){ ""); } - $toolbar.append($menu); + if (localStorage.getItem('user-type') != 'G') { + $toolbar.append($menu); + } + $menu = undefined; $('#timeline-sa').click(function(){mod.selectAll();}); diff --git a/utils/upgrade.py b/utils/upgrade.py new file mode 100755 index 000000000..d77ab86dc --- /dev/null +++ b/utils/upgrade.py @@ -0,0 +1,54 @@ +#!/usr/bin/python + +import ConfigParser +import argparse +import requests +from urlparse import urlparse +import sys + +CONFIG_PATH='/etc/airtime/airtime.conf' +GENERAL_CONFIG_SECTION = "general" + +def read_config_file(config_path): + """Parse the application's config file located at config_path.""" + config = ConfigParser.SafeConfigParser() + try: + config.readfp(open(config_path)) + except IOError as e: + print "Failed to open config file at " + config_path + ": " + e.strerror + exit(-1) + except Exception: + print e.strerror + exit(-1) + + return config + +if __name__ == '__main__': + config = read_config_file(CONFIG_PATH) + api_key = config.get(GENERAL_CONFIG_SECTION, 'api_key') + base_url = config.get(GENERAL_CONFIG_SECTION, 'base_url') + base_dir = config.get(GENERAL_CONFIG_SECTION, 'base_dir') + action = "upgrade" + airtime_url = "" + + parser = argparse.ArgumentParser() + parser.add_argument('--downgrade', help='Downgrade the station', action="store_true") + parser.add_argument('station_url', help='station URL', nargs='?', default='') + args = parser.parse_args() + + if args.downgrade: + action = "downgrade" + + if airtime_url == "": + airtime_url = "http://%s%s" % (base_url, base_dir) + + # Add http:// if you were lazy and didn't pass a scheme to this script + url = urlparse(airtime_url) + if not url.scheme: + airtime_url = "http://%s" % airtime_url + + print "Requesting %s..." % action + r = requests.get("%s/%s" % (airtime_url, action), auth=(api_key, '')) + print r.text + r.raise_for_status() +