summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/PoolController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/user/controllers/PoolController.php')
-rw-r--r--application/modules/user/controllers/PoolController.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index f786aa8..f2829ff 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -45,6 +45,7 @@ class User_PoolController extends Zend_Controller_Action
$this->view->notification = $pbsNotifier->notify('unlink',$result);
}
+ // get all pools from this group
$poolMapper = new Application_Model_PoolMapper();
$pools = $poolMapper->findBy('groupID',$this->membership->getGroupID());
foreach($pools as $pool){
@@ -55,19 +56,21 @@ class User_PoolController extends Zend_Controller_Action
}
$this->view->pools = $yourpools;
+ // Get all Clients from this group
$clientmapper = new Application_Model_ClientMapper();
- $clients = $clientmapper->fetchAll();
- foreach($clients as $c){
- #$client = new Application_Model_Client($c);
- $clientsArray[] = $c->toArray();
- }
+ $clientsArray = $clientmapper->findBy('groupID',$this->membership->getGroupID());
+
+ // Get all assigned Clients
$assignedclientmapper = new Application_Model_PoolEntriesMapper();
$assignedclients = $assignedclientmapper->fetchAll();
foreach($assignedclients as $c){
$assignedclientsArray[] = $c->toArray();
- }
+ }
+
+ // extract the un-assigned clients from the clientlist of the group
$freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray);
+
$this->view->freeclients = $freeclients;
}