summaryrefslogtreecommitdiffstats
path: root/application/forms/EventAdd.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-08 13:45:49 +0200
committerBjörn Geiger2011-09-08 13:45:49 +0200
commiteb21e13dcdd038315d0ad1ff4941d1069af9b977 (patch)
treef01bcd0cc3e5efa56cec23f650582f6d33af8481 /application/forms/EventAdd.php
parentsome changes (diff)
downloadpoolctrl-eb21e13dcdd038315d0ad1ff4941d1069af9b977.tar.gz
poolctrl-eb21e13dcdd038315d0ad1ff4941d1069af9b977.tar.xz
poolctrl-eb21e13dcdd038315d0ad1ff4941d1069af9b977.zip
kleine korrekturen
Diffstat (limited to 'application/forms/EventAdd.php')
-rw-r--r--application/forms/EventAdd.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php
index b62eed5..b4db7cf 100644
--- a/application/forms/EventAdd.php
+++ b/application/forms/EventAdd.php
@@ -8,7 +8,7 @@ class Application_Form_EventAdd extends Zend_Form
private $eventcategorylist;
private $start;
private $end;
- private $defaultEventCategory;
+ private $defaultEventCategoryID;
public function setMembershiplist($membershiplist){
$this->membershiplist = $membershiplist;
@@ -69,14 +69,14 @@ class Application_Form_EventAdd extends Zend_Form
return $this;
}
- public function getDefaultEventCategory()
+ public function getDefaultEventCategoryID()
{
- return $this->defaultEventCategory;
+ return $this->defaultEventCategoryID;
}
- public function setDefaultEventCategory($defaultEventCategory)
+ public function setDefaultEventCategoryID($defaultEventCategoryID)
{
- $this->defaultEventCategory = $defaultEventCategory;
+ $this->defaultEventCategoryID = $defaultEventCategoryID;
}
public function init()
@@ -92,15 +92,14 @@ class Application_Form_EventAdd extends Zend_Form
$title = $c->getTitle();
$id = $c->getID();
$eventcategoryfield->addMultiOption($id, $title);
- if($title == $this->defaultEventCategory) {
- $defaultEventCategoryID = $id;
- }
}
}
$eventcategoryfield->setRegisterInArrayValidator(false);
$eventcategoryfield->setAttrib('onchange', "eventcategoryfieldChanged('category');");
- $eventcategoryfield->setValue($defaultEventCategoryID);
+ if(isset($this->defaultEventCategoryID)) {
+ $eventcategoryfield->setValue($this->defaultEventCategoryID);
+ }
$this->addElement($eventcategoryfield);
$this->addElement('text', 'title', array(
@@ -122,21 +121,25 @@ class Application_Form_EventAdd extends Zend_Form
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 16)),
+ array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
),
'required' => true,
'label' => 'Start (mm/dd/yyyy H:min):',
- 'value' => $this->start,
+ 'value' => $this->start,
));
$this->addElement('text', 'end', array(
'filters' => array('StringTrim'),
'validators' => array(
array('StringLength', false, array(0, 16)),
+ array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
+ array('DateGreaterThan', false, array('min' => $this->getElement('start')->getValue())),
),
'required' => false,
'label' => 'End (mm/dd/yyyy H:min):',
- 'value' => $this->end,
+ 'value' => $this->end,
));
+ $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
$this->addElement('checkbox', 'repeat', array(
'onchange' => 'repeatChanged("repeat")',
@@ -219,4 +222,4 @@ class Application_Form_EventAdd extends Zend_Form
});
</script>';
}
-}
+} \ No newline at end of file