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
|
@ -48,8 +48,8 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$this->getElement('add_show_rebroadcast_date_absolute_'.$i)->setErrors(array("Day must be specified"));
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (trim($time) == ""){
|
||||
$this->getElement('add_show_rebroadcast_time_absolute_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
@ -60,7 +60,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
continue;
|
||||
}
|
||||
|
||||
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
|
||||
$show_start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
|
||||
$show_end = new DateTime($show_start_time);
|
||||
|
||||
$duration = $formData['add_show_duration'];
|
||||
|
@ -70,7 +70,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$show_end->add(new DateInterval("PT$duration[1]M"));
|
||||
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
|
||||
|
||||
$rebroad_start = $day."".$formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||
$rebroad_start = $day." ".$formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||
$rebroad_start = new DateTime($rebroad_start);
|
||||
|
||||
if($rebroad_start < $show_end) {
|
||||
|
|
|
@ -53,8 +53,8 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
$this->getElement('add_show_rebroadcast_date_'.$i)->setErrors(array("Day must be specified"));
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (trim($time) == ""){
|
||||
$this->getElement('add_show_rebroadcast_time_'.$i)->setErrors(array("Time must be specified"));
|
||||
$valid = false;
|
||||
|
@ -68,7 +68,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
$days = explode(" ", $days);
|
||||
$day = $days[0];
|
||||
|
||||
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
|
||||
$show_start_time = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
|
||||
$show_end = new DateTime($show_start_time);
|
||||
|
||||
$duration = $formData['add_show_duration'];
|
||||
|
@ -78,7 +78,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm
|
|||
$show_end->add(new DateInterval("PT$duration[1]M"));
|
||||
$show_end->add(new DateInterval("PT1H"));//min time to wait until a rebroadcast
|
||||
|
||||
$rebroad_start = $formData['add_show_start_date']."".$formData['add_show_rebroadcast_time_'.$i];
|
||||
$rebroad_start = $formData['add_show_start_date']." ".$formData['add_show_rebroadcast_time_'.$i];
|
||||
$rebroad_start = new DateTime($rebroad_start);
|
||||
$rebroad_start->add(new DateInterval("P".$day."D"));
|
||||
|
||||
|
|
|
@ -59,20 +59,22 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
|
||||
}
|
||||
|
||||
public function checkReliantFields($formData) {
|
||||
public function checkReliantFields($formData, $startDateModified) {
|
||||
|
||||
$valid = true;
|
||||
|
||||
$now_timestamp = date("Y-m-d H:i:s");
|
||||
$start_timestamp = $formData['add_show_start_date']."".$formData['add_show_start_time'];
|
||||
$start_timestamp = $formData['add_show_start_date']." ".$formData['add_show_start_time'];
|
||||
|
||||
$now_epoch = strtotime($now_timestamp);
|
||||
$start_epoch = strtotime($start_timestamp);
|
||||
|
||||
if($start_epoch < $now_epoch) {
|
||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
|
||||
$valid = false;
|
||||
}
|
||||
if ((($formData['add_show_id'] != -1) && $startDateModified) || ($formData['add_show_id'] == -1)){
|
||||
if($start_epoch < $now_epoch) {
|
||||
$this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
|
||||
$valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(strtotime("00:00") == strtotime($formData["add_show_duration"])) {
|
||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00:00'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue