diff options
| author | Simon | 2011-03-31 17:41:18 +0200 |
|---|---|---|
| committer | Simon | 2011-03-31 17:41:18 +0200 |
| commit | 173214565587a28da9a851ba1130d6fcc542f912 (patch) | |
| tree | 78b4d2e23efa5c703e3e073fc5325fab90e19314 /application/modules | |
| parent | pagination auf client, pool und filter hinzugefügt (diff) | |
| download | pbs2-173214565587a28da9a851ba1130d6fcc542f912.tar.gz pbs2-173214565587a28da9a851ba1130d6fcc542f912.tar.xz pbs2-173214565587a28da9a851ba1130d6fcc542f912.zip | |
Pagination - Rücksprung von formular auf richtige Seite
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/user/controllers/FilterController.php | 8 | ||||
| -rw-r--r-- | application/modules/user/controllers/PoolController.php | 20 | ||||
| -rw-r--r-- | application/modules/user/forms/Client.php | 2 | ||||
| -rw-r--r-- | application/modules/user/forms/Filter.php | 10 | ||||
| -rw-r--r-- | application/modules/user/forms/FilterEntry.php | 6 | ||||
| -rw-r--r-- | application/modules/user/forms/Pool.php | 2 | ||||
| -rw-r--r-- | application/modules/user/forms/PoolClient.php | 4 |
7 files changed, 34 insertions, 18 deletions
diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php index fb8fd81..eaeaba1 100644 --- a/application/modules/user/controllers/FilterController.php +++ b/application/modules/user/controllers/FilterController.php @@ -91,9 +91,11 @@ class User_FilterController extends Zend_Controller_Action if (!isset($_POST["add"])){ $addfilterform = new user_Form_Filter(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus)); + $addfilterform->setPage($page); $this->view->addfilterform = $addfilterform; }else { $addfilterform = new user_Form_Filter(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST); + $addfilterform->setPage($page); if ($addfilterform->isValid($_POST)) { try{ $newfilter = new Application_Model_Filter($_POST); @@ -173,6 +175,7 @@ class User_FilterController extends Zend_Controller_Action $filter2 = $filter->toArray(); $editfilterform = new user_Form_Filter(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus)); $editfilterform->populate($filter2); + $editfilterform->setPage($page); $this->view->editfilterform = $editfilterform; } else{ @@ -186,6 +189,7 @@ class User_FilterController extends Zend_Controller_Action $filtermapper->find($filterID,$filter); if($filter->getGroupID() == $this->membership->getGroupID()){ $editfilterform = new user_Form_Filter(array('buttontext' => 'Edit Filter','bootmenus'=>$bootmenus),$_POST); + $editfilterform->setPage($page); if ($editfilterform->isValid($_POST)) { $filtermapper = new Application_Model_FilterMapper(); @@ -276,6 +280,7 @@ class User_FilterController extends Zend_Controller_Action 'data' => $_POST )); $addform->populate($_POST); + $addform->setPage($page); $this->view->addform = $addform; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; @@ -286,6 +291,7 @@ class User_FilterController extends Zend_Controller_Action 'selectData' => $selectData, 'data'=>$_POST )); + $addform->setPage($page); if ($addform->isValid($_POST)) { print_a('valid'); $newfilterenty = new Application_Model_FilterEntries(); @@ -346,6 +352,7 @@ class User_FilterController extends Zend_Controller_Action 'selectData' => $selectData, 'data' => $data )); + $editfilterform->setPage($page); $editfilterform->populate($filterentry->toArray()); $this->view->editfilterform = $editfilterform; @@ -364,6 +371,7 @@ class User_FilterController extends Zend_Controller_Action 'selectData' => $selectData, 'data' => $_POST )); + $editfilterform->setPage($page); if ($editfilterform->isValid($_POST)) { $filterentry = new Application_Model_FilterEntries(); $filterentriesmapper = new Application_Model_FilterEntriesMapper(); diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php index 01bf761..5584b85 100644 --- a/application/modules/user/controllers/PoolController.php +++ b/application/modules/user/controllers/PoolController.php @@ -100,12 +100,16 @@ class User_PoolController extends Zend_Controller_Action // ACL: is he allowed to create a pool? if(!Pbs_Acl::checkRight('poc')) $this->_redirect('/user'); - + + $page = $this->_request->getParam('page'); + if (!isset($_POST["add"])){ - $addfilterform = new user_Form_Pool(array('buttontext' => 'Create Pool')); + $addfilterform = new user_Form_Pool(array('buttontext' => 'Create Pool')); + $addfilterform->setPage($page); $this->view->addpool = $addfilterform; }else { - $addpoolform = new user_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); + $addpoolform = new user_Form_Pool(array('buttontext' => 'Create Pool'),$_POST); + $addpoolform->setPage($page); if ($addpoolform->isValid($_POST)) { try{ $pool = new Application_Model_Pool($_POST); @@ -154,15 +158,16 @@ class User_PoolController extends Zend_Controller_Action if(!Pbs_Acl::checkRight('poe')) $this->_redirect('/user'); + $page = $this->_request->getParam('page'); if (!isset($_POST["add"])){ - $poolID = $this->_request->getParam('poolID'); - $page = $this->_request->getParam('page'); + $poolID = $this->_request->getParam('poolID'); $pool = new Application_Model_Pool(); $poolmapper = new Application_Model_PoolMapper(); $poolmapper->find($poolID,$pool); if($pool->getGroupID() == $this->membership->getGroupID()){ $poolArray = $pool->toArray(); $editpool = new user_Form_Pool(array('buttontext' => 'Edit Pool')); + $editpool->setPage($page); $editpool->populate($poolArray); $this->view->editpool = $editpool; } @@ -171,6 +176,7 @@ class User_PoolController extends Zend_Controller_Action } }else { $editpoolform = new user_Form_Pool(array('buttontext' => 'Edit Pool'),$_POST); + $editpoolform->setPage($page); if ($editpoolform->isValid($_POST)) { try{ $poolmapper = new Application_Model_PoolMapper(); @@ -219,9 +225,11 @@ class User_PoolController extends Zend_Controller_Action $freeclients = $this->arrayDiff($clients,$assignedclientsArray); $poolclient = new user_Form_PoolClient(array('buttontext' => 'Link Client','clients'=> $freeclients)); + $poolclient->setPage($page); $this->view->poolclient = $poolclient; }else { - $poolclient = new dev_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); + $poolclient = new user_Form_PoolClient(array('buttontext' => 'Link Client'),$_POST); + $poolclient->setPage($page); try{ $poolID = $this->_request->getParam('poolID'); $poolmapper = new Application_Model_PoolMapper(); diff --git a/application/modules/user/forms/Client.php b/application/modules/user/forms/Client.php index eb9aff6..aa8d478 100644 --- a/application/modules/user/forms/Client.php +++ b/application/modules/user/forms/Client.php @@ -45,7 +45,7 @@ class user_Form_Client extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/client/page/'.$this->page.'"' + 'onclick' => 'self.location="/user/client/index/page/'.$this->page.'"' )); $this->addElement('hidden','page', array( diff --git a/application/modules/user/forms/Filter.php b/application/modules/user/forms/Filter.php index 04679fa..a7a2555 100644 --- a/application/modules/user/forms/Filter.php +++ b/application/modules/user/forms/Filter.php @@ -52,17 +52,13 @@ class user_Form_Filter extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/filter"' + 'onclick' => 'self.location="/user/filter/index/page/'.$this->page.'"' )); $this->addElement('hidden', 'created', array( 'required' => false, 'ignore' => true )); - - $this->addElement('hidden','page', array( - 'value' => $this->page - )); } function setBootmenus($val){ $this->bootmenus = $val; @@ -72,10 +68,6 @@ class user_Form_Filter extends Zend_Form function setButtontext($v){ $this->buttontext = $v; } - private $page; - function setPage($page){ - $this->page = $page; - } diff --git a/application/modules/user/forms/FilterEntry.php b/application/modules/user/forms/FilterEntry.php index c2581c2..33453d7 100644 --- a/application/modules/user/forms/FilterEntry.php +++ b/application/modules/user/forms/FilterEntry.php @@ -330,7 +330,7 @@ class user_Form_FilterEntry extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/filter"' + 'onclick' => 'self.location="/user/filter/index/page/'.$this->page.'"' )); $this->addElement('hidden', 'filterID', array( @@ -355,6 +355,10 @@ class user_Form_FilterEntry extends Zend_Form function setSelectData($v){ $this->selectData = $v; } + private $page; + function setPage($page){ + $this->page = $page; + } } ?> diff --git a/application/modules/user/forms/Pool.php b/application/modules/user/forms/Pool.php index b1c4cbc..055d0a7 100644 --- a/application/modules/user/forms/Pool.php +++ b/application/modules/user/forms/Pool.php @@ -42,7 +42,7 @@ class user_Form_Pool extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/pool/page/'.$this->page.'"' + 'onclick' => 'self.location="/user/pool/index/page/'.$this->page.'"' )); $this->addElement('hidden','page', array( diff --git a/application/modules/user/forms/PoolClient.php b/application/modules/user/forms/PoolClient.php index 52ba7d8..c4c6e7f 100644 --- a/application/modules/user/forms/PoolClient.php +++ b/application/modules/user/forms/PoolClient.php @@ -26,5 +26,9 @@ class user_Form_PoolClient extends Zend_Form $this->clients = $clients; return $this; } + private $buttontext = 'Save'; + function setButtontext($v){ + $this->buttontext = $v; + } } |
