From e4bfe9c7230ae5fcf78095dab008389ef4b6b1f6 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Wed, 28 Sep 2011 17:46:27 +0200 Subject: verschiedene Korrekturen --- application/forms/EventEdit.php | 73 ++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 27 deletions(-) (limited to 'application/forms/EventEdit.php') diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php index 100eb89..2e1a4a9 100755 --- a/application/forms/EventEdit.php +++ b/application/forms/EventEdit.php @@ -5,9 +5,11 @@ class Application_Form_EventEdit extends Zend_Form private $membershiplist; private $bootoslist; private $poollist; + private $configlist; private $repeattypelist; private $repeatendlist; private $eventcategorylist; + private $oldtitle; private $params; public function setMembershiplist($membershiplist){ @@ -37,6 +39,16 @@ class Application_Form_EventEdit extends Zend_Form return $this->poollist; } + public function setConfiglist($configlist){ + $this->configlist = $configlist; + return $this; + + } + + public function getConfiglist(){ + return $this->configlist; + } + public function setRepeattypelist($repeattypelist){ $this->repeattypelist = $repeattypelist; return $this; @@ -66,6 +78,15 @@ class Application_Form_EventEdit extends Zend_Form $this->eventcategorylist = $eventcategorylist; } + public function setOldtitle($oldtitle){ + $this->oldtitle = $oldtitle; + + } + + public function getOldtitle(){ + return $this->oldtitle; + } + public function getParams() { return $this->params; @@ -99,7 +120,7 @@ class Application_Form_EventEdit extends Zend_Form 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 30)), - array('TitleUnique', false, array()), + array('TitleUnique', false, array('title' => $this->oldtitle)), ), 'required' => true, 'label' => 'Title:', @@ -183,8 +204,8 @@ class Application_Form_EventEdit extends Zend_Form $repeatendfield = $this->createElement('select','repeatend'); $repeatendfield ->setLabel('Repeat End:'); - if(count($this->$repeatendlist)>0){ - foreach($this->$repeatendlist as $end => $e){ + if(count($this->repeatendlist)>0){ + foreach($this->repeatendlist as $end => $e){ $title = $e->getTitle(); $id = $e->getID(); $repeatendfield->addMultiOption($id, $title); @@ -198,29 +219,6 @@ class Application_Form_EventEdit extends Zend_Form } $this->addElement($repeatendfield); - if(isset($this->params['repeatend'])) { - $this->addElement('select', 'repeatend', array( - 'multioptions' => array( - '1' => 'After', - '2' => 'Date', - ), - 'required' => false, - 'label' => 'Repeat End:', - 'value' => $this->params['repeatend'], - 'onchange' => 'repeatendChanged("repeatend");', - )); - } else { - $this->addElement('select', 'repeatend', array( - 'multioptions' => array( - '1' => 'After', - '2' => 'Date', - ), - 'required' => false, - 'label' => 'Repeat End:', - 'onchange' => 'repeatendChanged("repeatend");', - )); - } - if(isset($this->params['repeatdate'])) { $this->addElement('text', 'repeatdate', array( 'filters' => array('StringTrim'), @@ -330,9 +328,29 @@ class Application_Form_EventEdit extends Zend_Form } $bootosfield->setRegisterInArrayValidator(false); + $bootosfield->setAttrib('onchange', "bootosfieldChanged('pbs_bootosID', " . count($this->bootoslist) . ");"); $bootosfield->setValue( $this->params['pbs_bootosID']); $this->addElement($bootosfield); + foreach($this->configlist as $id => $bootosConfigs) { + $configfield = $this->createElement('select','pbs_configID_' . $id); + $configfield->setLabel('Config:'); + $configfield->addMultiOption('default', '---no config---'); + + if(count($bootosConfigs)>0){ + foreach($bootosConfigs as $config => $c){ + $configfield->addMultiOption($c->getID(), $c->getTitle()); + } + + $configfield->setRegisterInArrayValidator(false); + $configName = 'pbs_configID_' . $this->params['pbs_bootosID']; + if(isset( $this->params[$configName])) { + $configfield->setValue($this->params[$configName]); + } + $this->addElement($configfield); + } + } + $this->addElement('submit', 'save', array( 'required' => false, 'ignore' => true, @@ -348,10 +366,11 @@ class Application_Form_EventEdit extends Zend_Form echo ''; } -- cgit v1.2.3-55-g7522