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('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");
|
||||
|
@ -461,6 +463,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();
|
||||
|
@ -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
|
||||
/*
|
||||
public function editShowAction(){
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -321,7 +321,7 @@ function setAddShowEvents() {
|
|||
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){
|
||||
//addShowButton.removeClass("disabled");
|
||||
|
@ -336,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")
|
||||
|
|
Loading…
Reference in New Issue