From ad334d9e74839905a11ba03056ee11764ea2894d Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 6 Feb 2013 15:44:52 -0500 Subject: [PATCH] CC-4926: System-> Preference: Please limit the default fade value less than 60 - added a range validator of 0 - 59.9 on default fade --- airtime_mvc/application/forms/GeneralPreferences.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 48a561b06..3d249ce47 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -7,6 +7,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm { $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator(); + $rangeValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(0, 59.9); $this->setDecorators(array( array('ViewScript', array('viewScript' => 'form/preferences_general.phtml')) )); @@ -34,9 +35,13 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm 'label' => _('Default Fade (s):'), 'required' => true, 'filters' => array('StringTrim'), - 'validators' => array(array($notEmptyValidator, 'regex', false, - array('/^[0-9]{1,2}(\.\d{1})?$/', - 'messages' => _('enter a time in seconds 0{.0}')))), + 'validators' => array( + array( + $rangeValidator, + $notEmptyValidator, + 'regex', false, array('/^[0-9]{1,2}(\.\d{1})?$/', 'messages' => _('enter a time in seconds 0{.0}')) + ) + ), 'value' => $defaultFade, 'decorators' => array( 'ViewHelper'