From 52304b789d93e1745c0f6ad6cbe833bbc4e37ba2 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Wed, 9 Mar 2011 11:55:55 +0100 Subject: 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 --- application/controllers/BootosController.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'application/controllers/BootosController.php') diff --git a/application/controllers/BootosController.php b/application/controllers/BootosController.php index a644a5c..d052503 100644 --- a/application/controllers/BootosController.php +++ b/application/controllers/BootosController.php @@ -11,13 +11,30 @@ class BootosController extends Zend_Controller_Action public function indexAction() { $bootosmapper = new Application_Model_BootOsMapper(); + + $groupmapper = new Application_Model_GroupMapper(); + $membershipmapper = new Application_Model_MembershipMapper(); + $personmapper = new Application_Model_PersonMapper(); + $configmapper = new Application_Model_ConfigMapper(); + $this->view->bootoslist = $bootosmapper->fetchAll(); + + foreach ($this->view->bootoslist as $bootos){ + $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupmapper->find($bootos->getGroupID())->getTitle()); + $bootos->setMembershipID("[".$bootos->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootos->getMembershipID())->getPersonID())->getFirstname()); + $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configmapper->find($bootos->getConfigID())->getTitle()); + + } + } public function createbootosAction() { + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); + if (!isset($_POST["createbootos"])){ - $createbootosForm = new Application_Form_BootosCreate(); + $createbootosForm = new Application_Form_BootosCreate(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); } else { $createbootosForm = new Application_Form_BootosCreate($_POST); @@ -49,6 +66,8 @@ class BootosController extends Zend_Controller_Action public function editbootosAction() { $bootosID = $this->_request->getParam('bootosID'); + $groupmapper = new Application_Model_GroupMapper(); + $configmapper = new Application_Model_ConfigMapper(); if (!isset($_POST["editbootos"])){ $bootosID = $this->_request->getParam('bootosID'); @@ -59,7 +78,7 @@ class BootosController extends Zend_Controller_Action $bootosmapper = new Application_Model_BootOsMapper(); $bootos = $bootosmapper->find($bootosID); - $editbootosForm = new Application_Form_BootosEdit(); + $editbootosForm = new Application_Form_BootosEdit(array('grouplist' => $groupmapper->fetchAll() ,'configlist'=>$configmapper->fetchAll())); $editbootosForm->populate($bootos->toArray()); } }else{ -- cgit v1.2.3-55-g7522