diff --git a/LICENSE_3RD_PARTY b/LICENSE_3RD_PARTY index f935ac900..fff6fc84d 100644 --- a/LICENSE_3RD_PARTY +++ b/LICENSE_3RD_PARTY @@ -111,10 +111,6 @@ Non-linked code: * Server Browse - Web site: http://code.google.com/p/jq-serverbrowse/ - License: BSD 2-Clause - - * meioMask - - Web site: http://www.meiocodigo.com/ - - License: MIT ------------- Media-Monitor diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 953c53e7b..514fcf6d5 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -58,7 +58,8 @@ class ApiController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(true); $api_key = $this->_getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -333,7 +334,8 @@ class ApiController extends Zend_Controller_Action $api_key = $this->_getParam('api_key'); - if(!in_array($api_key, $CC_CONFIG["apiKey"])) + if(!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource. '; @@ -355,7 +357,8 @@ class ApiController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(true); $api_key = $this->_getParam('api_key'); - if(!in_array($api_key, $CC_CONFIG["apiKey"])) + if(!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -378,7 +381,8 @@ class ApiController extends Zend_Controller_Action global $CC_CONFIG; $api_key = $this->_getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -411,7 +415,8 @@ class ApiController extends Zend_Controller_Action global $CC_CONFIG; $api_key = $this->_getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -435,7 +440,8 @@ class ApiController extends Zend_Controller_Action global $CC_CONFIG; $api_key = $this->_getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -542,7 +548,8 @@ class ApiController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(true); $api_key = $this->_getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -564,7 +571,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -667,7 +675,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -683,7 +692,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -711,7 +721,8 @@ class ApiController extends Zend_Controller_Action $api_key = $request->getParam('api_key'); $path = base64_decode($request->getParam('path')); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -728,7 +739,8 @@ class ApiController extends Zend_Controller_Action $api_key = $request->getParam('api_key'); $path = base64_decode($request->getParam('path')); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -745,7 +757,8 @@ class ApiController extends Zend_Controller_Action $api_key = $request->getParam('api_key'); $path = base64_decode($request->getParam('path')); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -760,7 +773,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -777,14 +791,13 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); $getDiskInfo = $request->getParam('diskinfo') == "true"; - /* - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; exit; } - */ $status = array( "platform"=>Application_Model_Systemstatus::GetPlatformInfo(), @@ -846,7 +859,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -926,7 +940,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -945,7 +960,8 @@ class ApiController extends Zend_Controller_Action $request = $this->getRequest(); $api_key = $request->getParam('api_key'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; @@ -979,7 +995,8 @@ class ApiController extends Zend_Controller_Action $password = $request->getParam('password'); $djtype = $request->getParam('djtype'); - if (!in_array($api_key, $CC_CONFIG["apiKey"])) + if (!in_array($api_key, $CC_CONFIG["apiKey"]) && + is_null(Zend_Auth::getInstance()->getStorage()->read())) { header('HTTP/1.0 401 Unauthorized'); print 'You are not allowed to access this resource.'; diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index 06b9486e3..ef5c3b475 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -142,7 +142,6 @@ class PreferenceController extends Zend_Controller_Action $baseUrl = $request->getBaseUrl(); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); // get current settings $temp = Application_Model_StreamSetting::getStreamSetting(); @@ -236,7 +235,7 @@ class PreferenceController extends Zend_Controller_Action $live_stream_subform->updateConnectionURLs(); } - $this->view->confirm_pypo_restart_text = "Updating settings will temporarily interrupt any currently playing shows. Click \'OK\' to continue."; + $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; $this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf(); @@ -261,16 +260,18 @@ class PreferenceController extends Zend_Controller_Action else { $path = $path.'/'; - $handle = opendir($path); - while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != "..") { - //only show directories that aren't private. - if (is_dir($path.$file) && substr($file, 0, 1) != ".") { - $element = array(); - $element["name"] = $file; - $element["isFolder"] = true; - $element["isError"] = false; - $result[$file] = $element; + $handle = opendir($path); + if ($handle !== false){ + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + //only show directories that aren't private. + if (is_dir($path.$file) && substr($file, 0, 1) != ".") { + $element = array(); + $element["name"] = $file; + $element["isFolder"] = true; + $element["isError"] = false; + $result[$file] = $element; + } } } } diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index ac023a68c..fad59eb3b 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -28,6 +28,8 @@ class ScheduleController extends Zend_Controller_Action ->addActionContext('content-context-menu', 'json') ->addActionContext('set-time-scale', 'json') ->addActionContext('set-time-interval', 'json') + ->addActionContext('edit-show-instance', 'json') + ->addActionContext('dj-edit-show', 'json') ->initContext(); $this->sched_sess = new Zend_Session_Namespace("schedule"); @@ -52,7 +54,6 @@ class ScheduleController extends Zend_Controller_Action $this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/add-show.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/schedule/schedule.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - $this->view->headScript()->appendFile($baseUrl.'/js/meioMask/jquery.meio.mask.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']); @@ -88,6 +89,9 @@ class ScheduleController extends Zend_Controller_Action $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new Application_Model_User($userInfo->id); + if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){ + $this->view->preloadShowForm = true; + } $this->view->headScript()->appendScript("var weekStart = ".Application_Model_Preference::GetWeekStartDay().";"); } @@ -429,6 +433,7 @@ class ScheduleController extends Zend_Controller_Action $this->view->percentFilled = $show->getPercentScheduled(); $this->view->showContent = $show->getShowListContent(); $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); + $this->view->showTitle = $show->getName(); unset($this->view->showContent); } @@ -444,6 +449,10 @@ class ScheduleController extends Zend_Controller_Action // repeating shows. It's value is either "instance","rebroadcast", or "all" $type = $this->_getParam('type'); + if ($type == "instance"){ + $this->view->action = "edit-show-instance"; + } + try{ $showInstance = new Application_Model_ShowInstance($showInstanceId); }catch(Exception $e){ @@ -457,6 +466,10 @@ class ScheduleController extends Zend_Controller_Action if(!($isAdminOrPM || $isDJ)) { return; } + + if($isDJ){ + $this->view->action = "dj-edit-show"; + } $formWhat = new Application_Form_AddShowWhat(); $formWho = new Application_Form_AddShowWho(); @@ -604,10 +617,50 @@ class ScheduleController extends Zend_Controller_Action } public function getFormAction(){ - Application_Model_Schedule::createNewFormSections($this->view); - $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){ + Application_Model_Schedule::createNewFormSections($this->view); + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); + } } + + public function editShowInstanceAction(){ + $js = $this->_getParam('data'); + $data = array(); + //need to convert from serialized jQuery array. + foreach($js as $j){ + $data[$j["name"]] = $j["value"]; + } + + + } + + public function djEditShowAction(){ + $js = $this->_getParam('data'); + $data = array(); + + //need to convert from serialized jQuery array. + foreach($js as $j){ + $data[$j["name"]] = $j["value"]; + } + + //update cc_show + $show = new Application_Model_Show($data["add_show_id"]); + $show->setAirtimeAuthFlag($data["cb_airtime_auth"]); + $show->setCustomAuthFlag($data["cb_custom_auth"]); + $show->setCustomUsername($data["custom_username"]); + $show->setCustomPassword($data["custom_password"]); + + $this->view->edit = true; + } + + //for 2.2 + /* + public function editShowAction(){ + + } + */ + public function addShowAction() { $js = $this->_getParam('data'); @@ -619,13 +672,6 @@ class ScheduleController extends Zend_Controller_Action } $show = new Application_Model_Show($data['add_show_id']); - - $userInfo = Zend_Auth::getInstance()->getStorage()->read(); - $user = new Application_Model_User($userInfo->id); - - $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); - $isDJ = $user->isHost($show->getId()); - $startDateModified = true; if ($data['add_show_id'] != -1 && !array_key_exists('add_show_start_date', $data)){ //show is being updated and changing the start date was disabled, since the @@ -642,6 +688,11 @@ class ScheduleController extends Zend_Controller_Action if($data['add_show_day_check'] == "") { $data['add_show_day_check'] = null; } + + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); + $user = new Application_Model_User($userInfo->id); + $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); + $isDJ = $user->isHost($show->getId()); $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; $record = false; @@ -785,7 +836,7 @@ class ScheduleController extends Zend_Controller_Action if (!$startDateModified){ $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true)); } - + $this->view->form = $this->view->render('schedule/add-show-form.phtml'); } diff --git a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php index 8e1601819..b936960fc 100644 --- a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php @@ -36,8 +36,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowLiveStream.php b/airtime_mvc/application/forms/AddShowLiveStream.php index e4b1b9d91..ad4c66c4d 100644 --- a/airtime_mvc/application/forms/AddShowLiveStream.php +++ b/airtime_mvc/application/forms/AddShowLiveStream.php @@ -8,7 +8,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm { $description1 = "This follows the same security pattern for the shows: if no users are explicitly set for the show, then anyone with a valid airtime login can connect to the stream, otherwise if there are users assigned to the show, then only those users can connect."; $cb_airtime_auth = new Zend_Form_Element_Checkbox("cb_airtime_auth"); - $cb_airtime_auth->setLabel("Connect using Airtime username & password") + $cb_airtime_auth->setLabel("Use Airtime Authentication") ->setDescription($description1) ->setRequired(false) ->setDecorators(array('ViewHelper')); @@ -16,7 +16,7 @@ class Application_Form_AddShowLiveStream extends Zend_Form_SubForm $description2 = "Specifiy custom athentification which will work for only the show."; $cb_custom_auth = new Zend_Form_Element_Checkbox("cb_custom_auth"); - $cb_custom_auth ->setLabel("Custom") + $cb_custom_auth ->setLabel("Use Custom Authentication") ->setDescription($description2) ->setRequired(false) ->setDecorators(array('ViewHelper')); diff --git a/airtime_mvc/application/forms/AddShowRR.php b/airtime_mvc/application/forms/AddShowRR.php index 4c6e5b4b2..9f3778df1 100644 --- a/airtime_mvc/application/forms/AddShowRR.php +++ b/airtime_mvc/application/forms/AddShowRR.php @@ -24,8 +24,7 @@ class Application_Form_AddShowRR extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowRebroadcastDates.php b/airtime_mvc/application/forms/AddShowRebroadcastDates.php index b4b352624..58afa7f0c 100644 --- a/airtime_mvc/application/forms/AddShowRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowRebroadcastDates.php @@ -41,8 +41,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowRepeats.php b/airtime_mvc/application/forms/AddShowRepeats.php index d92662e0c..2315147fb 100644 --- a/airtime_mvc/application/forms/AddShowRepeats.php +++ b/airtime_mvc/application/forms/AddShowRepeats.php @@ -62,8 +62,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowStyle.php b/airtime_mvc/application/forms/AddShowStyle.php index 1e9b968ce..4f43159e5 100644 --- a/airtime_mvc/application/forms/AddShowStyle.php +++ b/airtime_mvc/application/forms/AddShowStyle.php @@ -40,8 +40,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowWhat.php b/airtime_mvc/application/forms/AddShowWhat.php index 54707c461..10ed22415 100644 --- a/airtime_mvc/application/forms/AddShowWhat.php +++ b/airtime_mvc/application/forms/AddShowWhat.php @@ -66,8 +66,7 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index cbae215cf..1493c4ace 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -119,8 +119,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } @@ -129,8 +128,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm $element = $this->getElement('add_show_repeats'); if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/AddShowWho.php b/airtime_mvc/application/forms/AddShowWho.php index 7f0508c93..35b2aa52f 100644 --- a/airtime_mvc/application/forms/AddShowWho.php +++ b/airtime_mvc/application/forms/AddShowWho.php @@ -33,8 +33,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm { if ($element->getType() != 'Zend_Form_Element_Hidden') { - $element->setAttrib('readonly',true); - $element->setAttribs(array('style' => 'color: #B1B1B1; ')); + $element->setAttrib('disabled','disabled'); } } } diff --git a/airtime_mvc/application/forms/EditAudioMD.php b/airtime_mvc/application/forms/EditAudioMD.php index a492f1ac5..7dbcdf961 100644 --- a/airtime_mvc/application/forms/EditAudioMD.php +++ b/airtime_mvc/application/forms/EditAudioMD.php @@ -87,7 +87,8 @@ class Application_Form_EditAudioMD extends Zend_Form $this->addElement('text', 'bpm', array( 'label' => 'BPM:', 'class' => 'input_text', - 'filters' => array('StringTrim') + 'filters' => array('StringTrim'), + 'validators' => array(array('StringLength', false, array(0, 8))) )); // Add copyright field diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 2b4ac8a61..e79a1d526 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -11,7 +11,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm $defaultFade = Application_Model_Preference::GetDefaultFade(); if($defaultFade == ""){ - $defaultFade = '00.000000'; + $defaultFade = '0.500000'; } //Station name diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 1260781c4..161048bb8 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -21,6 +21,30 @@ class Application_Model_Show { $show->setDbName($name); Application_Model_RabbitMq::PushSchedule(); } + + public function setAirtimeAuthFlag($flag){ + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingAirtimeAuth($flag); + $show->save(); + } + + public function setCustomAuthFlag($flag){ + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUsingCustomAuth($flag); + $show->save(); + } + + public function setCustomUsername($username){ + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamUser($username); + $show->save(); + } + + public function setCustomPassword($password){ + $show = CcShowQuery::create()->findPK($this->_showId); + $show->setDbLiveStreamPass($password); + $show->save(); + } public function getDescription() { diff --git a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml index e61593d78..be1c5d694 100644 --- a/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml +++ b/airtime_mvc/application/views/scripts/schedule/add-show-form.phtml @@ -1,7 +1,7 @@