summaryrefslogtreecommitdiffstats
path: root/application/modules/user
diff options
context:
space:
mode:
authorSimon2011-03-19 10:32:19 +0100
committerSimon2011-03-19 10:32:19 +0100
commit4dedc8c5b49466b82cf453536b3f224d57a0c710 (patch)
tree846db54e9c1661fbbc42df3f73eab79d6e690f2e /application/modules/user
parentFilterEvaluate an Session angepasst (diff)
downloadpbs2-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')
-rw-r--r--application/modules/user/controllers/AuthController.php10
-rw-r--r--application/modules/user/controllers/ClientController.php4
-rw-r--r--application/modules/user/controllers/PoolController.php15
3 files changed, 20 insertions, 9 deletions
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php
index 76dc243..80a411d 100644
--- a/application/modules/user/controllers/AuthController.php
+++ b/application/modules/user/controllers/AuthController.php
@@ -11,7 +11,15 @@ class User_AuthController extends Zend_Controller_Action
public function indexAction()
{
// action body
- $_SESSION['membershipID'] = 1;
+ $membershipID = $this->_request->getParam('membershipID');
+ if($membershipID == ''){
+ $_SESSION['membershipID'] = 1;
+ }
+ else{
+ $_SESSION['membershipID'] = $membershipID;
+ }
+ $pbsNotifier = new Pbs_Notifier();
+ echo $pbsNotifier->notify("membershipID is set to ".$_SESSION['membershipID'],'ok');
}
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index 4bb2b35..d3d7573 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -38,7 +38,7 @@ class User_ClientController extends Zend_Controller_Action
$clientMapper = new Application_Model_ClientMapper();
$clientsInGroup = $clientMapper->findBy('groupID',$this->membership->getGroupID());
- # print_a($clientsInGroup);
+ #print_a($clientsInGroup);
$this->view->clients = $clientsInGroup;
@@ -67,7 +67,7 @@ class User_ClientController extends Zend_Controller_Action
$client->setGroupID($this->membership->getGroupID());
$clientmapper = new Application_Model_ClientMapper();
$clientmapper->save($client);
- $this->_redirect('/user/client/addresult/ok');
+ $this->_redirect('/user/client/index/addresult/ok');
}
$this->view->addclient = $addclient;
}
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;
}