diff options
| author | Simon | 2011-03-14 13:18:21 +0100 |
|---|---|---|
| committer | Simon | 2011-03-14 13:18:21 +0100 |
| commit | c4ab2b2f9a88409fbd78325a4d2c19fcb4ed340c (patch) | |
| tree | a2e6fe7eaa589ad71b4df87d74809c03ff80e403 /application/controllers/SessionController.php | |
| parent | Resource an alphasession angepasst (diff) | |
| download | pbs2-c4ab2b2f9a88409fbd78325a4d2c19fcb4ed340c.tar.gz pbs2-c4ab2b2f9a88409fbd78325a4d2c19fcb4ed340c.tar.xz pbs2-c4ab2b2f9a88409fbd78325a4d2c19fcb4ed340c.zip | |
Membership in Session eingefügt, Filtertypes nur einmal per Script einfügen, auskommentierten Code entfernt
Diffstat (limited to 'application/controllers/SessionController.php')
| -rw-r--r-- | application/controllers/SessionController.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/application/controllers/SessionController.php b/application/controllers/SessionController.php index bf318a0..ddb6fac 100644 --- a/application/controllers/SessionController.php +++ b/application/controllers/SessionController.php @@ -35,9 +35,12 @@ class SessionController extends Zend_Controller_Action $bmem = new Application_Model_BootMenuEntriesMapper(); $bootmenuentries = $bmem->fetchAll(); + $mm = new Application_Model_MembershipMapper(); + $memberships = $mm->fetchAll(); + if (!isset($_POST["add"])){ - $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships)); $this->view->createsession = $createsession; }else { // TODO extend with normal function not only with post @@ -67,6 +70,9 @@ class SessionController extends Zend_Controller_Action if($session->getBootmenuentryID() == ''){ $session->setBootmenuentryID(null); } + if($session->getMembershipID() == ''){ + $session->setMembershipID(null); + } $sessionmapper = new Application_Model_SessionMapper(); $sessionmapper->save($session); @@ -93,6 +99,9 @@ class SessionController extends Zend_Controller_Action $bmem = new Application_Model_BootMenuEntriesMapper(); $bootmenuentries = $bmem->fetchAll(); + + $mm = new Application_Model_MembershipMapper(); + $memberships = $mm->fetchAll(); if (!isset($_POST["add"])){ // TODO: ACL implementieren ob er editieren darf @@ -106,7 +115,7 @@ class SessionController extends Zend_Controller_Action $session2 = $session->toArray(); #print_a($session2); - $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships)); $editsession->populate($session2); $this->view->editsession = $editsession; }catch (Zend_Exception $e) { @@ -117,7 +126,7 @@ class SessionController extends Zend_Controller_Action try{ $sessionID = $this->_request->getParam('sessionID'); - $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships),$_POST); if ($editsession->isValid($_POST)) { $session = new Application_Model_Session($_POST); @@ -132,6 +141,9 @@ class SessionController extends Zend_Controller_Action if($session->getBootmenuentryID() == ''){ $session->setBootmenuentryID(null); } + if($session->getMembershipID() == ''){ + $session->setMembershipID(null); + } $sessionmapper = new Application_Model_SessionMapper(); $sessionmapper->save($session); echo 'valid'; |
