From 89267748d40df008b5a2e805c1d93cec733e8493 Mon Sep 17 00:00:00 2001 From: Naomi Date: Fri, 11 Feb 2011 18:55:08 -0500 Subject: [PATCH 01/23] CC-1916 playlist metadata page looks better. --- .../controllers/PlaylistController.php | 34 +++++------ application/forms/PlaylistMetadata.php | 12 +++- .../views/scripts/playlist/metadata.phtml | 4 +- application/views/scripts/playlist/new.phtml | 5 +- public/css/styles.css | 59 ++++++++++++++++++- public/js/airtime/library/spl.js | 32 +++++----- 6 files changed, 107 insertions(+), 39 deletions(-) diff --git a/application/controllers/PlaylistController.php b/application/controllers/PlaylistController.php index a047e47da..e32eb2e59 100644 --- a/application/controllers/PlaylistController.php +++ b/application/controllers/PlaylistController.php @@ -93,7 +93,8 @@ class PlaylistController extends Zend_Controller_Action $this->changePlaylist($pl_id); $form = new Application_Form_PlaylistMetadata(); - $this->view->form = $form->__toString(); + $this->view->fieldset = $form; + $this->view->form = $this->view->render('playlist/new.phtml'); } public function metadataAction() @@ -115,26 +116,25 @@ class PlaylistController extends Zend_Controller_Action } if ($request->isPost()) { - if ($form->isValid($request->getPost())) { - - $formdata = $form->getValues(); + $title = $this->_getParam('title', null); + $description = $this->_getParam('description', null); - $pl = $this->getPlaylist(); - - if($formdata["title"]) - $pl->setName($formdata["title"]); - - if(isset($formdata["description"])) { - $pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $formdata["description"]); - } + $pl = $this->getPlaylist(); + + if($title) + $pl->setName($title); + + if(isset($description)) { + $pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description); + } - $this->view->pl = $pl; - $this->view->html = $this->view->render('playlist/index.phtml'); - unset($this->view->pl); - } + $this->view->pl = $pl; + $this->view->html = $this->view->render('playlist/index.phtml'); + unset($this->view->pl); } - $this->view->form = $form->__toString(); + $this->view->fieldset = $form; + $this->view->form = $this->view->render('playlist/new.phtml'); } public function editAction() diff --git a/application/forms/PlaylistMetadata.php b/application/forms/PlaylistMetadata.php index 4fc64ce39..fb546f35a 100644 --- a/application/forms/PlaylistMetadata.php +++ b/application/forms/PlaylistMetadata.php @@ -1,6 +1,6 @@ addElement('text', 'title', array( 'label' => 'Title:', + 'class' => 'input_text', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array( @@ -18,10 +19,15 @@ class Application_Form_PlaylistMetadata extends Zend_Form // Add the comment element $this->addElement('textarea', 'description', array( 'label' => 'Description:', + 'class' => 'input_text_area', 'required' => false, )); + + // Add the comment element + $this->addElement('button', 'new_playlist_submit', array( + 'label' => 'Submit', + 'ignore' => true + )); } - - } diff --git a/application/views/scripts/playlist/metadata.phtml b/application/views/scripts/playlist/metadata.phtml index 440203443..63e18ca2c 100644 --- a/application/views/scripts/playlist/metadata.phtml +++ b/application/views/scripts/playlist/metadata.phtml @@ -1 +1,3 @@ -form; ?> +
+view->fieldset; ?> +
diff --git a/application/views/scripts/playlist/new.phtml b/application/views/scripts/playlist/new.phtml index 07e36af17..efd1d6872 100644 --- a/application/views/scripts/playlist/new.phtml +++ b/application/views/scripts/playlist/new.phtml @@ -1 +1,4 @@ -

View script for controller Playlist and script/action name new
\ No newline at end of file +

Playlist Metadata

+
+fieldset; ?> +
diff --git a/public/css/styles.css b/public/css/styles.css index adf53ab77..6512e8fb8 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -1347,6 +1347,61 @@ ul.errors li { #show_content_dialog .datatable { margin-top:8px; - - +} +.simple-formblock.metadata { + border:none; + width:100%; +} +#side_playlist .simple-formblock.metadata .input_text, #side_playlist .simple-formblock.metadata .input_text_area { + width:95%; +} +#side_playlist .simple-formblock.metadata.simple-formblock dd { + width:70%; +} +#side_playlist h3.plain { + float:none; + font-size:18px; + margin:2px 0 20px 0; +} + +.qtip { + font-size:11px; + line-height:160%; +} + +#schedule-show-who.scrolled { + margin-bottom: 0; + max-height:300px; + overflow:auto; +} +.text-content { + padding:20px 10px 0 20px; +} +.text-content h2 { + font-size:2.8em; + color:#242424; +} +.text-content p { + font-size:1.6em; + line-height:140%; + color:#242424; + margin:0 0 1.4em 0; +} +.text-content a { + color:#cccccc; + text-decoration:none; +} +.text-content a:hover { + text-decoration:underline; +} + +.text-content ol { + margin:0; + list-style-position:inside; +} + +.text-content ol li { + margin:0 0 4px 0; + font-size:1.6em; + list-style-position:inside; } \ No newline at end of file diff --git a/public/js/airtime/library/spl.js b/public/js/airtime/library/spl.js index 101ef9a2d..e32e83f62 100644 --- a/public/js/airtime/library/spl.js +++ b/public/js/airtime/library/spl.js @@ -331,20 +331,8 @@ function closeSPL() { function createPlaylistMetaForm(json) { var submit, form; - submit = $('') - .button() - .click(function(){ - var url, data; - - url = '/Playlist/metadata/format/json'; - data = $("#side_playlist form").serialize(); - - $.post(url, data, function(json){ - openDiffSPL(json); - }) - }); - form = $(json.form); + form.find("fieldset").addClass("simple-formblock metadata"); form.find("input, textarea") .keydown(function(event){ @@ -355,10 +343,24 @@ function createPlaylistMetaForm(json) { } }) + form.find("#new_playlist_submit") + .button() + .click(function(event){ + event.preventDefault(); + + var url, data; + + url = '/Playlist/metadata/format/json'; + data = $("#side_playlist form").serialize(); + + $.post(url, data, function(json){ + openDiffSPL(json); + }) + }); + $("#side_playlist") .empty() - .append(form) - .append(submit); + .append(form); } function newSPL() { From 2f796f3d9c7baba07fc7658256646662c1397e60 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 14:04:09 -0500 Subject: [PATCH 02/23] default fade shows in preferences "00:00:00.000000" --- application/forms/Preferences.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/forms/Preferences.php b/application/forms/Preferences.php index f003b75d6..8ecda7187 100644 --- a/application/forms/Preferences.php +++ b/application/forms/Preferences.php @@ -17,14 +17,21 @@ class Application_Form_Preferences extends Zend_Form 'value' => Application_Model_Preference::GetValue("station_name") )); + $defaultFade = Application_Model_Preference::GetValue("default_fade"); + if($defaultFade == ""){ + $defaultFade = '00:00:00.000000'; + } + // Add login element $this->addElement('text', 'stationDefaultFade', array( 'class' => 'input_text', 'label' => 'Default Fade:', 'required' => false, 'filters' => array('StringTrim'), - 'validators' => array(array('regex', false, array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/', 'messages' => 'enter a time 00:00:00{.000000}'))), - 'value' => Application_Model_Preference::GetValue("default_fade") + 'validators' => array(array('regex', false, + array('/^[0-2][0-3]:[0-5][0-9]:[0-5][0-9](\.\d{1,6})?$/', + 'messages' => 'enter a time 00:00:00{.000000}'))), + 'value' => $defaultFade )); $this->addElement('submit', 'submit', array( @@ -34,4 +41,3 @@ class Application_Form_Preferences extends Zend_Form )); } } -///^[0-2][0-3]:[0-5][0-9]:[0-5][0-9]{.}[0-9]{0-6}/i From 9a7dda49fe8b4796172b0b5bc50f296fe8f7713d Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 14:44:55 -0500 Subject: [PATCH 03/23] CC-1917 file meta data screen --- application/forms/EditAudioMD.php | 33 +++++++++++-------- .../views/scripts/library/edit-file-md.phtml | 8 +++-- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/application/forms/EditAudioMD.php b/application/forms/EditAudioMD.php index 37df0e0e9..639303a12 100644 --- a/application/forms/EditAudioMD.php +++ b/application/forms/EditAudioMD.php @@ -9,9 +9,10 @@ class Application_Form_EditAudioMD extends Zend_Form $this->setMethod('post'); // Add title field - $this->addElement('text', 'track_title', array( + $this->addElement('text', 'dc:title', array( 'label' => 'Title:', 'required' => true, + 'class' => 'input_text', 'filters' => array('StringTrim'), 'validators' => array( 'NotEmpty', @@ -19,70 +20,74 @@ class Application_Form_EditAudioMD extends Zend_Form )); // Add artist field - $this->addElement('text', 'artist_name', array( + $this->addElement('text', 'dc:creator', array( 'label' => 'Artist:', 'required' => true, + 'class' => 'input_text', 'filters' => array('StringTrim'), 'validators' => array( 'NotEmpty', ) )); - // Add bitrate field - // $this->addElement('text', 'bit_rate', array( - // 'label' => 'Bitrate:', - // 'attribs' => array('disabled' => 'disabled') - //)); - // Add album field - $this->addElement('text', 'album_title', array( + $this->addElement('text', 'dc:source', array( 'label' => 'Album:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add genre field $this->addElement('text', 'genre', array( 'label' => 'Genre:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add year field - $this->addElement('text', 'year', array( + $this->addElement('text', 'ls:year', array( 'label' => 'Year:', + 'class' => 'input_text', 'filters' => array('StringTrim'), 'validators' => array( array('date', false, array('YYYY-MM-DD')), + array('date', false, array('YYYY-MM')), array('date', false, array('YYYY')) ) )); // Add label field - $this->addElement('text', 'label', array( + $this->addElement('text', 'dc:publisher', array( 'label' => 'Label:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add composer field - $this->addElement('text', 'composer', array( + $this->addElement('text', 'ls:composer', array( 'label' => 'Composer:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add mood field - $this->addElement('text', 'mood', array( + $this->addElement('text', 'ls:mood', array( 'label' => 'Mood:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add language field - $this->addElement('text', 'language', array( + $this->addElement('text', 'dc:language', array( 'label' => 'Language:', + 'class' => 'input_text', 'filters' => array('StringTrim') )); // Add the submit button $this->addElement('submit', 'submit', array( 'ignore' => true, + 'class' => 'ui-button ui-state-default', 'label' => 'Submit', )); } diff --git a/application/views/scripts/library/edit-file-md.phtml b/application/views/scripts/library/edit-file-md.phtml index 41276c253..6b7696c0a 100644 --- a/application/views/scripts/library/edit-file-md.phtml +++ b/application/views/scripts/library/edit-file-md.phtml @@ -1,4 +1,6 @@ - +

Edit Metadata

-$this->form->setAction($this->url()); -echo $this->form; + form->setAction($this->url()); + echo $this->form; ?> + From a83a4b6baec689fad12ddccb17b0d6f6e74d5c2a Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 17:21:37 -0500 Subject: [PATCH 04/23] show cancelling available (needed for repeating shows) --- .zfproject.xml | 4 ++ .../controllers/ScheduleController.php | 68 +++++++++++-------- application/forms/AddShowWhen.php | 1 + application/models/Shows.php | 15 ++++ .../views/scripts/schedule/cancel-show.phtml | 1 + 5 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 application/views/scripts/schedule/cancel-show.phtml diff --git a/.zfproject.xml b/.zfproject.xml index 2d7499e2c..cffca41f9 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -70,6 +70,7 @@ + @@ -321,6 +322,9 @@ + + + diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index e1d97fe65..f6bf30231 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -24,6 +24,7 @@ class ScheduleController extends Zend_Controller_Action ->addActionContext('remove-group', 'json') ->addActionContext('edit-show', 'json') ->addActionContext('add-show', 'json') + ->addActionContext('cancel-show', 'json') ->initContext(); $this->sched_sess = new Zend_Session_Namespace("schedule"); @@ -123,7 +124,7 @@ class ScheduleController extends Zend_Controller_Action public function deleteShowAction() { $showInstanceId = $this->_getParam('id'); - + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new User($userInfo->id); @@ -150,6 +151,8 @@ class ScheduleController extends Zend_Controller_Action if($user->isAdmin()) { $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete'); + + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Cancel Show'); } if($user->isHost($show->getShowId()) || $user->isAdmin()) { @@ -211,7 +214,7 @@ class ScheduleController extends Zend_Controller_Action public function findPlaylistsAction() { $post = $this->getRequest()->getPost(); - + $show = new ShowInstance($this->sched_sess->showInstanceId); $playlists = $show->searchPlaylistsForShow($post); @@ -302,7 +305,7 @@ class ScheduleController extends Zend_Controller_Action public function addShowAction() { - $js = $this->_getParam('data'); + $js = $this->_getParam('data'); $data = array(); //need to convert from serialized jQuery array. @@ -324,6 +327,12 @@ class ScheduleController extends Zend_Controller_Action $formRepeats->removeDecorator('DtDdWrapper'); $formStyle->removeDecorator('DtDdWrapper'); + $this->view->what = $formWhat; + $this->view->when = $formWhen; + $this->view->repeats = $formRepeats; + $this->view->who = $formWho; + $this->view->style = $formStyle; + $what = $formWhat->isValid($data); $when = $formWhen->isValid($data); if($when) { @@ -333,7 +342,7 @@ class ScheduleController extends Zend_Controller_Action if($data["add_show_repeats"]) { $repeats = $formRepeats->isValid($data); if($repeats) { - $when = $formRepeats->checkReliantFields($data); + $repeats = $formRepeats->checkReliantFields($data); } } else { @@ -352,37 +361,38 @@ class ScheduleController extends Zend_Controller_Action } //send back a new form for the user. - $formWhat = new Application_Form_AddShowWhat(); - $formWho = new Application_Form_AddShowWho(); - $formWhen = new Application_Form_AddShowWhen(); - $formRepeats = new Application_Form_AddShowRepeats(); - $formStyle = new Application_Form_AddShowStyle(); - - $formWhat->removeDecorator('DtDdWrapper'); - $formWho->removeDecorator('DtDdWrapper'); - $formWhen->removeDecorator('DtDdWrapper'); - $formRepeats->removeDecorator('DtDdWrapper'); - $formStyle->removeDecorator('DtDdWrapper'); - - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; + $formWhat->reset(); + $formWho->reset(); + $formWhen->reset(); + $formWhen->populate(array('add_show_start_date' => date("Y-m-d"), + 'add_show_start_time' => '0:00', + 'add_show_duration' => '1:00')); + $formRepeats->reset(); + $formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); + $formStyle->reset(); + $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); } else { - $this->view->what = $formWhat; - $this->view->when = $formWhen; - $this->view->repeats = $formRepeats; - $this->view->who = $formWho; - $this->view->style = $formStyle; $this->view->form = $this->view->render('schedule/add-show-form.phtml'); - } - + } } + public function cancelShowAction() + { + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new User($userInfo->id); + + if($user->isAdmin()) { + $showInstanceId = $this->_getParam('id'); + + $showInstance = new ShowInstance($showInstanceId); + $show = new Show($showInstance->getShowId()); + + $show->cancelShow($showInstance->getShowStart()); + } + } } @@ -390,3 +400,5 @@ class ScheduleController extends Zend_Controller_Action + + diff --git a/application/forms/AddShowWhen.php b/application/forms/AddShowWhen.php index 4467ee089..d59afa0ef 100644 --- a/application/forms/AddShowWhen.php +++ b/application/forms/AddShowWhen.php @@ -23,6 +23,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'label' => 'Start Time:', 'class' => 'input_text', 'required' => true, + 'value' => '0:00', 'filters' => array('StringTrim'), 'validators' => array( 'NotEmpty', diff --git a/application/models/Shows.php b/application/models/Shows.php index 1f7d5661f..41ea62c43 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -49,6 +49,21 @@ class Show { $show->setDbBackgroundColor($backgroundColor); } + public function cancelShow($day_timestamp) { + global $CC_DBC; + + $timeinfo = explode(" ", $day_timestamp); + + CcShowDaysQuery::create() + ->filterByDbShowId($this->_showId) + ->update(array('DbLastShow' => $timeinfo[0])); + + $sql = "DELETE FROM cc_show_instances + WHERE starts >= '{$day_timestamp}' AND show_id = {$this->_showId}"; + + $CC_DBC->query($sql); + } + //end dates are non inclusive. public static function addShow($data) { diff --git a/application/views/scripts/schedule/cancel-show.phtml b/application/views/scripts/schedule/cancel-show.phtml new file mode 100644 index 000000000..1f2c21d35 --- /dev/null +++ b/application/views/scripts/schedule/cancel-show.phtml @@ -0,0 +1 @@ +

View script for controller Schedule and script/action name cancelShow
\ No newline at end of file From 54398b8c32f5d6f70ac5b7f3e0bd05a2683e9ad2 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 17:26:02 -0500 Subject: [PATCH 05/23] playlists with no content will be filtered in the schedule show dialog. --- application/models/StoredFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/StoredFile.php b/application/models/StoredFile.php index c4d379b3a..9190c48f1 100644 --- a/application/models/StoredFile.php +++ b/application/models/StoredFile.php @@ -1792,7 +1792,7 @@ class StoredFile { $fromTable = "cc_playlist AS pl LEFT JOIN cc_playlisttimes AS plt USING(id) LEFT JOIN cc_subjs AS sub ON pl.editedby = sub.id"; $datatables["optWhere"][] = "plt.length <= INTERVAL '{$p_length}'"; - + $datatables["optWhere"][] = "plt.length > INTERVAL '00:00:00'"; return StoredFile::searchFiles($fromTable, $datatables); } From ddddcc937509e6a72d04a43139bd6e6db0758e09 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 18:40:17 -0500 Subject: [PATCH 06/23] can make show as many hours long in duration as wanted. --- application/configs/airtime-conf.php | 4 +- application/forms/AddShowWhen.php | 10 ++- .../models/airtime/map/CcShowDaysTableMap.php | 2 +- .../models/airtime/om/BaseCcShowDays.php | 76 +++---------------- .../models/airtime/om/BaseCcShowDaysQuery.php | 23 ++---- build/build.properties | 2 +- build/schema.xml | 2 +- build/sql/schema.sql | 2 +- 8 files changed, 31 insertions(+), 90 deletions(-) diff --git a/application/configs/airtime-conf.php b/application/configs/airtime-conf.php index 907c5efe1..1fe0ecb7e 100644 --- a/application/configs/airtime-conf.php +++ b/application/configs/airtime-conf.php @@ -1,6 +1,6 @@ array ( @@ -17,4 +17,4 @@ $conf = array ( 'generator_version' => '1.5.2', ); $conf['classmap'] = include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'classmap-airtime-conf.php'); -return $conf; +return $conf; \ No newline at end of file diff --git a/application/forms/AddShowWhen.php b/application/forms/AddShowWhen.php index d59afa0ef..b6e6fa48a 100644 --- a/application/forms/AddShowWhen.php +++ b/application/forms/AddShowWhen.php @@ -38,10 +38,12 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm 'value' => '1:00', 'required' => true, 'filters' => array('StringTrim'), - 'validators' => array( - 'NotEmpty', - array('date', false, array('HH:mm', 'messages' => 'Show must be under 24 hours')) - ) + 'validators' => array( + 'NotEmpty', + array('regex', false, + array('/^\d+:[0-5][0-9]$/', + 'messages' => 'enter a duration: HH:mm')) + ) )); // Add repeats element diff --git a/application/models/airtime/map/CcShowDaysTableMap.php b/application/models/airtime/map/CcShowDaysTableMap.php index 3a8535635..ecd03ac15 100644 --- a/application/models/airtime/map/CcShowDaysTableMap.php +++ b/application/models/airtime/map/CcShowDaysTableMap.php @@ -42,7 +42,7 @@ class CcShowDaysTableMap extends TableMap { $this->addColumn('FIRST_SHOW', 'DbFirstShow', 'DATE', true, null, null); $this->addColumn('LAST_SHOW', 'DbLastShow', 'DATE', false, null, null); $this->addColumn('START_TIME', 'DbStartTime', 'TIME', true, null, null); - $this->addColumn('DURATION', 'DbDuration', 'TIME', true, null, null); + $this->addColumn('DURATION', 'DbDuration', 'VARCHAR', true, 255, null); $this->addColumn('DAY', 'DbDay', 'TINYINT', false, null, null); $this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null); $this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, null, null); diff --git a/application/models/airtime/om/BaseCcShowDays.php b/application/models/airtime/om/BaseCcShowDays.php index b905be677..c45567ec9 100644 --- a/application/models/airtime/om/BaseCcShowDays.php +++ b/application/models/airtime/om/BaseCcShowDays.php @@ -207,36 +207,13 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent } /** - * Get the [optionally formatted] temporal [duration] column value. + * Get the [duration] column value. * - * - * @param string $format The date/time format string (either date()-style or strftime()-style). - * If format is NULL, then the raw DateTime object will be returned. - * @return mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL - * @throws PropelException - if unable to parse/validate the date/time value. + * @return string */ - public function getDbDuration($format = '%X') + public function getDbDuration() { - if ($this->duration === null) { - return null; - } - - - - try { - $dt = new DateTime($this->duration); - } catch (Exception $x) { - throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->duration, true), $x); - } - - if ($format === null) { - // Because propel.useDateTimeClass is TRUE, we return a DateTime object. - return $dt; - } elseif (strpos($format, '%') !== false) { - return strftime($format, $dt->format('U')); - } else { - return $dt->format($format); - } + return $this->duration; } /** @@ -470,50 +447,21 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent } // setDbStartTime() /** - * Sets the value of [duration] column to a normalized version of the date/time value specified. + * Set the value of [duration] column. * - * @param mixed $v string, integer (timestamp), or DateTime value. Empty string will - * be treated as NULL for temporal objects. + * @param string $v new value * @return CcShowDays The current object (for fluent API support) */ public function setDbDuration($v) { - // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now') - // -- which is unexpected, to say the least. - if ($v === null || $v === '') { - $dt = null; - } elseif ($v instanceof DateTime) { - $dt = $v; - } else { - // some string/numeric value passed; we normalize that so that we can - // validate it. - try { - if (is_numeric($v)) { // if it's a unix timestamp - $dt = new DateTime('@'.$v, new DateTimeZone('UTC')); - // We have to explicitly specify and then change the time zone because of a - // DateTime bug: http://bugs.php.net/bug.php?id=43003 - $dt->setTimeZone(new DateTimeZone(date_default_timezone_get())); - } else { - $dt = new DateTime($v); - } - } catch (Exception $x) { - throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); - } + if ($v !== null) { + $v = (string) $v; } - if ( $this->duration !== null || $dt !== null ) { - // (nested ifs are a little easier to read in this case) - - $currNorm = ($this->duration !== null && $tmpDt = new DateTime($this->duration)) ? $tmpDt->format('H:i:s') : null; - $newNorm = ($dt !== null) ? $dt->format('H:i:s') : null; - - if ( ($currNorm !== $newNorm) // normalized values don't match - ) - { - $this->duration = ($dt ? $dt->format('H:i:s') : null); - $this->modifiedColumns[] = CcShowDaysPeer::DURATION; - } - } // if either are not null + if ($this->duration !== $v) { + $this->duration = $v; + $this->modifiedColumns[] = CcShowDaysPeer::DURATION; + } return $this; } // setDbDuration() diff --git a/application/models/airtime/om/BaseCcShowDaysQuery.php b/application/models/airtime/om/BaseCcShowDaysQuery.php index 418cd2012..a91994d5f 100644 --- a/application/models/airtime/om/BaseCcShowDaysQuery.php +++ b/application/models/airtime/om/BaseCcShowDaysQuery.php @@ -278,29 +278,20 @@ abstract class BaseCcShowDaysQuery extends ModelCriteria /** * Filter the query on the duration column * - * @param string|array $dbDuration The value to use as filter. - * Accepts an associative array('min' => $minValue, 'max' => $maxValue) + * @param string $dbDuration The value to use as filter. + * Accepts wildcards (* and % trigger a LIKE) * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CcShowDaysQuery The current query, for fluid interface */ public function filterByDbDuration($dbDuration = null, $comparison = null) { - if (is_array($dbDuration)) { - $useMinMax = false; - if (isset($dbDuration['min'])) { - $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($dbDuration['max'])) { - $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { + if (null === $comparison) { + if (is_array($dbDuration)) { $comparison = Criteria::IN; + } elseif (preg_match('/[\%\*]/', $dbDuration)) { + $dbDuration = str_replace('*', '%', $dbDuration); + $comparison = Criteria::LIKE; } } return $this->addUsingAlias(CcShowDaysPeer::DURATION, $dbDuration, $comparison); diff --git a/build/build.properties b/build/build.properties index cd25e41b3..75a77da70 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1,6 +1,6 @@ #Note: project.home is automatically generated by the propel-install script. #Any manual changes to this value will be overwritten. -project.home = /home/naomi/dev-campcaster/campcaster +project.home = /home/naomiaro/dev-campcaster/campcaster project.build = ${project.home}/build #Database driver diff --git a/build/schema.xml b/build/schema.xml index 0bac4bd57..ea1512560 100644 --- a/build/schema.xml +++ b/build/schema.xml @@ -142,7 +142,7 @@ - + diff --git a/build/sql/schema.sql b/build/sql/schema.sql index fb6b548ce..4627d2d23 100644 --- a/build/sql/schema.sql +++ b/build/sql/schema.sql @@ -205,7 +205,7 @@ CREATE TABLE "cc_show_days" "first_show" DATE NOT NULL, "last_show" DATE, "start_time" TIME NOT NULL, - "duration" TIME NOT NULL, + "duration" VARCHAR(255) NOT NULL, "day" INT2, "repeat_type" INT2 NOT NULL, "next_pop_date" DATE, From 0b9377b3627c23917da167caaa87e909910bbc73 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 22:29:12 -0500 Subject: [PATCH 07/23] added height to hosts element. --- public/css/add-show.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/css/add-show.css b/public/css/add-show.css index 3f53ff6b0..f78f515eb 100644 --- a/public/css/add-show.css +++ b/public/css/add-show.css @@ -104,4 +104,10 @@ label.wrapp-label input[type="checkbox"] { padding:8px; color:#902d2d; display:none; -} \ No newline at end of file +} + +#add_show_hosts-element { + max-height: 80px; + min-width: 150px; + overflow: auto; +} From bd2d560c1b7b0e740b604693ff9f3d5dd79c5a6e Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 23:02:44 -0500 Subject: [PATCH 08/23] ordering by login --- application/models/Users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Users.php b/application/models/Users.php index ca3bdf448..ee6afc957 100644 --- a/application/models/Users.php +++ b/application/models/Users.php @@ -139,7 +139,7 @@ class User { $sql_type = "type = {$type}"; } - $sql = $sql_gen ." WHERE (". $sql_type.")"; + $sql = $sql_gen ." WHERE (". $sql_type.") ORDER BY login"; if(!is_null($search)) { $like = "login ILIKE '%{$search}%'"; From 7093ebd23fdce13c22913b0077ec72394c278632 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 23:07:28 -0500 Subject: [PATCH 09/23] modified to avoid sql error when searching. --- application/models/Users.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/Users.php b/application/models/Users.php index ee6afc957..8a2574505 100644 --- a/application/models/Users.php +++ b/application/models/Users.php @@ -139,13 +139,15 @@ class User { $sql_type = "type = {$type}"; } - $sql = $sql_gen ." WHERE (". $sql_type.") ORDER BY login"; + $sql = $sql_gen ." WHERE (". $sql_type.") "; if(!is_null($search)) { $like = "login ILIKE '%{$search}%'"; - $sql = $sql . " AND ".$like." ORDER BY login"; + $sql = $sql . " AND ".$like; } + + $sql = $sql ." ORDER BY login"; return $CC_DBC->GetAll($sql); } From b9e1078e10fac9cecd73769b654e2aa6a36bebab Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 11:49:28 -0500 Subject: [PATCH 10/23] -small fixes to now playing --- .../views/scripts/nowplaying/index.phtml | 3 +- public/js/playlist/nowplayingdatagrid.js | 100 +++++++++--------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/application/views/scripts/nowplaying/index.phtml b/application/views/scripts/nowplaying/index.phtml index e06b49810..e8b101dc0 100644 --- a/application/views/scripts/nowplaying/index.phtml +++ b/application/views/scripts/nowplaying/index.phtml @@ -1,4 +1,5 @@ -
+
+ diff --git a/public/js/playlist/nowplayingdatagrid.js b/public/js/playlist/nowplayingdatagrid.js index ce65d2a00..def9dd460 100644 --- a/public/js/playlist/nowplayingdatagrid.js +++ b/public/js/playlist/nowplayingdatagrid.js @@ -1,5 +1,5 @@ var registered = false; -var datagridData; +var datagridData = null; function getDateText(obj){ var str = obj.aData[ obj.iDataColumn ].toString(); @@ -42,52 +42,21 @@ function notifySongEnd(){ } } - createDataGrid(); + updateDataTable(); } - var columns = [{"sTitle": "type", "bVisible":false}, - {"sTitle":"Date"}, - {"sTitle":"Start"}, - {"sTitle":"End"}, - {"sTitle":"Duration"}, - {"sTitle":"Song"}, - {"sTitle":"Artist"}, - {"sTitle":"Album"}, - {"sTitle":"Playlist"}, - {"sTitle":"Show"}, - {"sTitle":"bgcolor", "bVisible":false}, - {"sTitle":"group_id", "bVisible":false}]; - -function createDataGrid(){ - - columns[1]["fnRender"] = getDateText; - columns[2]["fnRender"] = getTimeText; - columns[3]["fnRender"] = getTimeText; - columns[4]["fnRender"] = changeTimePrecisionInit; - - $('#demo').html( '
' ); - $('#nowplayingtable').dataTable( { - "bSort" : false, - "bJQueryUI": true, - "bFilter": false, - "bInfo": false, - "bLengthChange": false, - "bPaginate": false, - "aoColumns": columns, - "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - if (aData[aData.length-2] == "t") - $(nRow).attr("class", "playing-list"); - if (aData[0] == "c") - $(nRow).attr("class", "playing-song"); - else if (aData[0] == "b") - $(nRow).attr("class", "gap"); - return nRow; - }, - "bAutoWidth":false - } ); - - -} +var columns = [{"sTitle": "type", "bVisible":false}, + {"sTitle":"Date"}, + {"sTitle":"Start"}, + {"sTitle":"End"}, + {"sTitle":"Duration"}, + {"sTitle":"Song"}, + {"sTitle":"Artist"}, + {"sTitle":"Album"}, + {"sTitle":"Playlist"}, + {"sTitle":"Show"}, + {"sTitle":"bgcolor", "bVisible":false}, + {"sTitle":"group_id", "bVisible":false}]; function getDateString(){ var date0 = $("#datepicker").datepicker("getDate"); @@ -106,11 +75,14 @@ function getAJAXURL(){ function updateDataTable(){ var table = $('#nowplayingtable').dataTable(); - - table.fnClearTable(false); - table.fnAddData(datagridData.rows, false); - table.fnDraw(true); - + + //Check if datagridData has been initialized since this update + //function can be called before ajax call has been returned. + if (datagridData != null){ + table.fnClearTable(false); + table.fnAddData(datagridData.rows, false); + table.fnDraw(true); + } } function getData(){ @@ -136,6 +108,34 @@ function redirect(url){ document.location.href = url; } +function createDataGrid(){ + + columns[1]["fnRender"] = getDateText; + columns[2]["fnRender"] = getTimeText; + columns[3]["fnRender"] = getTimeText; + columns[4]["fnRender"] = changeTimePrecisionInit; + + $('#nowplayingtable').dataTable( { + "bSort" : false, + "bJQueryUI": true, + "bFilter": false, + "bInfo": false, + "bLengthChange": false, + "bPaginate": false, + "aoColumns": columns, + "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { + if (aData[aData.length-2] == "t") + $(nRow).attr("class", "playing-list"); + if (aData[0] == "c") + $(nRow).attr("class", "playing-song"); + else if (aData[0] == "b") + $(nRow).attr("class", "gap"); + return nRow; + }, + "bAutoWidth":false + } ); +} + $(document).ready(function() { createDataGrid(); From 4fd57cbf0306a40d19d08b3030acaba2f0b178ae Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Sun, 13 Feb 2011 18:19:48 +0100 Subject: [PATCH 11/23] Updated 3rd party license info. --- LICENSE_3RD_PARTY | 44 ++++++----- library/phing/LICENSE | 165 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+), 17 deletions(-) create mode 100644 library/phing/LICENSE diff --git a/LICENSE_3RD_PARTY b/LICENSE_3RD_PARTY index 364ed8fc9..d5a77567f 100644 --- a/LICENSE_3RD_PARTY +++ b/LICENSE_3RD_PARTY @@ -1,27 +1,37 @@ This application uses the following 3rd Party software: - * Zend Framework (New BSD license, compatible with GPL) - * Liquidsoap (GPLv2, we only call this as an executable) - * PEAR (Ok to ship with GPLed code, see: http://pear.php.net/manual/en/faq.devs.php, see note [1]) - * poc-streamer (mp3cut) - * PHP + * Zend Framework + - License: New BSD license + - Does this link with our code? Yes + - Compatible with GPLv3: Yes -[1] PEAR Note (from http://pear.php.net/manual/en/faq.devs.php): -""" -From time to time people raise concerns of using PEAR packages licensed under the PHP license in GPL'ed code. In a discussion about this topic, the creator of PHP, Rasmus Lerdorf, issued the following statement: + * Liquidsoap + - License: GPLv2 + - Does this link with our code? No, we only call this as an executable - It all comes down to semantics of what linking means. The PHP license is pretty much identical to the Apache license and you could indeed make a case for not allowing any GPL'ed software to be "linked to" from Apache either. + * PEAR + - Notes: We only use the PEAR base class PEAR_Error, in the "PEAR" PEAR library. + - License: New BSD License + - Does this link with our code? Yes + - Compatible with GPLv3? Yes. - See http://www.apache.org/licenses/LICENSE-1.1. + * GetID3 + - License: GPLv2 + - Does this link with our code? Yes + - Compatible with GPLv3? Yes - The PHP license was chosen to match the Apache license because Apache and PHP are tied so closely to each other. + * mp3cut from the package poc-streamer + - Does this link with our code? No, it is an externally called executable file. - This hair splitting over linking, derivation and aggregation has been going on since the beginning of time. My stance is that you can indeed ship PHP licensed PEAR components on the same cd or in the same tarball as GPL'ed code because I see it as an aggregate work. This changes if you take PEAR code, modify it and copy-paste it directly into your own work. Then it moves from aggregate to derived. But the intent of the PEAR components is to be used in aggregate form. The PHP license allows you to use it in derived form as well, of course, but then you should be choosing a license other than the GPL for the derived work. + * PHP + - Does this link with our code? No, it is the interpreter. - The FSF has a FAQ on aggregation here: http://www.fsf.org/licensing/licenses/gpl-faq.html#MereAggregation + * Propel ORM + - License: MIT/Expat License + - Does this link with our code? Yes + - Compatible with the GPL: Yes. See http://www.gnu.org/licenses/license-list.html - That text is heavily biased towards compiled software and they talk about executables and memory spaces which don't really apply in this case. If you don't consider using a PEAR component as aggregation then it logically follows that you also cannot have Apache call your code so you will have to stipulate that nobody can use your code from Apache. I think this is an extreme interpretation that pretty much nobody out there shares. - - In short, I don't see an issue here. Move along. -""" + * Phing + - Note: Only used for development, not needed to run Airtime. + - License: LGPLv3 diff --git a/library/phing/LICENSE b/library/phing/LICENSE new file mode 100644 index 000000000..fc8a5de7e --- /dev/null +++ b/library/phing/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. From a5fd68c25273e9005bbf5a31aaf7f0081842e99f Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 13:29:16 -0500 Subject: [PATCH 12/23] -fixed UI freeze on some very special occasions -fixed some php errors related to php shipped with debian -playlist.js no longer active on login page --- application/layouts/scripts/layout.phtml | 2 +- application/layouts/scripts/library.phtml | 2 +- application/layouts/scripts/search.phtml | 2 +- application/models/Schedule.php | 4 +- application/models/Shows.php | 2 +- public/js/playlist/playlist.js | 51 ++++++++++++----------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/application/layouts/scripts/layout.phtml b/application/layouts/scripts/layout.phtml index d08fb0020..162b5ed1a 100644 --- a/application/layouts/scripts/layout.phtml +++ b/application/layouts/scripts/layout.phtml @@ -11,7 +11,7 @@
- partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?> + partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/application/layouts/scripts/library.phtml b/application/layouts/scripts/library.phtml index 9af9fdc21..b5dd4d6da 100644 --- a/application/layouts/scripts/library.phtml +++ b/application/layouts/scripts/library.phtml @@ -11,7 +11,7 @@
- partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?> + partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?> navigation()->menu()->setPartial($partial); ?> diff --git a/application/layouts/scripts/search.phtml b/application/layouts/scripts/search.phtml index 8704c615a..9dab1be78 100644 --- a/application/layouts/scripts/search.phtml +++ b/application/layouts/scripts/search.phtml @@ -8,7 +8,7 @@ headLink() ?> -
partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
+
partial('partialviews/header.phtml', array("user" => $this->loggedInAs())) ?>
diff --git a/application/models/Schedule.php b/application/models/Schedule.php index d1f9830be..21bfda6d9 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -482,10 +482,10 @@ class Schedule { ." ORDER BY st.starts DESC" ." LIMIT $count"; } else if ($timePeriod == 0){ - $sql .= " AND st.starts < TIMESTAMP '$timeNow'" + $sql .= " AND st.starts <= TIMESTAMP '$timeNow'" ." AND st.ends > TIMESTAMP '$timeNow'"; } else if ($timePeriod > 0){ - $sql .= " AND st.starts > TIMESTAMP '$timeNow'" + $sql .= " AND st.starts >= TIMESTAMP '$timeNow'" ." AND st.starts < (TIMESTAMP '$timeNow' + INTERVAL '$interval')" ." ORDER BY st.starts" ." LIMIT $count"; diff --git a/application/models/Shows.php b/application/models/Shows.php index 41ea62c43..27ab6b101 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -749,7 +749,7 @@ class Show_DAL{ $sql = "SELECT *, si.starts as start_timestamp, si.ends as end_timestamp FROM " ." $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s" ." WHERE si.show_id = s.id" - ." AND si.starts > TIMESTAMP '$timeNow'" + ." AND si.starts >= TIMESTAMP '$timeNow'" ." AND si.starts < TIMESTAMP '$timeNow' + INTERVAL '48 hours'" ." ORDER BY si.starts" ." LIMIT 1"; diff --git a/public/js/playlist/playlist.js b/public/js/playlist/playlist.js index b48f25a65..697707bd5 100644 --- a/public/js/playlist/playlist.js +++ b/public/js/playlist/playlist.js @@ -33,7 +33,7 @@ function registerSongEndListener(func){ function notifySongEndListener(){ if (typeof songEndFunc == "function"){ - //create a slight pause in execution to allow the browser + //create a slight delay in execution to allow the browser //to update the display. setTimeout(songEndFunc, 50); } @@ -57,6 +57,7 @@ function secondsTimer(){ var date = new Date(); estimatedSchedulePosixTime = date.getTime() - localRemoteTimeOffset; updateProgressBarValue(); + updatePlaybar(); } setTimeout(secondsTimer, uiUpdateInterval); } @@ -64,7 +65,6 @@ function secondsTimer(){ function newSongStart(){ nextSongPrepare = true; currentSong[0] = nextSongs.shift(); - updatePlaybar(); notifySongEndListener(); } @@ -72,7 +72,6 @@ function newSongStart(){ function nextShowStart(){ nextShowPrepare = true; currentShow[0] = nextShow.shift(); - updatePlaybar(); } /* Called every "uiUpdateInterval" mseconds. */ @@ -129,8 +128,6 @@ function updateProgressBarValue(){ setTimeout(nextShowStart, diff); } } - - updatePlaybar(); } function updatePlaybar(){ @@ -230,7 +227,7 @@ function parseItems(obj){ function getScheduleFromServer(){ $.ajax({ url: "/Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ parseItems(data.entries); - }}); + }, error:function(jqXHR, textStatus, errorThrown){}}); setTimeout(getScheduleFromServer, serverUpdateInterval); } @@ -241,27 +238,31 @@ function init() { //begin consumer "thread" secondsTimer(); - - $('#about-link').qtip({ - content: $('#about-txt').html(), - show: 'mouseover', - hide: { when: 'mouseout', fixed: true }, - position: { - corner: { - target: 'center', - tooltip: 'topRight' - } - }, - style: { - border: { - width: 0, - radius: 4 + + var qtipElem = $('#about-link'); + + if (qtipElem.length > 0) + qtipElem.qtip({ + content: $('#about-txt').html(), + show: 'mouseover', + hide: { when: 'mouseout', fixed: true }, + position: { + corner: { + target: 'center', + tooltip: 'topRight' + } }, - name: 'light', // Use the default light style - } - }); + style: { + border: { + width: 0, + radius: 4 + }, + name: 'light', // Use the default light style + } + }); } $(document).ready(function() { - init(); + if ($('#master-panel').length > 0) + init(); }); From 1d30c208f85c6292cdf2fc237e10a5c886558866 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 14:04:38 -0500 Subject: [PATCH 13/23] -fixed regression in day-view --- application/models/Schedule.php | 18 +++++++++++------- .../views/scripts/nowplaying/day-view.phtml | 2 +- .../views/scripts/nowplaying/index.phtml | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/application/models/Schedule.php b/application/models/Schedule.php index 21bfda6d9..018c52504 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -467,8 +467,12 @@ class Schedule { * want to search the database. For example "5 days", "18 hours", "60 minutes", * "30 seconds" etc. */ - public static function Get_Scheduled_Item_Data($timeNow, $timePeriod=0, $count = 0, $interval="0 hours"){ + public static function Get_Scheduled_Item_Data($timeStamp, $timePeriod=0, $count = 0, $interval="0 hours"){ global $CC_CONFIG, $CC_DBC; + + $date = new Application_Model_DateHelper; + $timeNow = $date->getDate(); + $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, (si.starts <= TIMESTAMP '$timeNow' AND si.ends > TIMESTAMP '$timeNow') as current_show" ." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show" ." WHERE st.playlist_id = pt.id" @@ -477,16 +481,16 @@ class Schedule { ." AND si.show_id = show.id"; if ($timePeriod < 0){ - $sql .= " AND st.ends < TIMESTAMP '$timeNow'" - ." AND st.ends > (TIMESTAMP '$timeNow' - INTERVAL '$interval')" + $sql .= " AND st.ends < TIMESTAMP '$timeStamp'" + ." AND st.ends > (TIMESTAMP '$timeStamp' - INTERVAL '$interval')" ." ORDER BY st.starts DESC" ." LIMIT $count"; } else if ($timePeriod == 0){ - $sql .= " AND st.starts <= TIMESTAMP '$timeNow'" - ." AND st.ends > TIMESTAMP '$timeNow'"; + $sql .= " AND st.starts <= TIMESTAMP '$timeStamp'" + ." AND st.ends > TIMESTAMP '$timeStamp'"; } else if ($timePeriod > 0){ - $sql .= " AND st.starts >= TIMESTAMP '$timeNow'" - ." AND st.starts < (TIMESTAMP '$timeNow' + INTERVAL '$interval')" + $sql .= " AND st.starts >= TIMESTAMP '$timeStamp'" + ." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')" ." ORDER BY st.starts" ." LIMIT $count"; } diff --git a/application/views/scripts/nowplaying/day-view.phtml b/application/views/scripts/nowplaying/day-view.phtml index bcf641005..2bfb5a932 100644 --- a/application/views/scripts/nowplaying/day-view.phtml +++ b/application/views/scripts/nowplaying/day-view.phtml @@ -1,4 +1,4 @@ -
+
diff --git a/application/views/scripts/nowplaying/index.phtml b/application/views/scripts/nowplaying/index.phtml index e8b101dc0..b36a6f1de 100644 --- a/application/views/scripts/nowplaying/index.phtml +++ b/application/views/scripts/nowplaying/index.phtml @@ -2,4 +2,3 @@ Now ViewDay View
- From bb82dc2f4a7740b53d3c8d981132f4afedabb3e1 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 14:09:47 -0500 Subject: [PATCH 14/23] -alternating colors for blue datatable rows --- public/js/playlist/nowplayingdatagrid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/playlist/nowplayingdatagrid.js b/public/js/playlist/nowplayingdatagrid.js index def9dd460..f5863ad1e 100644 --- a/public/js/playlist/nowplayingdatagrid.js +++ b/public/js/playlist/nowplayingdatagrid.js @@ -125,7 +125,7 @@ function createDataGrid(){ "aoColumns": columns, "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { if (aData[aData.length-2] == "t") - $(nRow).attr("class", "playing-list"); + $(nRow).addClass("playing-list"); if (aData[0] == "c") $(nRow).attr("class", "playing-song"); else if (aData[0] == "b") From 416c6ceb1099b189c1e5de361a910a995532846e Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 15:35:41 -0500 Subject: [PATCH 15/23] -fixed bug where a song would appear as current song and next song simultaneously. -show background color switching on the list-view should now be instant. --- application/models/Nowplaying.php | 16 ++++++++++------ application/models/Schedule.php | 11 ++++------- application/models/Shows.php | 2 +- public/js/playlist/nowplayingdatagrid.js | 19 ++++++++++--------- public/js/playlist/playlist.js | 21 ++++----------------- 5 files changed, 29 insertions(+), 40 deletions(-) diff --git a/application/models/Nowplaying.php b/application/models/Nowplaying.php index 966470528..43d6bdc4b 100644 --- a/application/models/Nowplaying.php +++ b/application/models/Nowplaying.php @@ -75,23 +75,27 @@ class Application_Model_Nowplaying foreach ($previous as $item){ array_push($rows, array("p", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"], - $item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"])); + $item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"])); } foreach ($current as $item){ array_push($rows, array("c", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"], - $item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"])); + $item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"])); } foreach ($next as $item){ array_push($rows, array("n", $item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"], - $item["album_title"], $item["name"], $item["show_name"], $item["current_show"], $item["group_id"])); + $item["album_title"], $item["name"], $item["show_name"], $item["instance_id"], $item["group_id"])); } - + + $rows = Application_Model_Nowplaying::FindGaps($rows); - $data = array("rows"=>$rows); + + $date = new Application_Model_DateHelper; + $timeNow = $date->getDate(); + + $data = array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$rows); return $data; } } - diff --git a/application/models/Schedule.php b/application/models/Schedule.php index 018c52504..87ff2193b 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -469,11 +469,8 @@ class Schedule { */ public static function Get_Scheduled_Item_Data($timeStamp, $timePeriod=0, $count = 0, $interval="0 hours"){ global $CC_CONFIG, $CC_DBC; - - $date = new Application_Model_DateHelper; - $timeNow = $date->getDate(); - - $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, (si.starts <= TIMESTAMP '$timeNow' AND si.ends > TIMESTAMP '$timeNow') as current_show" + + $sql = "SELECT DISTINCT pt.name, ft.track_title, ft.artist_name, ft.album_title, st.starts, st.ends, st.clip_length, st.group_id, show.name as show_name, st.instance_id" ." FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt, $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] show" ." WHERE st.playlist_id = pt.id" ." AND st.file_id = ft.id" @@ -487,9 +484,9 @@ class Schedule { ." LIMIT $count"; } else if ($timePeriod == 0){ $sql .= " AND st.starts <= TIMESTAMP '$timeStamp'" - ." AND st.ends > TIMESTAMP '$timeStamp'"; + ." AND st.ends >= TIMESTAMP '$timeStamp'"; } else if ($timePeriod > 0){ - $sql .= " AND st.starts >= TIMESTAMP '$timeStamp'" + $sql .= " AND st.starts > TIMESTAMP '$timeStamp'" ." AND st.starts < (TIMESTAMP '$timeStamp' + INTERVAL '$interval')" ." ORDER BY st.starts" ." LIMIT $count"; diff --git a/application/models/Shows.php b/application/models/Shows.php index 27ab6b101..c6902fa80 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -733,7 +733,7 @@ class Show_DAL{ $date = $timestamp[0]; $time = $timestamp[1]; - $sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id" + $sql = "SELECT si.starts as start_timestamp, si.ends as end_timestamp, s.name, s.id, si.id as instance_id" ." FROM $CC_CONFIG[showInstances] si, $CC_CONFIG[showTable] s" ." WHERE si.show_id = s.id" ." AND si.starts <= TIMESTAMP '$timeNow'" diff --git a/public/js/playlist/nowplayingdatagrid.js b/public/js/playlist/nowplayingdatagrid.js index f5863ad1e..98cd108bb 100644 --- a/public/js/playlist/nowplayingdatagrid.js +++ b/public/js/playlist/nowplayingdatagrid.js @@ -1,5 +1,5 @@ -var registered = false; var datagridData = null; +var currentShowInstanceID = -1; function getDateText(obj){ var str = obj.aData[ obj.iDataColumn ].toString(); @@ -32,7 +32,7 @@ function changeTimePrecision(str){ return str; } -function notifySongEnd(){ +function notifySongStart(){ for (var i=0; i 0) + currentShowInstanceID = datagridData.currentShow[0].instance_id; updateDataTable(); }}); } @@ -95,13 +102,7 @@ function getData(){ function init2(){ getData(); - if (typeof registerSongEndListener == 'function' && !registered){ - registered = true; - registerSongEndListener(notifySongEnd); - } - setTimeout(init2, 5000); - } function redirect(url){ @@ -124,7 +125,7 @@ function createDataGrid(){ "bPaginate": false, "aoColumns": columns, "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - if (aData[aData.length-2] == "t") + if (aData[aData.length-2] == currentShowInstanceID) $(nRow).addClass("playing-list"); if (aData[0] == "c") $(nRow).attr("class", "playing-song"); diff --git a/public/js/playlist/playlist.js b/public/js/playlist/playlist.js index 697707bd5..17e48082f 100644 --- a/public/js/playlist/playlist.js +++ b/public/js/playlist/playlist.js @@ -13,8 +13,6 @@ var currentElem; var serverUpdateInterval = 5000; var uiUpdateInterval = 200; -var songEndFunc; - //set to "development" if we are developing :). Useful to disable alerts //when entering production mode. var APPLICATION_ENV = ""; @@ -25,20 +23,6 @@ var APPLICATION_ENV = ""; var nextSongPrepare = true; var nextShowPrepare = true; -/* Another script can register its function here - * when it wishes to know when a song ends. */ -function registerSongEndListener(func){ - songEndFunc = func; -} - -function notifySongEndListener(){ - if (typeof songEndFunc == "function"){ - //create a slight delay in execution to allow the browser - //to update the display. - setTimeout(songEndFunc, 50); - } -} - function getTrackInfo(song){ var str = ""; @@ -66,12 +50,15 @@ function newSongStart(){ nextSongPrepare = true; currentSong[0] = nextSongs.shift(); - notifySongEndListener(); + notifySongStart(); } function nextShowStart(){ nextShowPrepare = true; currentShow[0] = nextShow.shift(); + + //call function in nowplayingdatagrid.js + notifyShowStart(currentShow[0]); } /* Called every "uiUpdateInterval" mseconds. */ From 8c3bd5dc6ee9d1d4c8f589d2f6695106420bc815 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 16:42:10 -0500 Subject: [PATCH 16/23] -re-ordered menu for more logical workflow --- application/configs/navigation.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/configs/navigation.php b/application/configs/navigation.php index 9ee1cf342..85a8b0edb 100644 --- a/application/configs/navigation.php +++ b/application/configs/navigation.php @@ -16,11 +16,11 @@ $pages = array( 'resource' => 'nowplaying' ), array( - 'label' => 'Schedule', - 'module' => 'default', - 'controller' => 'Schedule', - 'action' => 'index', - 'resource' => 'schedule' + 'label' => 'Add Audio', + 'module' => 'default', + 'controller' => 'Plupload', + 'action' => 'plupload', + 'resource' => 'plupload' ), array( 'label' => 'Playlist Builder', @@ -30,11 +30,11 @@ $pages = array( 'resource' => 'library' ), array( - 'label' => 'Add Audio', - 'module' => 'default', - 'controller' => 'Plupload', - 'action' => 'plupload', - 'resource' => 'plupload' + 'label' => 'Schedule', + 'module' => 'default', + 'controller' => 'Schedule', + 'action' => 'index', + 'resource' => 'schedule' ), array( 'label' => 'Configure', From b92f5a796fe9cd9852026ef5e7f41c493857806e Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 16:51:03 -0500 Subject: [PATCH 17/23] -added Panic album From 862649955450014406e7d078b1ab4fdadbf5dbbf Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 17:42:15 -0500 Subject: [PATCH 18/23] -updated help page. --- application/views/scripts/dashboard/help.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/scripts/dashboard/help.phtml b/application/views/scripts/dashboard/help.phtml index 8483a9580..1a557eb66 100644 --- a/application/views/scripts/dashboard/help.phtml +++ b/application/views/scripts/dashboard/help.phtml @@ -5,8 +5,8 @@
  1. Add your files to the library using the "Add Audio" button. You can drag and drop your files to this window too.
  2. -
  3. Create a show by going to "Schedule" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins can add shows.
  4. Create a playlist in the Playlist Builder menu using your audio files.
  5. +
  6. Create a show by going to "Schedule" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins can add shows.
  7. Add the playlist to the show by going to your show in the Schedule calendar, right-clicking on it and selecting "Schedule."
  8. Select your playlist and drag and drop it to the "Items in this show" area.
From dcc3d5764733c7a8b7ce97f29ced7cbaf075eae8 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 13 Feb 2011 17:51:28 -0500 Subject: [PATCH 19/23] -removed tags in favour of tags --- application/configs/navigation.php | 2 +- application/views/scripts/nowplaying/day-view.phtml | 2 +- application/views/scripts/nowplaying/index.phtml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/configs/navigation.php b/application/configs/navigation.php index 85a8b0edb..dd291188c 100644 --- a/application/configs/navigation.php +++ b/application/configs/navigation.php @@ -38,7 +38,7 @@ $pages = array( ), array( 'label' => 'Configure', - 'uri' => 'javascript:void(null)', + 'uri' => '#', 'resource' => 'preference', 'pages' => array( array( diff --git a/application/views/scripts/nowplaying/day-view.phtml b/application/views/scripts/nowplaying/day-view.phtml index 2bfb5a932..6b5c6de87 100644 --- a/application/views/scripts/nowplaying/day-view.phtml +++ b/application/views/scripts/nowplaying/day-view.phtml @@ -1,4 +1,4 @@
- Now ViewDay View + Now ViewDay View
diff --git a/application/views/scripts/nowplaying/index.phtml b/application/views/scripts/nowplaying/index.phtml index b36a6f1de..2497ec56d 100644 --- a/application/views/scripts/nowplaying/index.phtml +++ b/application/views/scripts/nowplaying/index.phtml @@ -1,4 +1,4 @@
- Now ViewDay View + Now ViewDay View
From 6c273739b4406f75722019e1ac651b8997094276 Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Mon, 14 Feb 2011 13:05:22 +0100 Subject: [PATCH 20/23] CC-1930 Improve user interface design and wording for show/playlist workflow --- application/configs/navigation.php | 2 +- application/controllers/ScheduleController.php | 8 ++++---- application/views/scripts/dashboard/help.phtml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/configs/navigation.php b/application/configs/navigation.php index 9ee1cf342..8335a362e 100644 --- a/application/configs/navigation.php +++ b/application/configs/navigation.php @@ -16,7 +16,7 @@ $pages = array( 'resource' => 'nowplaying' ), array( - 'label' => 'Schedule', + 'label' => 'Calendar', 'module' => 'default', 'controller' => 'Schedule', 'action' => 'index', diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index f6bf30231..42e71fb82 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -150,20 +150,20 @@ class ScheduleController extends Zend_Controller_Action if($user->isAdmin()) { - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete'); + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance'); - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Cancel Show'); + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance and All Following'); } if($user->isHost($show->getShowId()) || $user->isAdmin()) { $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Clear'); - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Schedule'); + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Add Content'); } } $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'), - 'title' => 'Show Contents'); + 'title' => 'Show Content'); //returns format jjmenu is looking for. die(json_encode($menu)); diff --git a/application/views/scripts/dashboard/help.phtml b/application/views/scripts/dashboard/help.phtml index 8483a9580..706ce8f06 100644 --- a/application/views/scripts/dashboard/help.phtml +++ b/application/views/scripts/dashboard/help.phtml @@ -5,9 +5,9 @@
  1. Add your files to the library using the "Add Audio" button. You can drag and drop your files to this window too.
  2. -
  3. Create a show by going to "Schedule" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins can add shows.
  4. +
  5. 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 can add shows.
  6. Create a playlist in the Playlist Builder menu using your audio files.
  7. -
  8. Add the playlist to the show by going to your show in the Schedule calendar, right-clicking on it and selecting "Schedule."
  9. +
  10. Add the playlist to the show by going to your show in the Schedule calendar, right-clicking on it and selecting "Add Content."
  11. Select your playlist and drag and drop it to the "Items in this show" area.

Then you're good to go!
From 2fbabd82eb69e04ab6704ba34d3e0c66db8f046b Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Mon, 14 Feb 2011 13:30:52 +0100 Subject: [PATCH 21/23] CC-1930 Improve right-click menu on the schedule so the most common actions are first --- .../controllers/ScheduleController.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 42e71fb82..2a071ec78 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -146,24 +146,23 @@ class ScheduleController extends Zend_Controller_Action $params = '/format/json/id/#id#'; - if(strtotime($today_timestamp) < strtotime($show->getShowStart())) { - - if($user->isAdmin()) { - + if (strtotime($today_timestamp) < strtotime($show->getShowStart())) { + if ($user->isHost($show->getShowId()) || $user->isAdmin()) { + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Add Content'); + } + } + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'), + 'title' => 'Show Content'); + if (strtotime($today_timestamp) < strtotime($show->getShowStart())) { + if ($user->isAdmin()) { $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance'); - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/cancel-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance and All Following'); } - if($user->isHost($show->getShowId()) || $user->isAdmin()) { - - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Clear'); - - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'), 'title' => 'Add Content'); + if ($user->isHost($show->getShowId()) || $user->isAdmin()) { + $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Remove All Content'); } } - $menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'), - 'title' => 'Show Content'); //returns format jjmenu is looking for. die(json_encode($menu)); From 8ed594a9597b9dfe67f7019c0a4ee82d3cb9cc97 Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Mon, 14 Feb 2011 14:10:05 +0100 Subject: [PATCH 22/23] Rearranged sample audio in the Sourcefabric directory. From e3225edcf3b729ca7225db61b226881cf553074d Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 14 Feb 2011 09:01:33 -0500 Subject: [PATCH 23/23] -readded some audio samples