diff options
| author | Simon | 2011-03-19 10:32:19 +0100 |
|---|---|---|
| committer | Simon | 2011-03-19 10:32:19 +0100 |
| commit | 4dedc8c5b49466b82cf453536b3f224d57a0c710 (patch) | |
| tree | 846db54e9c1661fbbc42df3f73eab79d6e690f2e /application/modules/user/controllers/PoolController.php | |
| parent | FilterEvaluate an Session angepasst (diff) | |
| download | pbs2-4dedc8c5b49466b82cf453536b3f224d57a0c710.tar.gz pbs2-4dedc8c5b49466b82cf453536b3f224d57a0c710.tar.xz pbs2-4dedc8c5b49466b82cf453536b3f224d57a0c710.zip | |
Bei Auth Controller zum testen MembershipID wählbar
Pool zeigt nurnoch freie Clients der eigenen Gruppe an
Diffstat (limited to 'application/modules/user/controllers/PoolController.php')
| -rw-r--r-- | application/modules/user/controllers/PoolController.php | 15 |
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; } |
