summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorSimon2011-03-11 14:30:37 +0100
committerSimon2011-03-11 14:30:37 +0100
commit940cbd31de9954d25268af830557f36f2b63b4ef (patch)
tree0205c1953dc47201ba156a0ba55202aa310c2a7e /application/controllers
parentkorrektur (diff)
downloadpbs2-940cbd31de9954d25268af830557f36f2b63b4ef.tar.gz
pbs2-940cbd31de9954d25268af830557f36f2b63b4ef.tar.xz
pbs2-940cbd31de9954d25268af830557f36f2b63b4ef.zip
Sessionmapper korrigier, alphasession hinzugefügt, BootMenuEntryID geadded
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/SessionController.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/application/controllers/SessionController.php b/application/controllers/SessionController.php
index f21335d..bf318a0 100644
--- a/application/controllers/SessionController.php
+++ b/application/controllers/SessionController.php
@@ -12,7 +12,7 @@ class SessionController extends Zend_Controller_Action
{
$mapper = new Application_Model_SessionMapper();
$this->view->sessions = $mapper->fetchAll();
- print_a($_SESSION);
+ #print_a($_SESSION);
}
private function getUniqueCode($length = "")
{
@@ -32,7 +32,7 @@ class SessionController extends Zend_Controller_Action
$bi = new Application_Model_BootIsoMapper();
$bootisos = $bi->fetchAll();
- $bmem = new Application_Model_SessionMapper();
+ $bmem = new Application_Model_BootMenuEntriesMapper();
$bootmenuentries = $bmem->fetchAll();
@@ -42,7 +42,7 @@ class SessionController extends Zend_Controller_Action
}else {
// TODO extend with normal function not only with post
$createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST);
- print_a($_POST);
+ #print_a($_POST);
if ($createsession->isValid($_POST)) {
try{
$uniqid = $this->getUniqueCode(10);
@@ -64,6 +64,9 @@ class SessionController extends Zend_Controller_Action
if($session->getBootosID() == ''){
$session->setBootosID(null);
}
+ if($session->getBootmenuentryID() == ''){
+ $session->setBootmenuentryID(null);
+ }
$sessionmapper = new Application_Model_SessionMapper();
$sessionmapper->save($session);
@@ -88,23 +91,27 @@ class SessionController extends Zend_Controller_Action
$bi = new Application_Model_BootIsoMapper();
$bootisos = $bi->fetchAll();
- $bmem = new Application_Model_SessionMapper();
+ $bmem = new Application_Model_BootMenuEntriesMapper();
$bootmenuentries = $bmem->fetchAll();
if (!isset($_POST["add"])){
// TODO: ACL implementieren ob er editieren darf
$sessionID = $this->_request->getParam('sessionID');
$session = new Application_Model_Session();
-
+ try{
$sessionmapper = new Application_Model_SessionMapper();
$sessionmapper->find($sessionID,$session);
$session->setTime(date('d.m.Y H:i',$session->getTime()));
$session2 = $session->toArray();
+ #print_a($session2);
$editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos));
$editsession->populate($session2);
$this->view->editsession = $editsession;
+ }catch (Zend_Exception $e) {
+ echo "Error message 2: " . $e->getMessage() . "\n";
+ }
} else{
try{
@@ -122,6 +129,9 @@ class SessionController extends Zend_Controller_Action
if($session->getBootosID() == ''){
$session->setBootosID(null);
}
+ if($session->getBootmenuentryID() == ''){
+ $session->setBootmenuentryID(null);
+ }
$sessionmapper = new Application_Model_SessionMapper();
$sessionmapper->save($session);
echo 'valid';