From abda64d32457744695f91a20feafde3431f9e9e2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 11 Mar 2011 10:00:40 +0100 Subject: AddClientToPool über Formular gefixxt, Buttonbeschriftungen anhand der Action beschriftet --- application/controllers/SessionController.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'application/controllers/SessionController.php') diff --git a/application/controllers/SessionController.php b/application/controllers/SessionController.php index 09eadc9..6d0a873 100644 --- a/application/controllers/SessionController.php +++ b/application/controllers/SessionController.php @@ -26,11 +26,11 @@ class SessionController extends Zend_Controller_Action $bootisos = $bi->fetchAll(); if (!isset($_POST["add"])){ - $createsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); $this->view->createsession = $createsession; }else { // TODO extend with normal function not only with post - $createsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); print_a($_POST); if ($createsession->isValid($_POST)) { try{ @@ -49,9 +49,7 @@ class SessionController extends Zend_Controller_Action }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; - } - print_a('saved'); - #$this->_redirect('/session'); + } } $this->view->createsession = $createsession; } @@ -78,7 +76,7 @@ class SessionController extends Zend_Controller_Action $session->setTime(date('d.m.Y H:i',$session->getTime())); $session2 = $session->toArray(); - $editsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos)); $editsession->populate($session2); $this->view->editsession = $editsession; @@ -86,7 +84,7 @@ class SessionController extends Zend_Controller_Action try{ $sessionID = $this->_request->getParam('sessionID'); - $editsession = new Application_Form_Session(array('clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); + $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST); if ($editsession->isValid($_POST)) { $session = new Application_Model_Session($_POST); -- cgit v1.2.3-55-g7522