summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/PoolController.php
diff options
context:
space:
mode:
authormichael pereira2011-04-20 18:49:49 +0200
committermichael pereira2011-04-20 18:49:49 +0200
commitcc3660add480ac1dc217d7f853b325db7d6ec7d0 (patch)
tree8056c87777d806c613a607c3f479ce07475b5db6 /application/modules/user/controllers/PoolController.php
parentAPI + Fixes (diff)
parentUrl für Config gekürzt (diff)
downloadpbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.tar.gz
pbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.tar.xz
pbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.zip
merges
Diffstat (limited to 'application/modules/user/controllers/PoolController.php')
-rw-r--r--application/modules/user/controllers/PoolController.php65
1 files changed, 35 insertions, 30 deletions
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index b793d80..3d6a0f5 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -14,7 +14,7 @@ class User_PoolController extends Zend_Controller_Action
{
private $membership;
protected $page;
-
+
public function init()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
@@ -30,14 +30,14 @@ class User_PoolController extends Zend_Controller_Action
} else {
$this->_helper->redirector('login', 'auth');
}
- $this->page = $this->_request->getParam('page');
+ $this->page = $this->_request->getParam('page');
}
public function indexAction()
{
// ACL: is he allowed to see the pools of a group
if(!Pbs_Acl::checkRight('poo'))
- $this->_redirect('/user');
+ $this->_redirect('/user');
$result = $this->_request->getParam('deleteresult');
if($result != ""){
@@ -74,30 +74,30 @@ class User_PoolController extends Zend_Controller_Action
$ff->setID($pool['poolID']);
$yourpools[] = $ff;
}
-
- // Search
+
+ // Search
$search = $this->_request->getParam('search');
$mySearch = new Pbs_Search();
$mySearch->setSearchTerm($search);
$mySearch->setModule('pool');
if($search != ''){
- $this->view->search = $mySearch->getSearchTerm();
- $yourpools = $mySearch->search($yourpools);
+ $this->view->search = $mySearch->getSearchTerm();
+ $yourpools = $mySearch->search($yourpools);
}
$this->view->searchform = $mySearch->searchForm();
-
+
// Pagination
- $pagination = new Pbs_Pagination();
- $pagination->setPerPage(10);
+ $pagination = new Pbs_Pagination();
+ $pagination->setPerPage(10);
$pagination->setElement($yourpools);
- $pagination->setRequestPage($this->_request->getParam('page'));
+ $pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/pool/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
- $yourpools = $pagination->getElements();
-
+ $yourpools = $pagination->getElements();
+
$this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
- $this->view->pools = $yourpools;
-
+ $this->view->pools = $yourpools;
+
// Get all Clients from this group
$clientmapper = new Application_Model_ClientMapper();
@@ -112,12 +112,17 @@ class User_PoolController extends Zend_Controller_Action
// extract the un-assigned clients from the clientlist of the group
$freeclients = $this->arrayDiff($clientsArray,$assignedclientsArray);
-
- if(Pbs_Acl::checkRight('posuc'))
- $this->view->freeclients = $freeclients;
+
+ // Format Time-String
+ foreach($freeclients as $k=>$cig){
+ $freeclients[$k]['created'] = date(Zend_Registry::get('dateformat'),$cig['created']);
+ }
+
+ if(Pbs_Acl::checkRight('posuc'))
+ $this->view->freeclients = $freeclients;
}
-
- public function searchAction(){
+
+ public function searchAction(){
$this->_redirect('/user/pool/index/search/'.($_GET['search']));
}
@@ -125,8 +130,8 @@ class User_PoolController extends Zend_Controller_Action
{
// ACL: is he allowed to create a pool?
if(!Pbs_Acl::checkRight('poc'))
- $this->_redirect('/user');
-
+ $this->_redirect('/user');
+
if (!isset($_POST["add"])){
$addfilterform = new user_Form_Pool(array(
'buttontext' => 'Create Pool',
@@ -155,10 +160,10 @@ class User_PoolController extends Zend_Controller_Action
public function deletepoolAction()
{
$poolID = $this->_request->getParam('poolID');
-
+
// ACL: is he allowed to delete a pool?
if(!Pbs_Acl::checkRight('pod'))
- $this->_redirect('/user');
+ $this->_redirect('/user');
if(is_numeric($poolID)){
$poolmapper = new Application_Model_PoolMapper();
@@ -181,10 +186,10 @@ class User_PoolController extends Zend_Controller_Action
{
// ACL: is he allowed to edit a pool?
if(!Pbs_Acl::checkRight('poe'))
- $this->_redirect('/user');
-
+ $this->_redirect('/user');
+
if (!isset($_POST["add"])){
- $poolID = $this->_request->getParam('poolID');
+ $poolID = $this->_request->getParam('poolID');
$pool = new Application_Model_Pool();
$poolmapper = new Application_Model_PoolMapper();
$poolmapper->find($poolID,$pool);
@@ -236,8 +241,8 @@ class User_PoolController extends Zend_Controller_Action
// ACL: Is he allowed to link clients to pools?
if(!Pbs_Acl::checkRight('polc'))
- $this->_redirect('/user');
-
+ $this->_redirect('/user');
+
if(!isset($_POST['clientID']) && ($clientID == '')){
$clientmapper = new Application_Model_ClientMapper();
$clients = $clientmapper->findBy(array('groupID',$this->membership->getGroupID()),true);
@@ -293,7 +298,7 @@ class User_PoolController extends Zend_Controller_Action
// ACL: Is he allowed to unlink clients from pools?
if(!Pbs_Acl::checkRight('pouc'))
- $this->_redirect('/user');
+ $this->_redirect('/user');
if(is_numeric($poolentriesID)){
$poolentriesMapper = new Application_Model_PoolEntriesMapper();