Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-04-07 22:33:47 -04:00
commit d562a26f4b
12 changed files with 72 additions and 19 deletions

View File

@ -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");
@ -462,6 +464,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();
@ -625,6 +631,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(){

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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');
}
}
}

View File

@ -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()
{

View File

@ -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>

View File

@ -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")