CC-2336 Some Show Editing Features Seem to have been lost
recovered everything that original worked I think will keep looking, still problems with editing a show which has already started.
This commit is contained in:
parent
ab948b8dcb
commit
f7de484461
6 changed files with 125 additions and 82 deletions
|
@ -446,10 +446,14 @@ class ScheduleController extends Zend_Controller_Action
|
|||
'add_show_description' => $show->getDescription()));
|
||||
|
||||
$formWhen->populate(array('add_show_start_date' => $show->getStartDate(),
|
||||
'add_show_start_time' => Show::removeSecondsFromTime($show->getStartTime()),
|
||||
'add_show_start_time' => DateHelper::removeSecondsFromTime($show->getStartTime()),
|
||||
'add_show_duration' => $show->getDuration(),
|
||||
'add_show_repeats' => $show->isRepeating() ? 1 : 0));
|
||||
|
||||
if ($show->isStartDateTimeInPast()){
|
||||
$formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||
}
|
||||
|
||||
$days = array();
|
||||
$showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find();
|
||||
foreach($showDays as $showDay){
|
||||
|
@ -476,7 +480,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$i = 1;
|
||||
foreach ($rebroadcastsRelative as $rebroadcast){
|
||||
$rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset'];
|
||||
$rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$rebroadcastFormValues["add_show_rebroadcast_time_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formRebroadcast->populate($rebroadcastFormValues);
|
||||
|
@ -486,7 +490,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$i = 1;
|
||||
foreach ($rebroadcastsAbsolute as $rebroadcast){
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = Show::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||
|
@ -548,6 +552,16 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$data[$j["name"]] = $j["value"];
|
||||
}
|
||||
|
||||
$show = new Show($data['add_show_id']);
|
||||
|
||||
$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
|
||||
//array key does not exist. We need to repopulate this entry from the db.
|
||||
$data['add_show_start_date'] = $show->getStartDate();
|
||||
$startDateModified = false;
|
||||
}
|
||||
|
||||
$data['add_show_hosts'] = $this->_getParam('hosts');
|
||||
$data['add_show_day_check'] = $this->_getParam('days');
|
||||
|
||||
|
@ -586,11 +600,10 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$what = $formWhat->isValid($data);
|
||||
$when = $formWhen->isValid($data);
|
||||
if($when) {
|
||||
$when = $formWhen->checkReliantFields($data);
|
||||
$when = $formWhen->checkReliantFields($data, $startDateModified);
|
||||
}
|
||||
|
||||
if($data["add_show_repeats"]) {
|
||||
|
||||
$repeats = $formRepeats->isValid($data);
|
||||
if($repeats) {
|
||||
$repeats = $formRepeats->checkReliantFields($data);
|
||||
|
@ -636,7 +649,6 @@ class ScheduleController extends Zend_Controller_Action
|
|||
//update this option.
|
||||
$record = false;
|
||||
if ($data['add_show_id'] != -1){
|
||||
$show = new Show($data['add_show_id']);
|
||||
$data['add_show_record'] = $show->isRecorded();
|
||||
$record = $formRecord->isValid($data);
|
||||
$formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));
|
||||
|
@ -676,6 +688,9 @@ class ScheduleController extends Zend_Controller_Action
|
|||
if ($data['add_show_id'] != -1){
|
||||
$this->view->addNewShow = false;
|
||||
}
|
||||
if (!$startDateModified){
|
||||
$formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
|
||||
}
|
||||
|
||||
$this->view->form = $this->view->render('schedule/add-show-form.phtml');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue