summaryrefslogtreecommitdiffstats
path: root/application/controllers/PoolController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/PoolController.php')
-rw-r--r--application/controllers/PoolController.php19
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'));