summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Neves2012-01-26 19:03:39 +0100
committerMichael Neves2012-01-26 19:03:39 +0100
commitc0fd950d2ae61f8767badce56559731cc4ac9d2c (patch)
tree71bce5bd8f2316d9344a8669139b5367859266f8
parentPreboot add/edit fix (diff)
downloadpbs2-c0fd950d2ae61f8767badce56559731cc4ac9d2c.tar.gz
pbs2-c0fd950d2ae61f8767badce56559731cc4ac9d2c.tar.xz
pbs2-c0fd950d2ae61f8767badce56559731cc4ac9d2c.zip
Bootiso Form
-rw-r--r--application/modules/user/controllers/BootisoController.php19
-rw-r--r--application/modules/user/forms/Bootiso.php6
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());
}