diff options
author | Simon | 2011-04-19 15:43:00 +0200 |
---|---|---|
committer | Simon | 2011-04-19 15:43:00 +0200 |
commit | c31d8e9959efade437fb0a661f6f44329cc74664 (patch) | |
tree | 48afaad36266c251f3df4928ed18d6e09478413c /application/modules/user/controllers/ClientController.php | |
parent | AufgerÀumt und verschoben (diff) | |
download | pbs2-c31d8e9959efade437fb0a661f6f44329cc74664.tar.gz pbs2-c31d8e9959efade437fb0a661f6f44329cc74664.tar.xz pbs2-c31d8e9959efade437fb0a661f6f44329cc74664.zip |
Code autoformatiert
Diffstat (limited to 'application/modules/user/controllers/ClientController.php')
-rw-r--r-- | application/modules/user/controllers/ClientController.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php index 087a7b6..687e910 100644 --- a/application/modules/user/controllers/ClientController.php +++ b/application/modules/user/controllers/ClientController.php @@ -14,7 +14,7 @@ class User_ClientController extends Zend_Controller_Action { private $membership; protected $page; - + public function init() { if (Zend_Auth::getInstance()->hasIdentity()) { @@ -30,14 +30,14 @@ class User_ClientController 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 authorized to see this ? if(!Pbs_Acl::checkRight('clo')) - $this->_redirect('/user'); + $this->_redirect('/user'); // Get the Clients which booted with a bootiso of this group $result = $this->_request->getParam('deleteresult'); @@ -58,26 +58,26 @@ class User_ClientController extends Zend_Controller_Action $clientMapper = new Application_Model_ClientMapper(); $clientsInGroup = $clientMapper->findBy(array('groupID' => $this->membership->getGroupID()),true); - + // Search $search = $this->_request->getParam('search'); $mySearch = new Pbs_Search(); $mySearch->setSearchTerm($search); $mySearch->setModule('client'); if($search != ''){ - $this->view->search = $mySearch->getSearchTerm(); - $clientsInGroup = $mySearch->search($clientsInGroup); + $this->view->search = $mySearch->getSearchTerm(); + $clientsInGroup = $mySearch->search($clientsInGroup); } $this->view->searchform = $mySearch->searchForm(); - + // Pagination - $pagination = new Pbs_Pagination(); - $pagination->setPerPage(10); + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(10); $pagination->setElement($clientsInGroup); - $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/client/index'.((isset($this->view->search))?'/search/'.$this->view->search:'')); - $clientsInGroup = $pagination->getElements(); - + $clientsInGroup = $pagination->getElements(); + $this->view->pagination = $pagination->pagination(); $this->view->page = $pagination->getRequestPage(); $this->view->clients = $clientsInGroup; @@ -94,7 +94,7 @@ class User_ClientController extends Zend_Controller_Action // ACL: is he authorized to create new clients? if(!Pbs_Acl::checkRight('cla')) - $this->_redirect('/user'); + $this->_redirect('/user'); if (!isset($_POST["add"])){ $addclient = new user_Form_Client(array( @@ -102,7 +102,7 @@ class User_ClientController extends Zend_Controller_Action 'page' => $this->page)); $this->view->addclient = $addclient; } - else{ + else{ $addclient = new user_Form_Client(array( 'buttontext' => 'Create Client', 'page' => $this->page),$_POST); @@ -124,11 +124,11 @@ class User_ClientController extends Zend_Controller_Action public function removeclientAction() { $clientID = $this->_request->getParam('clientID'); - + // ACL: is he authorized to delete clients? if(!Pbs_Acl::checkRight('cld')) - $this->_redirect('/user'); - + $this->_redirect('/user'); + $clientMapper = new Application_Model_ClientMapper(); if(is_numeric($clientID)){ $client = new Application_Model_Client(); @@ -148,14 +148,14 @@ class User_ClientController extends Zend_Controller_Action public function editclientAction(){ // ACL: Is he authorized to edit clients ? if(!Pbs_Acl::checkRight('cle')) - $this->_redirect('/user'); + $this->_redirect('/user'); if (!isset($_POST["add"])){ $clientID = $this->_request->getParam('clientID'); $client = new Application_Model_Client(); $mapper = new Application_Model_ClientMapper(); $mapper->find($clientID,$client); - + if($client->getGroupID() == $this->membership->getGroupID()){ $editclient = new user_Form_Client(array( 'buttontext' => 'Edit Client', @@ -173,7 +173,7 @@ class User_ClientController extends Zend_Controller_Action 'page' => $this->page),$_POST); if ($editclient->isValid($_POST) || ($mac != '' && $hh != '') ) { $client = new Application_Model_Client($_POST); - $client->setID($this->_request->getParam('clientID')); + $client->setID($this->_request->getParam('clientID')); $dbclient = new Application_Model_Client(); $clientMapper = new Application_Model_ClientMapper(); |