Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] r372 - in registry/trunk/app: Controller View/CoPeople View/OrgIdentities

Subject: COmanage Developers List

List archive

[comanage-dev] r372 - in registry/trunk/app: Controller View/CoPeople View/OrgIdentities


Chronological Thread 
  • From:
  • To:
  • Subject: [comanage-dev] r372 - in registry/trunk/app: Controller View/CoPeople View/OrgIdentities
  • Date: Fri, 28 Sep 2012 08:18:51 -0400

Author: marie
Date: 2012-09-28 08:18:51 -0400 (Fri, 28 Sep 2012)
New Revision: 372

Modified:
registry/trunk/app/Controller/AddressesController.php
registry/trunk/app/Controller/AppController.php
registry/trunk/app/Controller/CoGroupMembersController.php
registry/trunk/app/Controller/CoGroupsController.php
registry/trunk/app/Controller/EmailAddressesController.php
registry/trunk/app/Controller/IdentifiersController.php
registry/trunk/app/Controller/TelephoneNumbersController.php
registry/trunk/app/View/CoPeople/fields.inc
registry/trunk/app/View/OrgIdentities/fields.inc
Log:
co438 redirect to previously open tab on the page after an edit

Modified: registry/trunk/app/Controller/AddressesController.php
===================================================================
--- registry/trunk/app/Controller/AddressesController.php 2012-09-28
10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/AddressesController.php 2012-09-28
12:18:51 UTC (rev 372)
@@ -35,8 +35,38 @@
'line1' => 'asc'
)
);
+ /**
+ * Add an Address Object.
+ * - precondition: Model specific attributes in $this->request->data
(optional)
+ * - postcondition: On success, new Object created
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: $<object>_id or $invalid_fields set (REST)
+ *
+ * @since COmanage Registry v0.1
+ */

+ function add() {
+ $this->redirectTab = 'address';
+
+ parent::add();
+ }
+
/**
+ * Delete an Address Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'address';
+
+ parent::delete($id);
+ }
+
+ /**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: $permissions set with calculated permissions
@@ -118,4 +148,18 @@
$this->set('permissions', $p);
return($p[$this->action]);
}
+
+ /**
+ * Perform a redirect back to the controller's default view.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.7
+ */
+
+ function performRedirect() {
+
+ $this->redirectTab = 'address';
+
+ parent::performRedirect();
+ }
}

Modified: registry/trunk/app/Controller/AppController.php
===================================================================
--- registry/trunk/app/Controller/AppController.php 2012-09-28 10:50:00
UTC (rev 371)
+++ registry/trunk/app/Controller/AppController.php 2012-09-28 12:18:51
UTC (rev 372)
@@ -202,7 +202,6 @@
* - apiuser: Valid API (REST) user (for now, API users are equivalent to
cmadmins)
* - orgidentityid: Org Identity ID of current user (or false)
* - copersonid: CO Person ID of current user in current CO (or false)
- * @todo XXX Rewrite to use Model/CoRole authz calls
*/

public function calculateCMRoles() {
@@ -472,6 +471,11 @@
elseif(!empty($this->request->data[$req]['co_id']))
$co = $this->request->data[$req]['co_id'];

+ if($this->redirectTab != null)
+ {
+ $redirect['tab'] = $this->redirectTab;
+ }
+
if($copid != null)
{
$redirect['controller'] = 'co_people';
@@ -571,6 +575,11 @@
}
}

+ // Add in tab for pages that have tabbed redirects
+ if(isset($this->params['named']['tab']))
+ {
+ $redirect['tab'] = $this->params['named']['tab'];
+ }
$this->set('redirect', $redirect);
}


Modified: registry/trunk/app/Controller/CoGroupMembersController.php
===================================================================
--- registry/trunk/app/Controller/CoGroupMembersController.php 2012-09-28
10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/CoGroupMembersController.php 2012-09-28
12:18:51 UTC (rev 372)
@@ -204,8 +204,23 @@

return(true);
}
-
+
/**
+ * Delete a Co Group Members Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'group';
+
+ parent::delete($id);
+ }
+
+ /**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: $permissions set with calculated permissions
@@ -292,17 +307,23 @@

if(isset($cop))
{
- $this->redirect(array('controller' => 'co_people',
- 'action' => 'edit',
- $cop,
- 'co' => $this->cur_co['Co']['id']));
+ $params = array('controller' => 'co_people',
+ 'action' => 'edit',
+ $cop,
+ 'co' => $this->cur_co['Co']['id'],
+ 'tab' => 'group'
+ );
+ $this->redirect($params);
}
else
{
- $this->redirect(array('controller' => 'co_groups',
- 'action' => 'edit',
-
$this->request->data['CoGroupMember']['co_group_id'],
- 'co' => $this->cur_co['Co']['id']));
+ $params = array('controller' => 'co_groups',
+ 'action' => 'edit',
+ $this->request->data['CoGroupMember']['co_group_id'],
+ 'co' => $this->cur_co['Co']['id'],
+ 'tab' => 'group'
+ );
+ $this->redirect($params);
}
}


Modified: registry/trunk/app/Controller/CoGroupsController.php
===================================================================
--- registry/trunk/app/Controller/CoGroupsController.php 2012-09-28
10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/CoGroupsController.php 2012-09-28
12:18:51 UTC (rev 372)
@@ -134,6 +134,21 @@
}

/**
+ * Delete an Group Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'group';
+
+ parent::delete($id);
+ }
+
+ /**
* Update a CO Group.
* - precondition: Model specific attributes in $this->request->data
(optional)
* - precondition: <id> must exist
@@ -360,4 +375,19 @@
// Invoke the StandardController view
parent::view($id);
}
+
+ /**
+ * Perform a redirect back to the controller's default view.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.7
+ */
+
+ function performRedirect() {
+
+ $this->redirectTab = 'group';
+
+ parent::performRedirect();
+ }
+
}

Modified: registry/trunk/app/Controller/EmailAddressesController.php
===================================================================
--- registry/trunk/app/Controller/EmailAddressesController.php 2012-09-28
10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/EmailAddressesController.php 2012-09-28
12:18:51 UTC (rev 372)
@@ -35,8 +35,23 @@
'mail' => 'asc'
)
);
-
+
/**
+ * Delete an Email Address Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'email';
+
+ parent::delete($id);
+ }
+
+ /**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: $permissions set with calculated permissions
@@ -90,4 +105,17 @@
$this->set('permissions', $p);
return($p[$this->action]);
}
+
+ /**
+ * Perform a redirect back to the controller's default view.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.7
+ */
+
+ function performRedirect() {
+ $this->redirectTab = 'email';
+
+ parent::performRedirect();
+ }
}

Modified: registry/trunk/app/Controller/IdentifiersController.php
===================================================================
--- registry/trunk/app/Controller/IdentifiersController.php 2012-09-28
10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/IdentifiersController.php 2012-09-28
12:18:51 UTC (rev 372)
@@ -219,8 +219,23 @@

return true;
}
-
+
/**
+ * Delete an Identifiers Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'id';
+
+ parent::delete($id);
+ }
+
+ /**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
* - postcondition: $permissions set with calculated permissions
@@ -269,4 +284,19 @@
$this->set('permissions', $p);
return($p[$this->action]);
}
+
+ /**
+ * Perform a redirect back to the controller's default view.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.7
+ */
+
+ function performRedirect() {
+
+ $this->redirectTab = 'id';
+
+ parent::performRedirect();
+ }
+
}

Modified: registry/trunk/app/Controller/TelephoneNumbersController.php
===================================================================
--- registry/trunk/app/Controller/TelephoneNumbersController.php
2012-09-28 10:50:00 UTC (rev 371)
+++ registry/trunk/app/Controller/TelephoneNumbersController.php
2012-09-28 12:18:51 UTC (rev 372)
@@ -35,7 +35,38 @@
'number' => 'asc'
)
);
+
+ /**
+ * Add a Telephone Number Object.
+ * - precondition: Model specific attributes in $this->request->data
(optional)
+ * - postcondition: On success, new Object created
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: $<object>_id or $invalid_fields set (REST)
+ *
+ * @since COmanage Registry v0.1
+ */

+ function add() {
+ $this->redirectTab = 'phone';
+
+ parent::add();
+ }
+
+ /**
+ * Delete an Telephone Number Object
+ * - precondition: <id> must exist
+ * - postcondition: Session flash message updated (HTML) or HTTP status
returned (REST)
+ * - postcondition: On success, all related data (any table with an
<object>_id column) is deleted
+ *
+ * @since COmanage Registry v0.7
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ $this->redirectTab = 'phone';
+
+ parent::delete($id);
+ }
+
/**
* Authorization for this Controller, called by Auth component
* - precondition: Session.Auth holds data used for authz decisions
@@ -118,4 +149,19 @@
$this->set('permissions', $p);
return($p[$this->action]);
}
+
+ /**
+ * Perform a redirect back to the controller's default view.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.7
+ */
+
+ function performRedirect() {
+
+ $this->redirectTab = 'phone';
+
+ parent::performRedirect();
+ }
+
}

Modified: registry/trunk/app/View/CoPeople/fields.inc
===================================================================
--- registry/trunk/app/View/CoPeople/fields.inc 2012-09-28 10:50:00 UTC (rev
371)
+++ registry/trunk/app/View/CoPeople/fields.inc 2012-09-28 12:18:51 UTC (rev
372)
@@ -43,13 +43,22 @@
if(!$e && !$permissions['view'])
return(false);

- print $this->Html->link(_txt('op.back'),
- array('controller' => 'co_people', 'action' =>
'index', 'co' => $cur_co['Co']['id']),
- array('class' => 'backbutton'));
-
- if($this->action != "invite") {
- if($e) {
- // If demographics data does not exist, demographics controller will
redirect to add
+ if($e)
+ {
+ print $this->Html->link(_txt('op.back'),
+ array('controller' => 'co_people', 'action' =>
'index', 'co' => $cur_co['Co']['id']),
+ array('class' => 'cancelbutton'));
+
+ if($this->action != "invite")
+ {
+ print $this->Html->link(_txt('ct.org_identities.1'),
+ array('controller' => 'org_identities',
+ 'action' => ($e && !$es ? 'edit' : 'view'),
+
$co_people[0]['CoOrgIdentityLink'][0]['org_identity_id'],
+ 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id'])),
+ array('class' => 'linkbutton'));
+
+ // If demographics data does not exist, demographics controller will
redirect to add
$args = array('controller' => 'co_nsf_demographics',
'action' => 'editself',
'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']));
@@ -79,19 +88,34 @@
echo $this->Form->hidden('status', array('default' => 'P')). "\n";
}

- // View History button
- if($this->action != "add") {
- print $this->Html->link(
- _txt('op.history'),
- array(
- 'controller' => 'history_records',
- 'action' => 'index',
- 'copersonid' => $co_people[0]['CoPerson']['id']
- ),
- array('class' => 'historybutton')
- );
- }
+ // Populate the cross reference
+ print $this->Form->hidden('CoPerson.co_id', array('default' =>
$cur_co['Co']['id'])). "\n";
+ print $this->Form->hidden('CoOrgIdentityLink.0.id'). "\n";
+ print $this->Form->hidden('CoOrgIdentityLink.0.org_identity_id',
array('default' =>
$co_people[0]['CoOrgIdentityLink'][0]['org_identity_id'])). "\n";
+ // Default status is 'Pending'
+ echo $this->Form->hidden('status', array('default' => 'P')). "\n";
}
+ else
+ {
+ // Back button
+ print $this->Html->link(_txt('op.back'),
+ array('controller' => 'co_people', 'action' =>
'index', 'co' => $cur_co['Co']['id']),
+ array('class' => 'backbutton'));
+ }
+
+ // View History button
+ if($this->action != "add" && $this->action != "invite") {
+ print $this->Html->link(
+ _txt('op.history'),
+ array(
+ 'controller' => 'history_records',
+ 'action' => 'index',
+ 'copersonid' => $co_people[0]['CoPerson']['id']
+ ),
+ array('class' => 'historybutton')
+ );
+ }
+

// Line number, for rendering
$l = 1;
@@ -124,10 +148,16 @@
$('#dialog').dialog('open');
}

+$(function() {
// Turn on Tabs
- $(function() {
- $( "#tabs" ).tabs();
- });
+ var $tabs = $( "#tabs" ).tabs();
+
+ // If returning to this page via redirect, open last used tab
+ <?php if(isset($this->request->params['named']['tab'])): ?>
+ var selectedtab = "<?php print($this->request->params['named']['tab']);
?>";
+ $tabs.tabs('select', '#tabs-' + selectedtab );
+ <?php endif; ?>
+});
</script>

<div id="<?php print $this->action; ?>_co_person" style=" float:left;
height:auto;">
@@ -275,8 +305,12 @@
<div style="clear:both;"></div>
</div> <!-- tabs-name -->
<?php if($this->action != "invite"): ?>
- <div id="tabs-id">
- <div style="float:left">
+ <div id="tabs-id" >
+ <?php print '<div style="float:left;';
+ if($this->action != 'compare')
+ print 'width:100%;" class="additionalinfo';
+ print '">';
+ ?>
<table>
<tbody>
<?php if($this->action == "compare"): ?>
@@ -296,22 +330,19 @@
{
foreach($co_people[0]['Identifier'] as $id)
{
- print '<tr class="line';
- print ($l % 2);
- print '">';
- $l++;
- print '<td>';
+ print '<div>';
+ print '<div>';
print $this->Html->link($id['identifier'],
array('controller' => 'identifiers', 'action' => 'edit', $id['id'], 'co' =>
$cur_co['Co']['id']));
print " (" . $id['type'] . ")";
- print '</td>';
- print '<td>';
+ print '</div>';
+ print '<div>';
// XXX we already checked for
$permissions['edit'], but not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' . _txt('op.delete') .
'</a>' . "\n";
print $this->Html->link(_txt('op.edit'),
array('controller' =>
'identifiers', 'action' => 'edit', $id['id'], 'co' => $cur_co['Co']['id']),
array('class' => 'editbutton'));
- print '</td>';
- print '</tr>';
+ print '</div>';
+ print '</div>';
}
}
}
@@ -335,21 +366,15 @@
}
if($e && !$es)
{
- print '<tr>';
- print '<td></td>';
- print '<td>';
-
- $linktarget = array('controller' => 'identifiers',
- 'action' => 'add',
- 'copersonid' =>
$co_people[0]['CoPerson']['id'],
- 'co' => $cur_co['Co']['id']
- );
- $linkparams = array('class' => 'addbutton');
- print $this->Html->link(_txt('op.add'),
- $linktarget,
- $linkparams) . "\n";
- print '</td>';
- print '</tr>';
+ $linktarget = array('controller' => 'identifiers',
+ 'action' => 'add',
+ 'copersonid' =>
$co_people[0]['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']
+ );
+ $linkparams = array('class' => 'addbutton');
+ print $this->Html->link(_txt('op.add'),
+ $linktarget,
+ $linkparams) . "\n";
}
?>
</tbody>
@@ -384,7 +409,11 @@
<?php endif; // compare ?>
</div> <!-- tabs-id -->
<div id="tabs-email">
- <div style="float:left">
+ <?php print '<div style="float:left;';
+ if($this->action != 'compare')
+ print 'width:100%;" class="additionalinfo';
+ print '">';
+ ?>
<table>
<tbody>
<?php if($this->action == "compare"): ?>
@@ -403,24 +432,20 @@
{
foreach($co_people[0]['EmailAddress'] as $ea)
{
- print '<tr class="line';
- print ($l % 2);
- $l++;
- print '">';
- print '<td>';
+ print '<div>';
+ print '<div>';
print $this->Html->link($ea['mail'],
array('controller' => 'email_addresses', 'action' => 'edit', $ea['id'], 'co'
=> $cur_co['Co']['id']));
print " (" . _txt('en.contact', null, $ea['type'])
. ", "
. ($ea['verified'] ?
_txt('fd.email_address.verified') : _txt('fd.email_address.unverified')) .
")<br />\n";
- print '</td>';
-
- print '<td>';
+ print '</div>';
+ print '<div>';
// XXX we already checked for
$permissions['edit'], but not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($ea['mail'])) . '\', \'' .
$this->Html->url(array('controller' => 'email_addresses', 'action' =>
'delete', $ea['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' .
_txt('op.delete') . '</a>' . "\n";
print $this->Html->link(_txt('op.edit'),
array('controller' =>
'email_addresses', 'action' => 'edit', $ea['id'], 'co' =>
$cur_co['Co']['id']),
array('class' =>
'editbutton')) . "\n";
- print '</td>';
- print '</tr>';
+ print '</div>';
+ print '</div>';
}
}
}
@@ -444,22 +469,16 @@
}
if($e)
{
- print '<tr>';
- print '<td></td>';
- print '<td>';
+ $linktarget = array('controller' => 'email_addresses',
+ 'action' => 'add',
+ 'copersonid' =>
$co_people[0]['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']
+ );
+ $linkparams = array('class' => 'addbutton');

- $linktarget = array('controller' => 'email_addresses',
- 'action' => 'add',
- 'copersonid' =>
$co_people[0]['CoPerson']['id'],
- 'co' => $cur_co['Co']['id']
- );
- $linkparams = array('class' => 'addbutton');
-
- print $this->Html->link(_txt('op.add'),
- $linktarget,
- $linkparams);
- print '</td>';
- print '</tr>';
+ print $this->Html->link(_txt('op.add'),
+ $linktarget,
+ $linkparams);
}
?>
</tbody>
@@ -498,7 +517,7 @@
<?php endif; // compare ?>
</div> <!-- tabs-email -->
<div id="tabs-group">
- <div style="float:left;">
+ <div style="float:left;width:100%" class="additionalinfo">
<table>
<?php if($this->action == "compare"): ?>
<tr>
@@ -517,19 +536,15 @@
{
foreach($co_people[0]['CoGroupMember'] as $g)
{
- print '<tr class="line';
- print ($l % 2);
- print '">';
- $l++;
- print '<td>';
+ print '<div>';
+ print '<div>';
print $this->Html->link($g['CoGroup']['name'],
array('controller' => 'co_groups', 'action' => 'edit', $g['co_group_id'],
'co' => $cur_co['Co']['id']));
- print '</td>';
-
- print '<td>';
+ print '</div>';
+ print '<div>';
// XXX we already checked for
$permissions['edit'], but not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') . '" onclick="javascript:js_confirm_delete(\'' .
_jtxt(_txt('fd.group.memin', array(Sanitize::html($g['CoGroup']['name'])))) .
'\', \'' . $this->Html->url(array('controller' => 'co_group_members',
'action' => 'delete', $g['id'], 'CoPersonid' =>
$co_people[0]['CoPerson']['id'], 'co' => $cur_co['Co']['id'])) . '\')";>' .
_txt('op.delete') . '</a>' . "\n";
- print '</td>';
- print '</tr>';
+ print '</div>';
+ print '</div>';
}
}
}
@@ -555,28 +570,20 @@
{
if($e && !$es) // XXX !$es is probably the wrong permission
here
{
- print '<tr>';
- print '<td></td>';
- print '<td>';
-
- $linktarget = array('controller' => 'co_groups',
- 'action' => 'select',
- 'copersonid' =>
$co_people[0]['CoPerson']['id'],
- 'co' => $cur_co['Co']['id']
- );
- $linkparams = array('class' => 'addbutton');
- print $this->Html->link(_txt('op.add'),
- $linktarget,
- $linkparams) . "\n";
- print '</td>';
- print '</tr>';
- }
+ $linktarget = array('controller' => 'co_groups',
+ 'action' => 'select',
+ 'copersonid' =>
$co_people[0]['CoPerson']['id'],
+ 'co' => $cur_co['Co']['id']
+ );
+ $linkparams = array('class' => 'addbutton');
+ print $this->Html->link(_txt('op.add'),
+ $linktarget,
+ $linkparams) . "\n";
}
+ }
?>
</table>
</div>
- <?php
- ?>
</div> <!-- tabs-group -->
<div id="tabs-role">
<table>

Modified: registry/trunk/app/View/OrgIdentities/fields.inc
===================================================================
--- registry/trunk/app/View/OrgIdentities/fields.inc 2012-09-28 10:50:00
UTC (rev 371)
+++ registry/trunk/app/View/OrgIdentities/fields.inc 2012-09-28 12:18:51
UTC (rev 372)
@@ -24,10 +24,16 @@
-->

<script>
-// Turn on Tabs
$(function() {
- $( "#tabs" ).tabs();
- });
+ // Turn on Tabs
+ var $tabs = $( "#tabs" ).tabs();
+
+ // If returning to this page via redirect, open last used tab
+ <?php if(isset($this->request->params['named']['tab'])): ?>
+ var selectedtab = "<?php print($this->request->params['named']['tab']);
?>";
+ $tabs.tabs('select', '#tabs-' + selectedtab );
+ <?php endif; ?>
+});
</script>

<?php
@@ -236,7 +242,7 @@
if($e)
{
print '<div style="float:left; margin:0 10px 0 0;">';
- print $this->Form->submit($submit_label);
+ print $this->Form->submit($submit_label);
print '</div>';
print $this->Html->link(_txt('op.cancel'),
isset($redirect) ? $redirect
@@ -357,15 +363,17 @@
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
print "&nbsp;(" . $id['type'] . ")\n";
print '</div>';
+ print '<div>';

- // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
- print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') . '</a>' . "\n";
- print $this->Html->link(_txt('op.edit'),
- array('controller' => 'identifiers',
- 'action' => 'edit',
- $id['id'],
- 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
- array('class' => 'editbutton')) . "\n";
+ // XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
+ print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($id['identifier'])) . '\', \'' .
$this->Html->url(array('controller' => 'identifiers', 'action' => 'delete',
$id['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') . '</a>' . "\n";
+ print $this->Html->link(_txt('op.edit'),
+ array('controller' => 'identifiers',
+ 'action' => 'edit',
+ $id['id'],
+ 'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])),
+ array('class' => 'editbutton')) . "\n";
+ print '</div>';
print '</div>';
}
}
@@ -375,9 +383,7 @@
'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])
);
- $linkparams = array('class' => 'addbutton',
- 'target' => '_blank'
- );
+ $linkparams = array('class' => 'addbutton');

print $this->Html->link(_txt('op.add'),
$linktarget,
@@ -416,7 +422,7 @@
print "&nbsp;(" . _txt('en.contact', null, $ea['type'])
. ", "
. ($ea['verified'] ? _txt('fd.email_address.verified')
: _txt('fd.email_address.unverified')) . ")";
print '</div>';
-
+ print '<div>';
// XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($ea['mail'])) . '\', \'' .
$this->Html->url(array('controller' => 'email_addresses', 'action' =>
'delete', $ea['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";
print $this->Html->link(_txt('op.edit'),
@@ -425,6 +431,7 @@
$ea['id'],
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
array('class' => 'editbutton')) .
"\n";
+ print '</div>';
print '</div>';
}
}
@@ -434,9 +441,7 @@
'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])
);
- $linkparams = array('class' => 'addbutton',
- 'target' => '_blank'
- );
+ $linkparams = array('class' => 'addbutton');

print $this->Html->link(_txt('op.add'),
$linktarget,
@@ -474,7 +479,7 @@
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])));
print "&nbsp;(" . _txt('en.contact', null, $t['type']) .
")<br />\n";
print '</div>';
-
+ print '<div>';
// XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($t['number'])) . '\', \'' .
$this->Html->url(array('controller' => 'telephone_numbers', 'action' =>
'delete', $t['id'], 'co' => ($pool_org_identities ? false :
$cur_co['Co']['id']))) . '\')";>' . _txt('op.delete') .'</a>' . "\n";

@@ -484,6 +489,7 @@
$t['id'],
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
array('class' => 'editbutton')) .
"\n";
+ print '</div>';
print '</div>';
}
}
@@ -493,9 +499,7 @@
'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])
);
- $linkparams = array('class' => 'addbutton',
- 'target' => '_blank'
- );
+ $linkparams = array('class' => 'addbutton');

print $this->Html->link(_txt('op.add'),
$linktarget,
@@ -532,7 +536,7 @@
'co'
=> ($pool_org_identities ? false : $cur_co['Co']['id'])));
print "&nbsp;(" . _txt('en.contact', null,
$addr['type']) . ")<br />\n";
print '</div>';
-
+ print '<div>';
// XXX we already checked for $permissions['edit'], but
not ['delete']... should we?
print '<a class="deletebutton" title="' .
_txt('op.delete') .'" onclick="javascript:js_confirm_delete(\'' .
_jtxt(Sanitize::html($addr['line1'])) . '\', \'' .
$this->Html->url(array('controller' => 'addresses', 'action' => 'delete',
$addr['id'], 'co' => ($pool_org_identities ? false : $cur_co['Co']['id']))) .
'\')";>' . _txt('op.delete') .'</a>' . "\n";

@@ -542,6 +546,7 @@
$addr['id'],
'co' =>
($pool_org_identities ? false : $cur_co['Co']['id'])),
array('class' => 'editbutton')) .
"\n";
+ print '</div>';
print '</div>';
}
}
@@ -551,9 +556,7 @@
'orgidentityid' =>
$org_identities[0]['OrgIdentity']['id'],
'co' => ($pool_org_identities ?
false : $cur_co['Co']['id'])
);
- $linkparams = array('class' => 'addbutton',
- 'target' => '_blank'
- );
+ $linkparams = array('class' => 'addbutton');

print $this->Html->link(_txt('op.add'),
$linktarget,



  • [comanage-dev] r372 - in registry/trunk/app: Controller View/CoPeople View/OrgIdentities, svnlog, 09/28/2012

Archive powered by MHonArc 2.6.16.

Top of Page