diff options
| author | Simon | 2011-03-11 10:00:40 +0100 |
|---|---|---|
| committer | Simon | 2011-03-11 10:00:40 +0100 |
| commit | abda64d32457744695f91a20feafde3431f9e9e2 (patch) | |
| tree | 3ceac1af1fb7ebd2a1c8fcfce278d3ded9f3d1e4 /application/controllers/PoolController.php | |
| parent | FilterController fixes (diff) | |
| download | pbs2-abda64d32457744695f91a20feafde3431f9e9e2.tar.gz pbs2-abda64d32457744695f91a20feafde3431f9e9e2.tar.xz pbs2-abda64d32457744695f91a20feafde3431f9e9e2.zip | |
AddClientToPool über Formular gefixxt, Buttonbeschriftungen anhand der Action beschriftet
Diffstat (limited to 'application/controllers/PoolController.php')
| -rw-r--r-- | application/controllers/PoolController.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/application/controllers/PoolController.php b/application/controllers/PoolController.php index 7c5092e..f27ee45 100644 --- a/application/controllers/PoolController.php +++ b/application/controllers/PoolController.php @@ -33,10 +33,10 @@ class PoolController extends Zend_Controller_Action public function createpoolAction() { if (!isset($_POST["add"])){ - $addfilterform = new Application_Form_Pool(); + $addfilterform = new Application_Form_Pool(array('buttontext' => 'Create Pool')); $this->view->addpool = $addfilterform; }else { - $addpoolform = new Application_Form_Pool($_POST); + $addpoolform = new Application_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); if ($addpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -75,12 +75,12 @@ class PoolController extends Zend_Controller_Action $poolmapper->find($poolID,$pool); $poolArray = $pool->toArray(); - $editpool = new Application_Form_Pool(); + $editpool = new Application_Form_Pool(array('buttontext' => 'Edit Pool')); $editpool->populate($poolArray); $this->view->editpoolform = $editpool; }else { - $editpoolform = new Application_Form_Pool($_POST); + $editpoolform = new Application_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); if ($editpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -100,24 +100,23 @@ class PoolController extends Zend_Controller_Action { $clientID = $this->_request->getParam('clientID'); $poolID = $this->_request->getParam('poolID'); - - if(!isset($_POST['clientID']) && ($clientID == '' && $poolID == '')){ + if(!isset($_POST['clientID']) && ($clientID == '')){ $clientmapper = new Application_Model_ClientMapper(); $clients = $clientmapper->fetchAll(); foreach($clients as $c){ $clientsArray[] = $c->toArray(); - } + } $assignedclientmapper = new Application_Model_PoolEntriesMapper(); $assignedclients = $assignedclientmapper->fetchAll(); foreach($assignedclients as $c){ $assignedclientsArray[] = $c->toArray(); } $freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray); - - $poolclient = new Application_Form_PoolClient(array('clients'=> $freeclients)); + + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); $this->view->poolclient = $poolclient; }else { - $poolclient = new Application_Form_PoolClient($_POST); + $poolclient = new Application_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); try{ $pool = new Application_Model_PoolEntries($_POST); $pool->setPoolID($this->_request->getParam('poolID')); |
