From 1272c172b745edcf9c470804a4fd3d104829a8ff Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 19 Aug 2011 15:46:35 -0400 Subject: [PATCH 1/4] 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 e53c6d8061a288d63fb89bebe51736da41a80223 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 19 Aug 2011 16:40:53 -0400 Subject: [PATCH 2/4] CC-2697: airtime-user script is not working -added support for new user types --- utils/airtime-user.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/airtime-user.php b/utils/airtime-user.php index 89b8312f2..dde37242e 100755 --- a/utils/airtime-user.php +++ b/utils/airtime-user.php @@ -99,10 +99,12 @@ if ($action == "addupdate") { $user->setLastName($line); do{ - echo "Enter user type [(A)dmin|(H)ost|(G)uest]: "; + echo "Enter user type [(A)dmin|(P)rogram Manager|(D)J|(G)uest]: "; $line = trim(fgets(fopen("php://stdin","r"))); - } while($line != "A" && $line != "H" && $line != "G"); - $user->setType($line); + } while($line != "A" && $line != "P" && $line != "D" && $line != "G"); + + $types = array("A"=>"A", "P"=>"P", "D"=>"H", "G"=>"G",); + $user->setType($types[$line]); $user->save(); } elseif ($action == "delete") { From 30fcb0b95d5e6d657de46e4609e2cd3df3a6a09e Mon Sep 17 00:00:00 2001 From: James Date: Fri, 19 Aug 2011 16:42:46 -0400 Subject: [PATCH 3/4] 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): ?> +
  • + +
+ +
From a47044c50cbbcaeebfdbf5e3263aec855a04ecbf Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 19 Aug 2011 17:05:29 -0400 Subject: [PATCH 4/4] CC-2697: airtime-user script is not working -added script to system path --- install_minimal/include/AirtimeInstall.php | 4 +++ .../airtime-1.9.0/airtime-upgrade.php | 8 +++++ utils/airtime-check-system | 2 +- utils/airtime-user | 34 +++++++++++++++++++ utils/airtime-user.php | 26 ++++++++++---- 5 files changed, 67 insertions(+), 7 deletions(-) create mode 100755 utils/airtime-user mode change 100755 => 100644 utils/airtime-user.php diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 78371447f..50da8b498 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -341,6 +341,10 @@ class AirtimeInstall echo "* Installing airtime-check-system".PHP_EOL; $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-check-system"; exec("ln -s $dir /usr/bin/airtime-check-system"); + + echo "* Installing airtime-user".PHP_EOL; + $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user"; + exec("ln -s $dir /usr/bin/airtime-user"); } public static function RemoveSymlinks() diff --git a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php index dfaff0944..db7e97bb9 100644 --- a/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php +++ b/install_minimal/upgrades/airtime-1.9.0/airtime-upgrade.php @@ -20,6 +20,14 @@ const CONF_DIR_BINARIES = "/usr/lib/airtime"; class AirtimeInstall{ const CONF_DIR_LOG = "/var/log/airtime"; + const CONF_DIR_BINARIES = "/usr/lib/airtime"; + + public static function CreateSymlinksToUtils() + { + echo "* Installing airtime-user".PHP_EOL; + $dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-user"; + exec("ln -s $dir /usr/bin/airtime-user"); + } public static function CreateZendPhpLogFile(){ global $CC_CONFIG; diff --git a/utils/airtime-check-system b/utils/airtime-check-system index 7a67e6845..164fac6f9 100755 --- a/utils/airtime-check-system +++ b/utils/airtime-check-system @@ -21,7 +21,7 @@ # #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- -# This script cleans audio files in Airtime. +# This script for a correct system environment for Airtime. # # Absolute path to this script SCRIPT=`readlink -f $0` diff --git a/utils/airtime-user b/utils/airtime-user new file mode 100755 index 000000000..b6a30ac17 --- /dev/null +++ b/utils/airtime-user @@ -0,0 +1,34 @@ +#!/bin/bash +#------------------------------------------------------------------------------- +# Copyright (c) 2010 Sourcefabric O.P.S. +# +# This file is part of the Airtime project. +# http://airtime.sourcefabric.org/ +# +# Airtime is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Airtime is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Airtime; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +#------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- +# This script creates users in Airtime. +# +# Absolute path to this script +SCRIPT=`readlink -f $0` +# Absolute directory this script is in +SCRIPTPATH=`dirname $SCRIPT` + +invokePwd=$PWD +cd $SCRIPTPATH + +php -q airtime-user.php "$@" || exit 1 diff --git a/utils/airtime-user.php b/utils/airtime-user.php old mode 100755 new mode 100644 index dde37242e..30ad66c39 --- a/utils/airtime-user.php +++ b/utils/airtime-user.php @@ -1,12 +1,14 @@ -#!/usr/bin/php delete(); } } + +function GetAirtimeConf() +{ + $ini = parse_ini_file("/etc/airtime/airtime.conf", true); + + if ($ini === false){ + echo "Error reading /etc/airtime/airtime.conf.".PHP_EOL; + exit; + } + + return $ini; +}