Skip to content

Commit

Permalink
Moving the cached EIS Record to the Person/External Identity subnavig…
Browse files Browse the repository at this point in the history
…ation (CFM-363)
  • Loading branch information
arlen committed Feb 13, 2024
1 parent 3c80ef2 commit f2d06d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/templates/ExtIdentitySourceRecords/fields-nav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
*/

$topLinks = [];
if(!empty($vv_obj->external_identity_id)) {
if(!empty($vv_obj->external_identity->id)) {
$topLinks[] = [
'icon' => 'visibility',
'order' => 'Default',
'label' => __d('operation', 'view.a', [__d('controller', 'ExternalIdentities', [1])]),
'link' => [
'controller' => 'external_identities',
'action' => 'view',
$vv_obj->external_identity_id
$vv_obj->external_identity->id
]
];

$topLinks[] = [
'icon' => 'visibility',
'order' => 'Default',
Expand All @@ -50,16 +51,15 @@ if(!empty($vv_obj->external_identity_id)) {
]
]
];

// primary name: $vv_obj->external_identity->person->primary_name->full_name

$subnav = [
'name' => 'person',
'active' => 'external_identities',
'subActive' => 'external_identity_roles',
'subActive' => 'external_identity_source_record',
'tabsId' => $vv_obj->external_identity->person->id,
'tabsController' => 'people',
'subTabsId' => $vv_obj->external_identity->id,
'subTabsController' => 'external_identities',
'tabsSupertitle' => $vv_obj->external_identity->description
'tabsSupertitle' => $vv_obj->external_identity->person->primary_name->full_name
];
}
32 changes: 32 additions & 0 deletions app/templates/element/subnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@
$curId = $this->request->getQuery($vv_primary_link);
if(!empty($subTabsId)) {
$curId = $subTabsId;
$linkFilter = ['external_identity_id' => $curId];
} elseif(!empty($vv_ei_id)) {
$curId = $vv_ei_id;
$linkFilter = ['external_identity_id' => $curId];
Expand Down Expand Up @@ -430,10 +431,41 @@
);
?>
</li>
<?php /* XXX We'd like to include "Source Record" (pointing at the cached External Identity Source Record)
in the External Identity subnavigation, but to persist it, we need to know how to get to
the EIS Record from the External Identity Roles screens as well. For now, we'll keep a link to
the cached record as just a topLink. Keep this block here for now in case we revisit this choice.
// XXX need a test for the existence of the Source Record here also.
<li class="list-inline-item">
<?php
// External Identity Source Record (cached)
$linkClass = ($subActive == 'external_identity_source_record') ? 'nav-link active' : 'nav-link';
if($curController == 'ExternalIdentities' && ($curAction == 'edit' || $curAction == 'view')) {
$curId = $vv_obj->ext_identity_source_record->id;
} else {
$curId = $vv_obj->id;
}
print $this->Html->link(
__d('field', 'source_record'),
[ 'controller' => 'ext_identity_source_records',
'action' => 'view',
$curId
],
['class' => $linkClass]
);
?>
</li>
*/ ?>
<?php endif; ?>
<?php endif; // person subnav ?>
</ul>
</nav>

<?php endif; // end $isExternalId ?>
</div>

<?php
// print '<div style="white-space: pre;">';
// print print_r(get_defined_vars());
// print '</div>';
?>

0 comments on commit f2d06d0

Please sign in to comment.