CC-2196: Update a Live show with invalid data, uncheck the Record checkbox
-fixed
This commit is contained in:
parent
114fe1ad3f
commit
7a3fbe9ac7
4 changed files with 19 additions and 14 deletions
|
@ -622,10 +622,22 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$who = $formWho->isValid($data);
|
||||
$style = $formStyle->isValid($data);
|
||||
$record = $formRecord->isValid($data);
|
||||
|
||||
//If show is a new show (not updated), then get
|
||||
//isRecorded from POST data. Otherwise get it from
|
||||
//the database since the user is not allowed to
|
||||
//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));
|
||||
} else {
|
||||
$record = $formRecord->isValid($data);
|
||||
}
|
||||
|
||||
if ($what && $when && $repeats && $who && $style && $record && $rebroadAb && $rebroad) {
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new User($userInfo->id);
|
||||
if ($user->isAdmin()) {
|
||||
|
|
|
@ -38,6 +38,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
|
||||
$valid = true;
|
||||
$day = $formData['add_show_rebroadcast_date_absolute_'.$i];
|
||||
$time = $formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||
|
||||
if(trim($day) == "" && trim($time) == "") {
|
||||
continue;
|
||||
|
@ -48,7 +49,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
$time = $formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||
|
||||
if (trim($time) == ""){
|
||||
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
|
|
@ -43,6 +43,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
|
||||
$valid = true;
|
||||
$days = $formData['add_show_rebroadcast_date_'.$i];
|
||||
$time = $formData['add_show_rebroadcast_time_'.$i];
|
||||
|
||||
if(trim($days) == "" && trim($time) == "") {
|
||||
continue;
|
||||
|
@ -53,7 +54,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
$time = $formData['add_show_rebroadcast_time_'.$i];
|
||||
|
||||
if (trim($time) == ""){
|
||||
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
|
|
@ -661,16 +661,7 @@ class Show {
|
|||
$showId = $ccShow->getDbId();
|
||||
$show = new Show($showId);
|
||||
|
||||
//If show is a new show (not updated), then get
|
||||
//isRecorded from POST data. Otherwise get it from
|
||||
//the database since the user is not allowed to
|
||||
//update this option.
|
||||
if ($data['add_show_id'] == -1){
|
||||
$isRecorded = ($data['add_show_record']) ? 1 : 0;
|
||||
} else {
|
||||
$isRecorded = $show->isRecorded();
|
||||
}
|
||||
|
||||
$isRecorded = ($data['add_show_record']) ? 1 : 0;
|
||||
|
||||
if ($data['add_show_id'] != -1){
|
||||
Show::deletePossiblyInvalidInstances($data, $show, $endDate, $isRecorded, $repeatType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue