CC-3444: Ability to edit currently playing show (end time and permissions)
- handling in better way. we created separate action for this.
This commit is contained in:
parent
68c908eeac
commit
954fa2bceb
|
@ -28,6 +28,8 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
->addActionContext('content-context-menu', 'json')
|
->addActionContext('content-context-menu', 'json')
|
||||||
->addActionContext('set-time-scale', 'json')
|
->addActionContext('set-time-scale', 'json')
|
||||||
->addActionContext('set-time-interval', 'json')
|
->addActionContext('set-time-interval', 'json')
|
||||||
|
->addActionContext('edit-show-instance', 'json')
|
||||||
|
->addActionContext('dj-edit-show', 'json')
|
||||||
->initContext();
|
->initContext();
|
||||||
|
|
||||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||||
|
@ -461,6 +463,10 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
if(!($isAdminOrPM || $isDJ)) {
|
if(!($isAdminOrPM || $isDJ)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($isDJ){
|
||||||
|
$this->view->action = "dj-edit-show";
|
||||||
|
}
|
||||||
|
|
||||||
$formWhat = new Application_Form_AddShowWhat();
|
$formWhat = new Application_Form_AddShowWhat();
|
||||||
$formWho = new Application_Form_AddShowWho();
|
$formWho = new Application_Form_AddShowWho();
|
||||||
|
@ -624,6 +630,25 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
//for 2.2
|
||||||
/*
|
/*
|
||||||
public function editShowAction(){
|
public function editShowAction(){
|
||||||
|
|
|
@ -36,8 +36,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,7 @@ class Application_Form_AddShowRR extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,7 @@ class Application_Form_AddShowStyle extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,7 @@ class Application_Form_AddShowWhat extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,8 +119,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,8 +128,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
$element = $this->getElement('add_show_repeats');
|
$element = $this->getElement('add_show_repeats');
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
|
||||||
{
|
{
|
||||||
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
{
|
{
|
||||||
$element->setAttrib('readonly',true);
|
$element->setAttrib('disabled','disabled');
|
||||||
$element->setAttribs(array('style' => 'color: #B1B1B1; '));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,30 @@ class Application_Model_Show {
|
||||||
$show->setDbName($name);
|
$show->setDbName($name);
|
||||||
Application_Model_RabbitMq::PushSchedule();
|
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()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<?php echo $this->style; ?>
|
<?php echo $this->style; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-bar bottom">
|
<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-icon ui-icon-plusthick"></span>
|
||||||
<span class="ui-button-text"><?php echo ($this->addNewShow ? "Add this show" : "Update show"); ?></span>
|
<span class="ui-button-text"><?php echo ($this->addNewShow ? "Add this show" : "Update show"); ?></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -321,7 +321,7 @@ function setAddShowEvents() {
|
||||||
applyPlatformOpacityRules: false
|
applyPlatformOpacityRules: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var action = "/Schedule/"+addShowButton.attr("data-type");
|
var action = "/Schedule/"+addShowButton.attr("data-action");
|
||||||
|
|
||||||
$.post(action, {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");
|
//addShowButton.removeClass("disabled");
|
||||||
|
@ -336,6 +336,19 @@ function setAddShowEvents() {
|
||||||
$("#add_show_end_date").val(end_date);
|
$("#add_show_end_date").val(end_date);
|
||||||
$("#add_show_start_date").val(start_date);
|
$("#add_show_start_date").val(start_date);
|
||||||
showErrorSections();
|
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 {
|
else {
|
||||||
$("#add-show-form")
|
$("#add-show-form")
|
||||||
|
|
Loading…
Reference in New Issue