From 1272c172b745edcf9c470804a4fd3d104829a8ff Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 19 Aug 2011 15:46:35 -0400 Subject: [PATCH 1/2] CC-2703: orange progress bar is playing when there is not content -previous and future shows are now ignored as well --- airtime_mvc/application/models/Dashboard.php | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/models/Dashboard.php b/airtime_mvc/application/models/Dashboard.php index 593e60af1..dfdc97acd 100644 --- a/airtime_mvc/application/models/Dashboard.php +++ b/airtime_mvc/application/models/Dashboard.php @@ -23,10 +23,14 @@ class Application_Model_Dashboard } } else { if (count($row) == 0){ - //last item is a show instance - return array("name"=>$showInstance->getName(), - "starts"=>$showInstance->getShowStart(), - "ends"=>$showInstance->getShowEnd()); + if ($showInstance->isRecorded()){ + //last item is a show instance + return array("name"=>$showInstance->getName(), + "starts"=>$showInstance->getShowStart(), + "ends"=>$showInstance->getShowEnd()); + } else { + return null; + } } else { //return the one that started later. if ($row[0]["starts"] >= $showInstance->getShowStart()){ @@ -107,10 +111,14 @@ class Application_Model_Dashboard } } else { if (count($row) == 0){ - //last item is a show instance - return array("name"=>$showInstance->getName(), - "starts"=>$showInstance->getShowStart(), - "ends"=>$showInstance->getShowEnd()); + if ($showInstance->isRecorded()){ + //last item is a show instance + return array("name"=>$showInstance->getName(), + "starts"=>$showInstance->getShowStart(), + "ends"=>$showInstance->getShowEnd()); + } else { + return null; + } } else { //return the one that starts sooner. From 30fcb0b95d5e6d657de46e4609e2cd3df3a6a09e Mon Sep 17 00:00:00 2001 From: James Date: Fri, 19 Aug 2011 16:42:46 -0400 Subject: [PATCH 2/2] CC-2704: Support settings UI tweaks - adding server name again under Preference --- .../controllers/PreferenceController.php | 3 ++- .../application/forms/GeneralPreferences.php | 14 +++++++++++++- .../views/scripts/form/preferences_general.phtml | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 433930d17..7b7c62c65 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -28,7 +28,8 @@ class PreferenceController extends Zend_Controller_Action if ($request->isPost()) { if ($form->isValid($request->getPost())) { $values = $form->getValues(); - + + Application_Model_Preference::SetHeadTitle($values["preferences_general"]["stationName"], $this->view); Application_Model_Preference::SetDefaultFade($values["preferences_general"]["stationDefaultFade"]); Application_Model_Preference::SetStreamLabelFormat($values["preferences_general"]["streamFormat"]); Application_Model_Preference::SetAllow3rdPartyApi($values["preferences_general"]["thirdPartyApi"]); diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 181799ac8..b048f150f 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -13,7 +13,19 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm if($defaultFade == ""){ $defaultFade = '00:00:00.000000'; } - + + //Station name + $this->addElement('text', 'stationName', array( + 'class' => 'input_text', + 'label' => 'Station Name', + 'required' => false, + 'filters' => array('StringTrim'), + 'value' => Application_Model_Preference::GetValue("station_name"), + 'decorators' => array( + 'ViewHelper' + ) + )); + //Default station fade $this->addElement('text', 'stationDefaultFade', array( 'class' => 'input_text', diff --git a/airtime_mvc/application/views/scripts/form/preferences_general.phtml b/airtime_mvc/application/views/scripts/form/preferences_general.phtml index 3a59fe12b..b085f25f3 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_general.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_general.phtml @@ -1,5 +1,19 @@
+
+ +
+
+ element->getElement('stationName') ?> + element->getElement('stationName')->hasErrors()) : ?> +
    + element->getElement('stationName')->getMessages() as $error): ?> +
  • + +
+ +