summaryrefslogtreecommitdiffstats
path: root/application/controllers/BootosController.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/BootosController.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/BootosController.php')
-rw-r--r--application/controllers/BootosController.php23
1 files changed, 21 insertions, 2 deletions
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{