summaryrefslogtreecommitdiffstats
path: root/application/forms
diff options
context:
space:
mode:
Diffstat (limited to 'application/forms')
-rwxr-xr-xapplication/forms/EventAdd.php4
-rwxr-xr-xapplication/forms/EventEdit.php2
2 files changed, 5 insertions, 1 deletions
diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php
index 0aee9e0..6f579b5 100755
--- a/application/forms/EventAdd.php
+++ b/application/forms/EventAdd.php
@@ -168,7 +168,7 @@ class Application_Form_EventAdd extends Zend_Form
'label' => 'Immediate Event:',
'value' => array(0,1),
));
-
+
$this->addElement('checkbox', 'force', array(
'required' => false,
'label' => 'Force event:',
@@ -185,6 +185,7 @@ class Application_Form_EventAdd extends Zend_Form
'label' => 'Start:',
'value' => $this->start,
));
+ $this->getElement('start')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
$this->addElement('text', 'end', array(
'filters' => array('StringTrim'),
@@ -198,6 +199,7 @@ class Application_Form_EventAdd extends Zend_Form
'value' => $this->end,
));
$this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
+ $this->getElement('start')->addValidator(new Poolctrl_Validate_EventOverlapping(), array('end' => $this->getElement('end')->getValue()));
$this->addElement('checkbox', 'repeat', array(
'onchange' => 'repeatChanged("repeat")',
diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php
index 00eb210..baee5b4 100755
--- a/application/forms/EventEdit.php
+++ b/application/forms/EventEdit.php
@@ -156,6 +156,7 @@ class Application_Form_EventEdit extends Zend_Form
'label' => 'Start:',
'value' => date ('m/d/Y h:i a', strtotime( $this->params['start'])),
));
+ $this->getElement('start')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
if(isset($this->params['end'])) {
$this->addElement('text', 'end', array(
@@ -184,6 +185,7 @@ class Application_Form_EventEdit extends Zend_Form
));
$this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
}
+ $this->getElement('start')->addValidator(new Poolctrl_Validate_EventOverlapping(array('end' => $this->getElement('end')->getValue())));
if( $this->params['repeat'] == 1) {
$this->addElement('checkbox', 'repeat', array(