CC-3444: Ability to edit currently playing show (end time and permissions
- fixed
This commit is contained in:
parent
d219c78744
commit
d11fca8ac8
|
@ -89,9 +89,9 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
Application_Model_Schedule::createNewFormSections($this->view);
|
Application_Model_Schedule::createNewFormSections($this->view);
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$user = Application_Model_User::GetCurrentUser();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
|
||||||
if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){
|
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))){
|
||||||
$this->view->preloadShowForm = true;
|
$this->view->preloadShowForm = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,7 +586,11 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
'add_show_repeats' => $show->isRepeating() ? 1 : 0));
|
'add_show_repeats' => $show->isRepeating() ? 1 : 0));
|
||||||
|
|
||||||
if ($show->isStartDateTimeInPast()){
|
if ($show->isStartDateTimeInPast()){
|
||||||
$formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
if(!$showInstance->getShow()->isRepeating()){
|
||||||
|
$formWhen->disableStartDateAndTime();
|
||||||
|
}else{
|
||||||
|
$formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//need to get the days of the week in the php timezone (for the front end).
|
//need to get the days of the week in the php timezone (for the front end).
|
||||||
|
@ -684,7 +688,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
$user = Application_Model_User::GetCurrentUser();
|
$user = Application_Model_User::GetCurrentUser();
|
||||||
|
|
||||||
if($user->isUserType(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)){
|
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))){
|
||||||
Application_Model_Schedule::createNewFormSections($this->view);
|
Application_Model_Schedule::createNewFormSections($this->view);
|
||||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||||
}
|
}
|
||||||
|
@ -765,7 +769,9 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
//array key does not exist. We need to repopulate this entry from the db.
|
//array key does not exist. We need to repopulate this entry from the db.
|
||||||
//The start date will be returned in UTC time, so lets convert it to local time.
|
//The start date will be returned in UTC time, so lets convert it to local time.
|
||||||
$dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDate());
|
$dt = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartDate());
|
||||||
|
$startTime = Application_Common_DateHelper::ConvertToLocalDateTime($show->getStartTime());
|
||||||
$data['add_show_start_date'] = $dt->format("Y-m-d");
|
$data['add_show_start_date'] = $dt->format("Y-m-d");
|
||||||
|
$data['add_show_start_time'] = $startTime->format("H:i");
|
||||||
$validateStartDate = false;
|
$validateStartDate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,5 +131,16 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
$element->setAttrib('disabled','disabled');
|
$element->setAttrib('disabled','disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function disableStartDateAndTime(){
|
||||||
|
$elements = array($this->getElement('add_show_start_date'), $this->getElement('add_show_start_time'));
|
||||||
|
foreach ($elements as $element)
|
||||||
|
{
|
||||||
|
if ($element->getType() != 'Zend_Form_Element_Hidden')
|
||||||
|
{
|
||||||
|
$element->setAttrib('disabled','disabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue