summaryrefslogtreecommitdiffstats
path: root/application/controllers/BootmenuController.php
diff options
context:
space:
mode:
authormichael pereira2011-03-09 11:55:55 +0100
committermichael pereira2011-03-09 11:55:55 +0100
commit52304b789d93e1745c0f6ad6cbe833bbc4e37ba2 (patch)
treedf3ef4566129c4f1cdb3fc5410093c2b83900993 /application/controllers/BootmenuController.php
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-52304b789d93e1745c0f6ad6cbe833bbc4e37ba2.tar.gz
pbs2-52304b789d93e1745c0f6ad6cbe833bbc4e37ba2.tar.xz
pbs2-52304b789d93e1745c0f6ad6cbe833bbc4e37ba2.zip
ACHTUNG: Habe in einigen Mappern die find() Methode geändert, sie liefern jetzt ein Object des Models zurück und nehmen als Parameter die ID! (Group, Config, Membership, Person, u.a.) || Alle Controller soweit fertig
Diffstat (limited to 'application/controllers/BootmenuController.php')
-rw-r--r--application/controllers/BootmenuController.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/application/controllers/BootmenuController.php b/application/controllers/BootmenuController.php
index 41cee9d..239aa4f 100644
--- a/application/controllers/BootmenuController.php
+++ b/application/controllers/BootmenuController.php
@@ -13,13 +13,20 @@ class BootmenuController extends Zend_Controller_Action
$bootmenumapper = new Application_Model_BootMenuMapper();
$bootmenuentriesmapper = new Application_Model_BootMenuEntriesMapper();
$bootosmapper = new Application_Model_BootOsMapper();
+ $configmapper = new Application_Model_ConfigMapper();
+ $membershipmapper = new Application_Model_MembershipMapper();
+ $groupmapper = new Application_Model_GroupMapper();
+ $personmapper = new Application_Model_PersonMapper();
$this->view->bootosmapper = $bootosmapper;
+ $this->view->configmapper = $configmapper;
$this->view->bootmenulist = $bootmenumapper->fetchAll();
$bootmenuentries = array();
foreach ($this->view->bootmenulist as $bootmenu){
$bootmenuentries[$bootmenu->getID()] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenu->getID());
+ $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle());
+ $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname());
}
$this->view->bootmenuentrylist = $bootmenuentries;
@@ -29,12 +36,13 @@ class BootmenuController extends Zend_Controller_Action
{
$bootmenuID = $this->_request->getParam('bootmenuID');
$bootosmapper = new Application_Model_BootOsMapper();
+ $configmapper = new Application_Model_ConfigMapper();
// $bootmenuentriesmapper = new Application_Model_BootMenuEntriesMapper();
//
// $bootoslist = $this->arrayDiff($bootosmapper->fetchAll(), $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID));
if (!isset($_POST["addbootmenuentry"])){
- $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder')));
+ $addbootmenuentryForm = new Application_Form_BootmenuEntriesAdd(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder'=> $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()));
$addbootmenuentryForm->populate(array('order' => $this->_request->getParam('maxorder')));
} else {
@@ -69,8 +77,10 @@ class BootmenuController extends Zend_Controller_Action
public function createbootmenuAction()
{
+ $groupmapper = new Application_Model_GroupMapper();
+
if (!isset($_POST["createbootmenu"])){
- $createbootmenuForm = new Application_Form_BootmenuCreate();
+ $createbootmenuForm = new Application_Form_BootmenuCreate(array('grouplist' => $groupmapper->fetchAll()));
} else {
$createbootmenuForm = new Application_Form_BootmenuCreate($_POST);
@@ -100,6 +110,8 @@ class BootmenuController extends Zend_Controller_Action
public function editbootmenuAction()
{
$bootmenuID = $this->_request->getParam('bootmenuID');
+ $groupmapper = new Application_Model_GroupMapper();
+
if (!isset($_POST["editbootmenu"])){
$bootmenuID = $this->_request->getParam('bootmenuID');
if (!isset($bootmenuID) || !is_numeric($bootmenuID)){
@@ -109,7 +121,7 @@ class BootmenuController extends Zend_Controller_Action
$bootmenumapper = new Application_Model_BootMenuMapper();
$bootmenumapper->find($bootmenuID, $bootmenu);
- $editbootmenuForm = new Application_Form_BootmenuEdit();
+ $editbootmenuForm = new Application_Form_BootmenuEdit(array('grouplist' => $groupmapper->fetchAll()));
$editbootmenuForm->populate($bootmenu->toArray());
}
}else{
@@ -145,6 +157,7 @@ class BootmenuController extends Zend_Controller_Action
$bootmenuentryID = $this->_request->getParam('bootmenuentryID');
$bootmenuID = $this->_request->getParam('bootmenuID');
$bootosmapper = new Application_Model_BootOsMapper();
+ $configmapper = new Application_Model_ConfigMapper();
$bootmenuentry = new Application_Model_BootMenuEntries();
$bootmenuentrymapper = new Application_Model_BootMenuEntriesMapper();
@@ -156,7 +169,7 @@ class BootmenuController extends Zend_Controller_Action
$bootmenuentrymapper->find($bootmenuentryID, $bootmenuentry);
- $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder')));
+ $editbootmenuentryForm = new Application_Form_BootmenuEntriesEdit(array('bootoslist'=>$bootosmapper->fetchAll(), 'maxorder' => $this->_request->getParam('maxorder'), 'configlist'=>$configmapper->fetchAll()));
$editbootmenuentryForm->populate($bootmenuentry->toArray());
}
}else{