From 19d1af16ad8a2fdaa5aa608693b81fa9502e162d Mon Sep 17 00:00:00 2001 From: michael pereira Date: Mon, 21 Mar 2011 10:49:32 +0100 Subject: Preboot Controller eingerichtet --- application/modules/dev/forms/BootisoCreate.php | 35 ++++++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'application/modules/dev/forms/BootisoCreate.php') diff --git a/application/modules/dev/forms/BootisoCreate.php b/application/modules/dev/forms/BootisoCreate.php index 2ecc2d2..097d781 100644 --- a/application/modules/dev/forms/BootisoCreate.php +++ b/application/modules/dev/forms/BootisoCreate.php @@ -4,11 +4,17 @@ class dev_Form_BootisoCreate extends Zend_Form { private $grouplist; + private $prebootlist; public function setGrouplist($grouplist){ $this->grouplist = $grouplist; } + public function setPrebootlist($prebootlist){ + $this->prebootlist = $prebootlist; + + } + public function init() { @@ -35,15 +41,20 @@ class dev_Form_BootisoCreate extends Zend_Form $groupfield->setRegisterInArrayValidator(false); $this->addElement($groupfield); - $this->addElement('text', 'path_fbgui', array( - 'filters' => array('StringTrim'), - 'validators' => array( - array('StringLength', false, array(0, 50)), - ), - 'required' => true, - 'size' => 50, - 'label' => 'Path to FbGui:', - )); + $prebootfield = $this->createElement('select','prebootID'); + $prebootfield ->setLabel('Preboot:'); + + if(count($this->prebootlist)>0){ + foreach($this->prebootlist as $preboot => $p){ + $prebootfield->addMultiOption($p->getID(), $p->getTitle()); + } + } + $prebootfield->setRegisterInArrayValidator(false); + $this->addElement($prebootfield); + + $serial = time(); + for($i=2; $i<14; $i+=3) + $serial = substr($serial,0,$i) .'-'. substr($serial,$i,strlen($serial)); $this->addElement('text', 'serialnumber', array( 'filters' => array('StringTrim'), @@ -53,7 +64,11 @@ class dev_Form_BootisoCreate extends Zend_Form 'required' => true, 'size' => 50, 'label' => 'Serialnumber:', + 'value' => $serial )); + + + $date = new DateTime(); $date->add(new DateInterval('P1Y')); @@ -84,7 +99,7 @@ class dev_Form_BootisoCreate extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/bootiso"' + 'onclick' => 'self.location="/dev/bootiso"' )); } -- cgit v1.2.3-55-g7522