membershiplist = $membershiplist; return $this; } public function getMembershiplist(){ return $this->membershiplist; } public function setBootoslist($bootoslist){ $this->bootoslist = $bootoslist; return $this; } public function getBootoslist(){ return $this->bootoslist; } public function setPoollist($poollist){ $this->poollist = $poollist; return $this; } public function getPoollist(){ 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; } public function getRepeattypelist(){ return $this->repeattypelist; } public function setRepeatendlist($repeatendlist){ $this->repeatendlist = $repeatendlist; return $this; } public function getRepeatendlist(){ return $this->repeatendlist; } public function getEventcategorylist() { return $this->eventcategorylist; } public function setEventcategorylist($eventcategorylist) { $this->eventcategorylist = $eventcategorylist; return $this; } public function getStart() { return $this->start; } public function setStart($start) { $this->start = $start; return $this; } public function getEnd() { return $this->end; } public function setEnd($end) { $this->end = $end; return $this; } public function getDefaultEventCategoryID() { return $this->defaultEventCategoryID; } public function setDefaultEventCategoryID($defaultEventCategoryID) { $this->defaultEventCategoryID = $defaultEventCategoryID; return $this; } public function getPoolID() { return $this->poolID; } public function setPoolID($poolID) { $this->poolID = $poolID; return $this; } public function init() { $this->setName('EventAdd'); $this->setMethod('post'); $eventcategoryfield = $this->createElement('select','category'); $eventcategoryfield ->setLabel('Category:'); if(count($this->eventcategorylist)>0){ foreach($this->eventcategorylist as $category => $c){ $title = $c->getTitle(); $id = $c->getID(); $eventcategoryfield->addMultiOption($id, $title); } } $eventcategoryfield->setRegisterInArrayValidator(false); $eventcategoryfield->setAttrib('onchange', "addeventcategoryfieldChanged('category', bootosIDs);"); if(isset($this->defaultEventCategoryID)) { $eventcategoryfield->setValue($this->defaultEventCategoryID); } $this->addElement($eventcategoryfield); $this->addElement('text', 'title', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 30)), array('TitleUnique', false, array('title' => '')), ), 'required' => true, 'label' => 'Title:', )); $this->getElement('title')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validate/', 'validate'); $this->addElement('checkbox', 'immediate', array( 'onchange' => 'immediateChanged("immediate", bootosIDs)', 'required' => false, 'label' => 'Immediate Event:', 'value' => array(0,1), )); $this->addElement('checkbox', 'force', array( 'required' => false, 'label' => 'Force event:', 'value' => array(0,1), )); $this->addElement('text', 'start', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 19)), array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), ), 'required' => true, 'label' => 'Start:', 'value' => $this->start, )); $this->addElement('text', 'end', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 19)), array('Date', false, array('format' => 'mm/dd/yyyy h:i a')), array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())), array('EventOverlapping', false, array('poolID' => $this->poolID, 'start' => $this->getElement('start')->getValue())), ), 'required' => false, 'label' => 'End:', 'value' => $this->end, )); $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validate/', 'validate'); $this->addElement('checkbox', 'repeat', array( 'onchange' => 'repeatChanged("repeat")', 'required' => false, 'label' => 'Repeat:', 'value'=>array(0,1), )); $repeattypefield = $this->createElement('select','repeattype'); $repeattypefield ->setLabel('Repeat Type:'); if(count($this->repeattypelist)>0){ foreach($this->repeattypelist as $type => $t){ $title = $t->getTitle(); $id = $t->getID(); $repeattypefield->addMultiOption($id, $title); } } $repeattypefield->setRegisterInArrayValidator(false); $this->addElement($repeattypefield); $repeatendfield = $this->createElement('select','repeatend'); $repeatendfield ->setLabel('Repeat End:'); if(count($this->repeatendlist)>0){ foreach($this->repeatendlist as $end => $e){ $title = $e->getTitle(); $id = $e->getID(); $repeatendfield->addMultiOption($id, $title); } } $repeatendfield->setRegisterInArrayValidator(false); $repeatendfield->setAttrib('onchange', 'repeatendChanged("repeatend");'); $this->addElement($repeatendfield); $this->addElement('text', 'repeatdate', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 19)), ), 'required' => false, 'label' => 'Repeat End Date:', 'value' => 'mm/dd/yyyy h:min am/pm', )); $this->addElement('text', 'repeatings', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 5)), ), 'required' => false, 'label' => 'Repeatings:', 'value' => '1', )); $this->addElement('text', 'participants', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 40)), ), 'required' => false, 'label' => 'Participants:', )); $this->addElement('text', 'note', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 140)), ), 'required' => false, 'label' => 'Note:', )); if(!isset($this->poolID)) { $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); $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->setAttrib('onchange', "bootosfieldChanged('pbs_bootosID', bootosIDs);"); $this->addElement($bootosfield); foreach($this->configlist as $id => $bootosConfigs) { $configfield = $this->createElement('select','pbs_configID_' . $id); $configfield->setLabel('Config:'); if(count($bootosConfigs)>0){ foreach($bootosConfigs as $config => $c){ $configfield->addMultiOption($c->getID(), $c->getTitle()); } $configfield->setRegisterInArrayValidator(false); $this->addElement($configfield); } } $this->addElement('submit', 'add', array( 'required' => false, 'ignore' => true, 'label' => 'Create Event' )); $this->addElement('button', 'cancel', array( 'required' => false, 'ignore' => true, 'label' => 'Cancel', 'onclick' => 'location.href="/event/"', )); } }