comanage-dev - [comanage-dev] r373 - registry/trunk/app/Controller
Subject: COmanage Developers List
List archive
- From:
- To:
- Subject: [comanage-dev] r373 - registry/trunk/app/Controller
- Date: Fri, 28 Sep 2012 08:37:03 -0400
Author: marie
Date: 2012-09-28 08:37:03 -0400 (Fri, 28 Sep 2012)
New Revision: 373
Modified:
registry/trunk/app/Controller/CoPersonRolesController.php
registry/trunk/app/Controller/StandardController.php
Log:
co438 redirect to previously open tab on the page after an edit
Modified: registry/trunk/app/Controller/CoPersonRolesController.php
===================================================================
--- registry/trunk/app/Controller/CoPersonRolesController.php 2012-09-28
12:18:51 UTC (rev 372)
+++ registry/trunk/app/Controller/CoPersonRolesController.php 2012-09-28
12:37:03 UTC (rev 373)
@@ -385,12 +385,22 @@
// On add, redirect to edit view again so MVPAs are available.
// For everything else, return to co_people
- if($this->action == 'add')
- $this->redirect(array('action' => 'edit', $this->CoPersonRole->id,
'co' => $this->cur_co['Co']['id']));
- else
- $this->redirect(array('controller' => 'co_people',
- 'action' => 'edit',
-
$this->viewVars['co_people'][0]['CoPerson']['id'],
- 'co' => $this->cur_co['Co']['id']));
+ if($this->action == 'add'){
+ $params = array('action' => 'edit',
+ $this->CoPersonRole->id,
+ 'co' => $this->cur_co['Co']['id'],
+ 'tab' => 'role'
+ );
+ $this->redirect($params);
+ }else
+ {
+ $params = array('controller' => 'co_people',
+ 'action' => 'edit',
+ $this->viewVars['co_people'][0]['CoPerson']['id'],
+ 'co' => $this->cur_co['Co']['id'],
+ 'tab' => 'role'
+ );
+ $this->redirect($params);
+ }
}
}
Modified: registry/trunk/app/Controller/StandardController.php
===================================================================
--- registry/trunk/app/Controller/StandardController.php 2012-09-28
12:18:51 UTC (rev 372)
+++ registry/trunk/app/Controller/StandardController.php 2012-09-28
12:37:03 UTC (rev 373)
@@ -25,7 +25,10 @@
class StandardController extends AppController {
// Placeholder, will get set by index()
public $paginate = array();
-
+
+ // Used for activating tabs on pages; will hold name of tab or NULL
+ public $redirectTab = NULL;
+
/**
* Add a Standard Object.
* - precondition: Model specific attributes in $this->request->data
(optional)
@@ -679,8 +682,19 @@
*/
function performRedirect() {
+ $redirect = $this->viewVars['redirect'];
+
+ // Sets tab to be opened by co_people page via jquery
+ if($this->viewVars['redirect']['controller'] == 'co_people'
+ || $this->viewVars['redirect']['controller'] == 'org_identities'
+ )
+ {
+ if($this->redirectTab)
+ $redirect['tab'] = $this->redirectTab;
+ }
+
if($this->requires_person)
- $this->redirect($this->viewVars['redirect']);
+ $this->redirect($redirect);
if(isset($this->cur_co))
$this->redirect(array('action' => 'index', 'co' =>
Sanitize::html($this->cur_co['Co']['id'])));
else
- [comanage-dev] r373 - registry/trunk/app/Controller, svnlog, 09/28/2012
Archive powered by MHonArc 2.6.16.