better form validation for rebroadcast date/times
This commit is contained in:
parent
c3a02e2569
commit
0982405d4c
2 changed files with 21 additions and 3 deletions
|
@ -38,9 +38,14 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
|
||||
$day = $formData['add_show_rebroadcast_date_absolute_'.$i];
|
||||
|
||||
if(trim($day) == "") {
|
||||
if(trim($day) == "" && trim($time) == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (trim($day) == ""){
|
||||
$this->getElement('add_show_rebroadcast_date_absolute_'.$i)->setErrors(array("Day must be specified"));
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
$time = $formData['add_show_rebroadcast_time_absolute_'.$i];
|
||||
if (trim($time) == ""){
|
||||
|
@ -48,6 +53,10 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
if($valid === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$show_start_time = $formData['add_show_start_date']."".$formData['add_show_start_time'];
|
||||
$show_end = new DateTime($show_start_time);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue