From c0fd950d2ae61f8767badce56559731cc4ac9d2c Mon Sep 17 00:00:00 2001 From: Michael Neves Date: Thu, 26 Jan 2012 19:03:39 +0100 Subject: Bootiso Form --- .../modules/user/controllers/BootisoController.php | 19 ++++++++++--------- application/modules/user/forms/Bootiso.php | 6 ++---- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php index 7bdeb7c..1d574d2 100644 --- a/application/modules/user/controllers/BootisoController.php +++ b/application/modules/user/controllers/BootisoController.php @@ -181,20 +181,21 @@ class user_BootisoController extends Zend_Controller_Action { $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); $childgroups = count($groupgroupsMapper->getChildGroups($groupID)); - - $prebootMapper = new Application_Model_PreBootMapper(); - $prebootlist = $prebootMapper->findBy(array("groupID" => $groupID)); + + $preboottypeMapper = new Application_Model_PreBootTypeMapper(); + $preboottype = $preboottypeMapper->fetchAll(); + if (!isset($_POST["createbootiso"])) { $bootisoForm = new user_Form_Bootiso(array( 'action' => 'createbootiso', - 'prebootlist' => $prebootlist, + 'preboottype' => $preboottype, 'groupdepth' => $childgroups, 'page' => $this->page)); } else { $bootisoForm = new user_Form_Bootiso(array( 'action' => 'createbootiso', - 'prebootlist' => $prebootlist, + 'preboottype' => $preboottype, 'groupdepth' => $childgroups, 'page' => $this->page), $_POST); @@ -232,8 +233,8 @@ class user_BootisoController extends Zend_Controller_Action { $groupID = $this->membership->getGroupID(); - $prebootMapper = new Application_Model_PreBootMapper(); - $prebootlist = $prebootMapper->findBy(array("groupID" => $groupID)); + $preboottypeMapper = new Application_Model_PreBootTypeMapper(); + $preboottype = $preboottypeMapper->fetchAll(); $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); $childgroups = count($groupgroupsMapper->getChildGroups($groupID)); @@ -248,7 +249,7 @@ class user_BootisoController extends Zend_Controller_Action { $bootisoForm = new user_Form_Bootiso(array( 'action' => 'editbootiso', - 'prebootlist' => $prebootlist, + 'preboottype' => $preboottype, 'groupdepth' => $childgroups, 'page' => $this->page)); $bootisoForm->populate($bootiso->toArray()); @@ -256,7 +257,7 @@ class user_BootisoController extends Zend_Controller_Action { } else { $bootisoForm = new user_Form_Bootiso(array( 'action' => 'editbootiso', - 'prebootlist' => $prebootlist, + 'preboottype' => $preboottype, 'groupdepth' => $childgroups, 'page' => $this->page), $_POST); diff --git a/application/modules/user/forms/Bootiso.php b/application/modules/user/forms/Bootiso.php index a56f360..60a6e5f 100644 --- a/application/modules/user/forms/Bootiso.php +++ b/application/modules/user/forms/Bootiso.php @@ -21,8 +21,8 @@ class user_Form_Bootiso extends Zend_Form { public function setAction($action) { $this->action = $action; } - public function setPrebootlist($prebootlist) { - $this->prebootlist = $prebootlist; + public function setPreboottype($pt) { + $this->preboottype = $pt; } public function setGroupdepth($groupdepth) { $this->groupdepth = $groupdepth; @@ -67,8 +67,6 @@ class user_Form_Bootiso extends Zend_Form { $preboottypefield = $this->createElement('select', 'preboottypeID'); $preboottypefield->setLabel('Type:'); $preboottypefield->setAttrib('readOnly', $meta); - $preboottypefield->setAttrib('onChange', "document.getElementById('".$this->action."').submit();"); - $preboottypefield->setValue($_POST['preboottypeID']); foreach($this->preboottype as $k => $pt) { $preboottypefield->addMultiOption($pt->getID(), $pt->getName()); } -- cgit v1.2.3-55-g7522