Merge branch 'devel' into CC-3174
This commit is contained in:
commit
b998a04c2e
40 changed files with 354 additions and 234 deletions
|
@ -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.';
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div id="schedule-add-show" class="tabs ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<div class="button-bar">
|
||||
<a href="#" id="add-show-close" class="icon-link"><span class="ui-icon ui-icon-circle-close"></span>Close</a>
|
||||
<button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<button data-action="<?php echo isset($this->action) ? $this->action : "add-show" ?>" aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<span class="ui-icon ui-icon-plusthick"></span>
|
||||
<span class="ui-button-text"><?php echo ($this->addNewShow ? "Add this show" : "Update show"); ?></span>
|
||||
</button>
|
||||
|
@ -37,7 +37,7 @@
|
|||
<?php echo $this->style; ?>
|
||||
</div>
|
||||
<div class="button-bar bottom">
|
||||
<button aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<button data-action="<?php echo isset($this->action) ? $this->action : "add-show" ?>" aria-disabled="false" role="button" class="add-show-submit right-floated ui-button ui-widget ui-state-default ui-button-text-icon-primary">
|
||||
<span class="ui-icon ui-icon-plusthick"></span>
|
||||
<span class="ui-button-text"><?php echo ($this->addNewShow ? "Add this show" : "Update show"); ?></span>
|
||||
</button>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<form id="add-show-form" method="post" action="" style="display:none;">
|
||||
<?php echo $this->render('schedule/add-show-form.phtml') ?>
|
||||
<?php if($this->preloadShowForm){
|
||||
echo $this->render('schedule/add-show-form.phtml');
|
||||
}?>
|
||||
</form>
|
||||
|
||||
<div id='schedule_calendar' class="ui-widget-content block-shadow padded omega-block"></div>
|
||||
|
|
|
@ -75,8 +75,9 @@ function open_show_preview(p_showID, p_showIndex) {
|
|||
}
|
||||
|
||||
function openPreviewWindow(url) {
|
||||
|
||||
//$.post(baseUri+'Playlist/audio-preview-player', {fileName: fileName, cueIn: cueIn, cueOut: cueOut, fadeIn: fadeIn, fadeInFileName: fadeInFileName, fadeOut: fadeOut, fadeOutFileName: fadeOutFileName})
|
||||
_preview_window = window.open(url, 'Audio Player', 'width=450,height=800');
|
||||
_preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
|
||||
//Set the play button to pause.
|
||||
//var elemID = "spl_"+elemIndexString;
|
||||
//$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
|
||||
|
|
|
@ -235,18 +235,4 @@ $(document).ready(function() {
|
|||
|
||||
showErrorSections()
|
||||
setInterval('checkLiquidsoapStatus()', 1000)
|
||||
$.mask.rules = {
|
||||
'@': /[^ &<>]/,
|
||||
'u': /[0-9a-zA-Z-_.:/]/,
|
||||
'd': /[0-9a-zA-Z-_.]/
|
||||
}
|
||||
// add masking on the fields that don't allow special chars
|
||||
|
||||
$.mask.masks = $.extend($.mask.masks,{
|
||||
regular_text:{ mask: '@', type:'repeat', 'maxLength': 256, selectCharsOnFocus: false, autoTab: false, fixedChars : '[(),:/]'},
|
||||
url:{ mask: 'u', type:'repeat', 'maxLength': 261, selectCharsOnFocus: false, autoTab: false, fixedChars : '[(),]'},
|
||||
domain:{ mask: 'd', type:'repeat', 'maxLength': 261, selectCharsOnFocus: false, autoTab: false, fixedChars : '[(),:/]'}
|
||||
})
|
||||
$('input:text').setMask()
|
||||
|
||||
});
|
||||
|
|
|
@ -320,8 +320,10 @@ function setAddShowEvents() {
|
|||
message: null,
|
||||
applyPlatformOpacityRules: false
|
||||
});
|
||||
|
||||
var action = "/Schedule/"+String(addShowButton.attr("data-action"));
|
||||
|
||||
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
//addShowButton.removeClass("disabled");
|
||||
$('#schedule-add-show').unblock();
|
||||
if(json.form) {
|
||||
|
@ -334,6 +336,19 @@ function setAddShowEvents() {
|
|||
$("#add_show_end_date").val(end_date);
|
||||
$("#add_show_start_date").val(start_date);
|
||||
showErrorSections();
|
||||
}else if(json.edit){
|
||||
$("#schedule_calendar").removeAttr("style")
|
||||
.fullCalendar('render');
|
||||
|
||||
$("#add-show-form").hide();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
||||
setAddShowEvents();
|
||||
});
|
||||
makeAddShowButton();
|
||||
}
|
||||
else {
|
||||
$("#add-show-form")
|
||||
|
|
|
@ -20,7 +20,6 @@ function scheduleRefetchEvents(json) {
|
|||
}
|
||||
|
||||
function openAddShowForm() {
|
||||
|
||||
if($("#add-show-form").length == 1) {
|
||||
if( ($("#add-show-form").css('display')=='none')) {
|
||||
$("#add-show-form").show();
|
||||
|
@ -37,13 +36,6 @@ function openAddShowForm() {
|
|||
$add_show_name.select();
|
||||
});
|
||||
}
|
||||
|
||||
$.mask.masks = $.extend($.mask.masks,{
|
||||
date:{ mask: '9999-19-39', selectCharsOnFocus: true, autoTab: false},
|
||||
time:{ mask: '29:69', selectCharsOnFocus: true, autoTab: false}
|
||||
});
|
||||
|
||||
$('input:text').setMask();
|
||||
}
|
||||
|
||||
function makeAddShowButton(){
|
||||
|
@ -99,61 +91,65 @@ function pad(number, length) {
|
|||
return str;
|
||||
}
|
||||
|
||||
function dayClick(date, allDay, jsEvent, view) {
|
||||
var now, today, selected, chosenDate, chosenTime;
|
||||
|
||||
now = adjustDateToServerDate(new Date(), serverTimezoneOffset);
|
||||
function dayClick(date, allDay, jsEvent, view){
|
||||
// The show from will be preloaded if the user is admin or program manager.
|
||||
// Hence, if the user if DJ then it won't open anything.
|
||||
if($.trim($("#add-show-form").html()) != ""){
|
||||
var now, today, selected, chosenDate, chosenTime;
|
||||
|
||||
if(view.name === "month") {
|
||||
today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
selected = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
}
|
||||
else {
|
||||
today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes());
|
||||
selected = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
|
||||
}
|
||||
|
||||
if(selected >= today) {
|
||||
var addShow = $('.add-button');
|
||||
|
||||
//remove the +show button if it exists.
|
||||
if(addShow.length == 1){
|
||||
var span = $(addShow).parent();
|
||||
$(span).prev().remove();
|
||||
$(span).remove();
|
||||
now = adjustDateToServerDate(new Date(), serverTimezoneOffset);
|
||||
|
||||
if(view.name === "month") {
|
||||
today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
selected = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
}
|
||||
|
||||
// get current duration value on the form
|
||||
var duration_string = $.trim($("#add_show_duration").val());
|
||||
var duration_info = duration_string.split(" ");
|
||||
var duration_h = 0;
|
||||
var duration_m = 0;
|
||||
if(duration_info[0] != null){
|
||||
duration_h = parseInt(duration_info[0], 10);
|
||||
else {
|
||||
today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes());
|
||||
selected = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
|
||||
}
|
||||
if(duration_info[1] != null){
|
||||
duration_m = parseInt(duration_info[1], 10);
|
||||
|
||||
if(selected >= today) {
|
||||
var addShow = $('.add-button');
|
||||
|
||||
//remove the +show button if it exists.
|
||||
if(addShow.length == 1){
|
||||
var span = $(addShow).parent();
|
||||
$(span).prev().remove();
|
||||
$(span).remove();
|
||||
}
|
||||
|
||||
// get current duration value on the form
|
||||
var duration_string = $.trim($("#add_show_duration").val());
|
||||
var duration_info = duration_string.split(" ");
|
||||
var duration_h = 0;
|
||||
var duration_m = 0;
|
||||
if(duration_info[0] != null){
|
||||
duration_h = parseInt(duration_info[0], 10);
|
||||
}
|
||||
if(duration_info[1] != null){
|
||||
duration_m = parseInt(duration_info[1], 10);
|
||||
}
|
||||
// duration in milisec
|
||||
var duration = (duration_h * 60 * 60 * 1000) + (duration_m * 60 * 1000);
|
||||
|
||||
// get start time value on the form
|
||||
var startTime_string = $("#add_show_start_time").val();
|
||||
var startTime_info = startTime_string.split(':');
|
||||
var startTime = (parseInt(startTime_info[0],10) * 60 * 60 * 1000) + (parseInt(startTime_info[1], 10) * 60 * 1000);
|
||||
|
||||
// calculate endDateTime
|
||||
var endDateTime = new Date(selected.getTime() + startTime + duration);
|
||||
|
||||
chosenDate = selected.getFullYear() + '-' + pad(selected.getMonth()+1,2) + '-' + pad(selected.getDate(),2);
|
||||
var endDateFormat = endDateTime.getFullYear() + '-' + pad(endDateTime.getMonth()+1,2) + '-' + pad(endDateTime.getDate(),2);
|
||||
|
||||
$("#add_show_start_date").val(chosenDate);
|
||||
$("#add_show_end_date_no_repeat").val(endDateFormat);
|
||||
$("#add_show_end_date").val(endDateFormat);
|
||||
$("#schedule-show-when").show();
|
||||
|
||||
openAddShowForm();
|
||||
}
|
||||
// duration in milisec
|
||||
var duration = (duration_h * 60 * 60 * 1000) + (duration_m * 60 * 1000);
|
||||
|
||||
// get start time value on the form
|
||||
var startTime_string = $("#add_show_start_time").val();
|
||||
var startTime_info = startTime_string.split(':');
|
||||
var startTime = (parseInt(startTime_info[0],10) * 60 * 60 * 1000) + (parseInt(startTime_info[1], 10) * 60 * 1000);
|
||||
|
||||
// calculate endDateTime
|
||||
var endDateTime = new Date(selected.getTime() + startTime + duration);
|
||||
|
||||
chosenDate = selected.getFullYear() + '-' + pad(selected.getMonth()+1,2) + '-' + pad(selected.getDate(),2);
|
||||
var endDateFormat = endDateTime.getFullYear() + '-' + pad(endDateTime.getMonth()+1,2) + '-' + pad(endDateTime.getDate(),2);
|
||||
|
||||
$("#add_show_start_date").val(chosenDate);
|
||||
$("#add_show_end_date_no_repeat").val(endDateFormat);
|
||||
$("#add_show_end_date").val(endDateFormat);
|
||||
$("#schedule-show-when").show();
|
||||
|
||||
openAddShowForm();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ function buildContentDialog (json){
|
|||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
title: 'Show Contents',
|
||||
title: "Contents of Show \"" + json.showTitle + "\"",
|
||||
width: width,
|
||||
height: height,
|
||||
modal: true,
|
||||
|
@ -422,4 +422,4 @@ $(document).ready(function() {
|
|||
};
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,16 @@ $(document).ready(function(){
|
|||
height: "0px",
|
||||
cssClass: "jp-video-270p"
|
||||
},
|
||||
wmode: "window"
|
||||
playlistOptions: {
|
||||
autoPlay: false,
|
||||
loopOnPrevious: false,
|
||||
shuffleOnLoop: true,
|
||||
enableRemoveControls: false,
|
||||
displayTime: 0,
|
||||
addTime: 0,
|
||||
removeTime: 0,
|
||||
shuffleTime: 0
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
@ -32,6 +41,8 @@ $(document).ready(function(){
|
|||
var showID = $('.showID').text();
|
||||
var showIndex = $('.showIndex').text();
|
||||
|
||||
var numOfItems = 0;
|
||||
|
||||
if (playlistID != "" && playlistID !== ""){
|
||||
playAllPlaylist(playlistID, playlistIndex);
|
||||
}else if (audioFileID != "") {
|
||||
|
@ -87,6 +98,7 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
var myPlaylist = new Array();
|
||||
var media;
|
||||
var index;
|
||||
var total = 0;
|
||||
for(index in data){
|
||||
|
||||
if (data[index]['element_mp3'] != undefined){
|
||||
|
@ -103,11 +115,17 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
myPlaylist[index] = media;
|
||||
|
||||
_idToPostionLookUp[data[index]['element_id']] = data[index]['element_position'];
|
||||
total++;
|
||||
}
|
||||
|
||||
_playlist_jplayer.setPlaylist(myPlaylist);
|
||||
_playlist_jplayer.option("autoPlay", true);
|
||||
play(p_playIndex);
|
||||
|
||||
var height = Math.min(80 + (23 * total), 400);
|
||||
window.innerWidth = 500;
|
||||
window.innerHeight = height;
|
||||
window.scrollbars = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -146,4 +164,7 @@ function playOne(p_audioFileID) {
|
|||
//_playlist_jplayer.setPlaylist(playlist); --if I use this the player will call _init on the setPlaylist and on the ready
|
||||
_playlist_jplayer._initPlaylist(playlist);
|
||||
_playlist_jplayer.play(0);
|
||||
|
||||
window.innerWidth = 490;
|
||||
window.innerHeight = 105;
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue