From 2e811dfef8c8948426f6c67ba4327eef0c483ffb Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Apr 2012 15:23:37 -0400 Subject: [PATCH 1/7] CC-3642: System->Streams->DJ URL changes are not reflected in Calendar ->LiveStream - fixed --- .../application/controllers/PreferenceController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index ef5c3b475..8a5f9e9db 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -213,6 +213,12 @@ class PreferenceController extends Zend_Controller_Action Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]); Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]); + $master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"]; + $live_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["dj_harbor_input_port"]."/".$values["dj_harbor_input_mount_point"]; + + Application_Model_Preference::SetMasterDJSourceConnectionURL($master_connection_url); + Application_Model_Preference::SetLiveDJSourceConnectionURL($live_connection_url); + // extra info that goes into cc_stream_setting Application_Model_StreamSetting::SetMasterLiveSteamPort($values["master_harbor_input_port"]); Application_Model_StreamSetting::SetMasterLiveSteamMountPoint($values["master_harbor_input_mount_point"]); From d11fca8ac8c2891cbee6ed7d6bb9f27ef871e5a3 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Apr 2012 16:48:04 -0400 Subject: [PATCH 2/7] CC-3444: Ability to edit currently playing show (end time and permissions - fixed --- .../controllers/ScheduleController.php | 18 ++++++++++++------ airtime_mvc/application/forms/AddShowWhen.php | 11 +++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index b0fd1f011..657fac245 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -89,12 +89,12 @@ class ScheduleController extends Zend_Controller_Action Application_Model_Schedule::createNewFormSections($this->view); - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){ + $user = Application_Model_User::GetCurrentUser(); + + if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))){ $this->view->preloadShowForm = true; } - + $this->view->headScript()->appendScript("var weekStart = ".Application_Model_Preference::GetWeekStartDay().";"); } @@ -586,7 +586,11 @@ class ScheduleController extends Zend_Controller_Action 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); if ($show->isStartDateTimeInPast()){ - $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + if(!$showInstance->getShow()->isRepeating()){ + $formWhen->disableStartDateAndTime(); + }else{ + $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true)); + } } //need to get the days of the week in the php timezone (for the front end). @@ -684,7 +688,7 @@ class ScheduleController extends Zend_Controller_Action $user = Application_Model_User::GetCurrentUser(); - if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){ + if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))){ Application_Model_Schedule::createNewFormSections($this->view); $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } @@ -765,7 +769,9 @@ class ScheduleController extends Zend_Controller_Action //array key does not exist. We need to repopulate this entry from the db. //The start date will be returned in UTC time, so lets convert it to local time. $dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDate()); + $startTime = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartTime()); $data['add_show_start_date'] = $dt->format("Y-m-d"); + $data['add_show_start_time'] = $startTime->format("H:i"); $validateStartDate = false; } diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index ed10c89a9..d62dff3c3 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -131,5 +131,16 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $element->setAttrib('disabled','disabled'); } } + + public function disableStartDateAndTime(){ + $elements = array($this->getElement('add_show_start_date'), $this->getElement('add_show_start_time')); + foreach ($elements as $element) + { + if ($element->getType() != 'Zend_Form_Element_Hidden') + { + $element->setAttrib('disabled','disabled'); + } + } + } } From 2f4861db26c900ab4266882fd9e30d57c51e3d32 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Apr 2012 17:06:06 -0400 Subject: [PATCH 3/7] CC-3444: Ability to edit currently playing show (end time and permissions) - added comment --- airtime_mvc/application/controllers/ScheduleController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 657fac245..1aa9de8d0 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -586,6 +586,8 @@ class ScheduleController extends Zend_Controller_Action 'add_show_repeats' => $show->isRepeating() ? 1 : 0)); if ($show->isStartDateTimeInPast()){ + // for a non-repeating show, we should never allow user to change the start time. + // for the repeating show, we should allow because the form works as repeating template form if(!$showInstance->getShow()->isRepeating()){ $formWhen->disableStartDateAndTime(); }else{ From 2fc591db2bddc4facaa8f7fb9535e767be970623 Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 16 Apr 2012 17:09:54 -0400 Subject: [PATCH 4/7] CC-3498: Calendar -> Show Content better representation of duration needed -fixed --- airtime_mvc/application/models/ShowInstance.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 7e21d1376..ea7ef121b 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -569,8 +569,10 @@ class Application_Model_ShowInstance { $time = $this->_showInstance->getDbTimeFilled(); if ($time != "00:00:00") { - $milliseconds = substr(round(substr($time, 8), 2), 1); - $time = substr($time, 0, 8) . $milliseconds; + $time_arr = explode(".", $time); + $time_arr[1] = "." . $time_arr[1]; + $milliseconds = number_format(round($time_arr[1], 2), 2); + $time = $time_arr[0] . substr($milliseconds, 1); } else { $time = "00:00:00.00"; } From c08800468f2af25e51076bd0b546b4cf57dff496 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Apr 2012 17:29:02 -0400 Subject: [PATCH 5/7] CC-3658: DJ assigned to the Show can't switch/kick streams - fixed --- airtime_mvc/application/controllers/DashboardController.php | 3 +-- airtime_mvc/application/logging/Logging.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php index 9a30348a2..ddef27cbe 100644 --- a/airtime_mvc/application/controllers/DashboardController.php +++ b/airtime_mvc/application/controllers/DashboardController.php @@ -50,10 +50,9 @@ class DashboardController extends Zend_Controller_Action $user = new Application_Model_User($userInfo->id); $show = Application_Model_Show::GetCurrentShow(); - $show_id = isset($show['id'])?$show['id']:0; + $show_id = isset($show[0]['id'])?$show[0]['id']:0; $source_connected = Application_Model_Preference::GetSourceStatus($sourcename); - if($user->canSchedule($show_id) && ($source_connected || $sourcename == 'scheduled_play')){ $change_status_to = "on"; diff --git a/airtime_mvc/application/logging/Logging.php b/airtime_mvc/application/logging/Logging.php index a98b932d7..5c25b831f 100644 --- a/airtime_mvc/application/logging/Logging.php +++ b/airtime_mvc/application/logging/Logging.php @@ -18,7 +18,7 @@ class Logging { } public static function toString($p_msg){ - if (is_array($p_msg)){ + if (is_array($p_msg) || is_object($p_msg)){ return print_r($p_msg, true); } else { return $p_msg; From e786514f270df129caec86648f6d1ba7c1bcf87f Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 16 Apr 2012 17:31:16 -0400 Subject: [PATCH 6/7] CC-3655: Context menu for current show missing add/remove content and remove all content options. -fixed --- airtime_mvc/application/controllers/ScheduleController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 1aa9de8d0..58938f654 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -227,7 +227,7 @@ class ScheduleController extends Zend_Controller_Action $showStartLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceStart()); $showEndLocalDT = Application_Common_DateHelper::ConvertToLocalDateTime($instance->getShowInstanceEnd()); - if ($epochNow < $showStartLocalDT->getTimestamp()) { + if ($epochNow < $showEndLocalDT->getTimestamp()) { if ( ($isAdminOrPM || $isDJ) && !$instance->isRecorded() From 1d91d1b11b8d4eeab6cc123c9d3d5078aba0ed69 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 16 Apr 2012 18:21:28 -0400 Subject: [PATCH 7/7] CC-3659: Override on Master/Show Source connection needs to have better description about what the override field actually does. - fixed description - extra fix: - using variable instead of hard coded text - removed unnecessary code --- .../controllers/PreferenceController.php | 2 +- .../forms/LiveStreamingPreferences.php | 23 ++++--------------- .../scripts/form/preferences_livestream.phtml | 17 +++++++++----- 3 files changed, 16 insertions(+), 26 deletions(-) diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 8a5f9e9db..00ecbfea3 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -238,9 +238,9 @@ class PreferenceController extends Zend_Controller_Action Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data); $this->view->statusMsg = "
Stream Setting Updated.
"; } - $live_stream_subform->updateConnectionURLs(); } + $live_stream_subform->updateVariables(); $this->view->confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings)."; $this->view->num_stream = $num_of_stream; diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index d97530c2a..7d22f6383 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -78,26 +78,9 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered')))) ->setDecorators(array('ViewHelper')); $this->addElement($live_dj_mount); - - $master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL(); - $live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL(); - - $master_dj_connection_url = ($master_dj_connection_url == "")?("http://".$_SERVER['SERVER_NAME'].":".$m_port."/".$m_mount):$master_dj_connection_url; - $live_dj_connection_url = ($live_dj_connection_url == "")?"http://".$_SERVER['SERVER_NAME'].":".$l_port."/".$l_mount:$live_dj_connection_url; - - if($m_port=="" || $m_mount==""){ - $master_dj_connection_url = "N/A"; - } - if($l_port=="" || $l_mount==""){ - $live_dj_connection_url = "N/A"; - } - - $this->setDecorators(array( - array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,)) - )); } - public function updateConnectionURLs(){ + public function updateVariables(){ $m_port = Application_Model_StreamSetting::GetMasterLiveSteamPort(); $m_mount = Application_Model_StreamSetting::GetMasterLiveSteamMountPoint(); $l_port = Application_Model_StreamSetting::GetDJLiveSteamPort(); @@ -116,8 +99,10 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $live_dj_connection_url = "N/A"; } + $overrideDescription = "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. For more detail, please read the Airtime manual."; + $this->setDecorators(array( - array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,)) + array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url,'overrideDescription' => $overrideDescription)) )); } diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index 37459635b..9e48cb6ff 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -77,11 +77,11 @@
master_dj_connection_url ?> override   - - - This is the URL used by remote sources to connect to Airtime. If Airtime is behind a router or firewall, you may need to configure port forwarding. For details, please read the Airtime manual. - -
+ + + overrideDescription ?> + +
@@ -117,7 +117,12 @@
- live_dj_connection_url ?> override + live_dj_connection_url ?> override   + + + overrideDescription?> + +