membershiplist = $membershiplist; } public function getMembershiplist(){ return $this->membershiplist; } public function setBootoslist($bootoslist){ $this->bootoslist = $bootoslist; } public function getBootoslist(){ return $this->bootoslist; } public function setPoollist($poollist){ $this->poollist = $poollist; } public function getPoollist(){ return $this->poollist; } public function getEventcategorylist() { return $this->eventcategorylist; } public function setEventcategorylist($eventcategorylist) { $this->eventcategorylist = $eventcategorylist; } public function getParams() { return $this->params; } public function setParams($params) { $this->params = $params; } public function init() { $this->setName('EventEdit'); $this->setMethod('post'); $this->addElement('text', 'title', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 30)), ), 'required' => true, 'label' => 'Title:', 'value' => $this->params['title'], )); if( $this->params['immediate'] == 1) { $this->addElement('checkbox', 'immediate', array( 'required' => false, 'label' => 'Immediate Event', 'value'=>array(0,1), 'checked' => 'checked', )); } else { $this->addElement('checkbox', 'immediate', array( 'required' => false, 'label' => 'Immediate Event', 'value'=>array(0,1), )); } $this->addElement('text', 'start', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), ), 'required' => true, 'label' => 'Start (mm/dd/yyyy H:min):', 'value' => date ('m/d/Y H:i', strtotime( $this->params['start'])), )); $this->addElement('text', 'end', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), ), 'required' => true, 'label' => 'End (mm/dd/yyyy H:min):', 'value' => date ('m/d/Y H:i', strtotime( $this->params['end'])), )); echo ''; if( $this->params['repeat'] == 1) { $this->addElement('checkbox', 'repeat', array( 'required' => false, 'label' => 'Repeat:', 'value'=>array(0,1), 'checked' => 'checked', )); } else { $this->addElement('checkbox', 'repeat', array( 'required' => false, 'label' => 'Repeat:', 'value'=>array(0,1), )); } $this->addElement('text', 'participants', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 4)), ), 'required' => false, 'label' => 'Participants:', 'value' => $this->params['participants'], )); $eventcategoryfield = new Zend_Form_Element_Select('category'); $eventcategoryfield ->setLabel('Category:'); if(count($this->eventcategorylist)>0){ foreach($this->eventcategorylist as $category => $c){ $eventcategoryfield->addMultiOption($c->getID(), $c->getTitle()); } } $eventcategoryfield->setRegisterInArrayValidator(false); $eventcategoryfield->setValue( $this->params['category']); $this->addElement($eventcategoryfield); $this->addElement('text', 'note', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 140)), ), 'required' => false, 'label' => 'Note:', 'value' => $this->params['note'], )); $poolfield = $this->createElement('select','pbs_poolID'); $poolfield ->setLabel('Pool:'); if(count($this->poollist)>0){ foreach($this->poollist as $pool => $p){ $poolfield->addMultiOption($p->getID(), $p->getTitle()); } } $poolfield->setRegisterInArrayValidator(false); $poolfield->setValue( $this->params['pbs_poolID']); $this->addElement($poolfield); $bootosfield = $this->createElement('select','pbs_bootosID'); $bootosfield ->setLabel('BootOS:'); if(count($this->bootoslist)>0){ foreach($this->bootoslist as $bootos => $b){ $bootosfield->addMultiOption($b->getID(), $b->getTitle()); } } $bootosfield->setRegisterInArrayValidator(false); $bootosfield->setValue( $this->params['pbs_bootosID']); $this->addElement($bootosfield); $this->addElement('submit', 'save', array( 'required' => false, 'ignore' => true, 'label' => 'Save Event' )); $this->addElement('button', 'cancel', array( 'required' => false, 'ignore' => true, 'label' => 'Cancel', 'onclick' => 'location.href="javascript:history.back();"', )); } }