Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x
This commit is contained in:
commit
fdb7d55ac1
|
@ -117,19 +117,24 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
||||||
}
|
}
|
||||||
|
|
||||||
$pattern = '/([0-9][0-9])h ([0-9][0-9])m/';
|
$pattern = '/([0-9][0-9])h ([0-9][0-9])m/';
|
||||||
preg_match($pattern, $formData['add_show_duration'], $matches);
|
|
||||||
$hours = $matches[1];
|
if (preg_match($pattern, $formData['add_show_duration'], $matches) && count($matches) == 3) {
|
||||||
$minutes = $matches[2];
|
$hours = $matches[1];
|
||||||
if( $formData["add_show_duration"] == "00h 00m" ) {
|
$minutes = $matches[2];
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00h 00m'));
|
if( $formData["add_show_duration"] == "00h 00m" ) {
|
||||||
$valid = false;
|
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration 00h 00m'));
|
||||||
}elseif(strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) {
|
$valid = false;
|
||||||
if ($hours > 24 || ($hours == 24 && $minutes > 0)) {
|
}elseif(strpos($formData["add_show_duration"], 'h') !== false && $hours >= 24) {
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration greater than 24h'));
|
if ($hours > 24 || ($hours == 24 && $minutes > 0)) {
|
||||||
|
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration greater than 24h'));
|
||||||
|
$valid = false;
|
||||||
|
}
|
||||||
|
}elseif( strstr($formData["add_show_duration"], '-') ){
|
||||||
|
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m'));
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
}elseif( strstr($formData["add_show_duration"], '-') ){
|
}
|
||||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m'));
|
else {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue