diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index dba961a1a..fa0fe170c 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -56,3 +56,6 @@ msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}" msgid "global.records.none" msgstr "There are no records to display." + +msgid "global.title.none" +msgstr "No title" diff --git a/app/resources/locales/en_US/menu.po b/app/resources/locales/en_US/menu.po index 2376b0bf2..f8884c6bc 100644 --- a/app/resources/locales/en_US/menu.po +++ b/app/resources/locales/en_US/menu.po @@ -24,6 +24,9 @@ # Menu Messages +msgid "co.Attributes" +msgstr "Attributes" + msgid "co.configuration" msgstr "Config" diff --git a/app/src/Controller/MVEAController.php b/app/src/Controller/MVEAController.php index 2f2323f9e..7a5fb97f0 100644 --- a/app/src/Controller/MVEAController.php +++ b/app/src/Controller/MVEAController.php @@ -81,7 +81,9 @@ public function beforeRender(\Cake\Event\EventInterface $event) { $this->set('vv_ei_id', $externalIdentity->id); // What's the primary name of the Person? - $this->set('vv_person_name', $Names->primaryName($externalIdentity->person_id)); + $personName = $Names->primaryName($externalIdentity->person_id); + $this->set('vv_person_name', $personName); + $this->set('vv_supertitle', $personName->full_name); $this->set('vv_person_id', $externalIdentity->person_id); break; case 'person_role_id': @@ -92,11 +94,15 @@ public function beforeRender(\Cake\Event\EventInterface $event) { $this->set('vv_person_role_id', $link->value); // Also set a name - $this->set('vv_person_name', $Names->primaryName($roleEntity->person_id)); + $personName = $Names->primaryName($roleEntity->person_id); + $this->set('vv_person_name', $personName); + $this->set('vv_supertitle', $personName->full_name); $this->set('vv_person_id', $roleEntity->person_id); break; case 'person_id': - $this->set('vv_person_name', $Names->primaryName((int)$link->value)); + $personName = $Names->primaryName((int)$link->value); + $this->set('vv_person_name', $personName); + $this->set('vv_supertitle', $personName->full_name); $this->set('vv_person_id', $link->value); break; default; diff --git a/app/src/Controller/StandardController.php b/app/src/Controller/StandardController.php index ada067882..d5a994ce0 100644 --- a/app/src/Controller/StandardController.php +++ b/app/src/Controller/StandardController.php @@ -97,6 +97,12 @@ public function add() { // Default title is add new object $this->set('vv_title', __d('operation', 'add.a', __d('controller', $modelsName, [1]))); + + // Supertitle is normally the display name of the parent object when subnavigation exists. + // Set this here as the fallback default. This value is overriden in MVEAController to hold the + // name of the parent object, not the model name of the current object. + // TODO: set this to a better value for other kinds of child objects (e.g. Group member) + $this->set('vv_supertitle', __d('controller', $modelsName, [1])); // Let the view render $this->render('/Standard/add-edit-view'); @@ -322,6 +328,9 @@ public function edit(string $id) { // We don't use a trait for this since each table will implement different logic $this->set('vv_title', __d('operation', 'edit.ai', $table->generateDisplayField($obj))); + $this->set('vv_supertitle', $table->generateDisplayField($obj)); + // Pass the display field also into subtitle for dealing with External IDs + $this->set('vv_subtitle', $table->generateDisplayField($obj)); } else { // Default view title is edit object display field $field = $table->getDisplayField(); diff --git a/app/templates/AdHocAttributes/columns.inc b/app/templates/AdHocAttributes/columns.inc index 335fb303c..dd2f93b61 100644 --- a/app/templates/AdHocAttributes/columns.inc +++ b/app/templates/AdHocAttributes/columns.inc @@ -37,4 +37,10 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'ad_hoc_attributes' ]; \ No newline at end of file diff --git a/app/templates/AdHocAttributes/fields-nav.inc b/app/templates/AdHocAttributes/fields-nav.inc new file mode 100644 index 000000000..8cddfe107 --- /dev/null +++ b/app/templates/AdHocAttributes/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'ad_hoc_attributes' +]; \ No newline at end of file diff --git a/app/templates/Addresses/columns.inc b/app/templates/Addresses/columns.inc index 50ea05056..257f4b097 100644 --- a/app/templates/Addresses/columns.inc +++ b/app/templates/Addresses/columns.inc @@ -42,3 +42,9 @@ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true ]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'addresses' +]; diff --git a/app/templates/Addresses/fields-nav.inc b/app/templates/Addresses/fields-nav.inc new file mode 100644 index 000000000..08574e5a4 --- /dev/null +++ b/app/templates/Addresses/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'addresses' +]; \ No newline at end of file diff --git a/app/templates/EmailAddresses/columns.inc b/app/templates/EmailAddresses/columns.inc index 0af877b80..da915ca19 100644 --- a/app/templates/EmailAddresses/columns.inc +++ b/app/templates/EmailAddresses/columns.inc @@ -37,4 +37,10 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'email_addresses' ]; \ No newline at end of file diff --git a/app/templates/EmailAddresses/fields-nav.inc b/app/templates/EmailAddresses/fields-nav.inc new file mode 100644 index 000000000..14b677975 --- /dev/null +++ b/app/templates/EmailAddresses/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', // default for person. 'external identities' are special cased + 'subActive' => 'email_addresses' +]; \ No newline at end of file diff --git a/app/templates/ExternalIdentities/columns.inc b/app/templates/ExternalIdentities/columns.inc index d7482c7ee..9bdce03a2 100644 --- a/app/templates/ExternalIdentities/columns.inc +++ b/app/templates/ExternalIdentities/columns.inc @@ -40,4 +40,9 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'external_identities' ]; \ No newline at end of file diff --git a/app/templates/ExternalIdentities/fields-nav.inc b/app/templates/ExternalIdentities/fields-nav.inc new file mode 100644 index 000000000..6ffd1566c --- /dev/null +++ b/app/templates/ExternalIdentities/fields-nav.inc @@ -0,0 +1,49 @@ + 'history', + 'order' => 'Default', + 'label' => __d('operation', 'HistoryRecords'), + 'link' => [ + 'controller' => 'history_records', + 'action' => 'index', + '?' => [ + 'external_identity_id' => $vv_obj->id + ] + ], + 'class' => '' + ] +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'external_identities', + 'subActive' => 'properties' +]; \ No newline at end of file diff --git a/app/templates/ExternalIdentities/fields.inc b/app/templates/ExternalIdentities/fields.inc index 43c4632d0..45904c2a1 100644 --- a/app/templates/ExternalIdentities/fields.inc +++ b/app/templates/ExternalIdentities/fields.inc @@ -32,115 +32,3 @@ if($vv_action == 'add' || $vv_action == 'edit') { print $this->Field->dateControl('date_of_birth', \App\Lib\Enum\DateTypeEnum::DateOnly); } - -// XXX This is a placeholder for canvas... maybe it should become a separate page -// rather than overload fields.inc? - -print $this->Html->link( - __d('controller', 'Names', [99]), - [ 'controller' => 'names', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'EmailAddresses', [99]), - [ 'controller' => 'email_addresses', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'Identifiers', [99]), - [ 'controller' => 'identifiers', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'ExternalIdentityRoles', [99]), - [ 'controller' => 'external_identity_roles', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'HistoryRecords', [99]), - [ 'controller' => 'history_records', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'AdHocAttributes', [99]), - [ 'controller' => 'ad_hoc_attributes', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); -print $this->Html->link( - __d('controller', 'Addresses', [99]), - [ 'controller' => 'addresses', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'TelephoneNumbers', [99]), - [ 'controller' => 'telephone_numbers', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'Urls', [99]), - [ 'controller' => 'urls', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'Pronouns', [99]), - [ 'controller' => 'pronouns', - 'action' => 'index', - '?' => [ - 'external_identity_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); diff --git a/app/templates/ExternalIdentityRoles/columns.inc b/app/templates/ExternalIdentityRoles/columns.inc index 72d853f16..a911ae50b 100644 --- a/app/templates/ExternalIdentityRoles/columns.inc +++ b/app/templates/ExternalIdentityRoles/columns.inc @@ -44,6 +44,12 @@ $indexColumns = [ ] ]; +$subnav = [ + 'name' => 'person', + 'active' => 'external_identities', + 'subActive' => 'external_identity_roles' +]; + $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true diff --git a/app/templates/ExternalIdentityRoles/fields-nav.inc b/app/templates/ExternalIdentityRoles/fields-nav.inc new file mode 100644 index 000000000..9b766b90b --- /dev/null +++ b/app/templates/ExternalIdentityRoles/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'external_identities', + 'subActive' => 'external_identity_roles' +]; \ No newline at end of file diff --git a/app/templates/ExternalIdentityRoles/fields.inc b/app/templates/ExternalIdentityRoles/fields.inc index 15e98947a..e0d159178 100644 --- a/app/templates/ExternalIdentityRoles/fields.inc +++ b/app/templates/ExternalIdentityRoles/fields.inc @@ -48,39 +48,3 @@ if($vv_action == 'add' || $vv_action == 'edit') { print $this->Field->dateControl('valid_through'); } - -// XXX This is a placeholder for canvas... maybe it should become a separate page -// rather than overload fields.inc? - -print $this->Html->link( - __d('controller', 'AdHocAttributes', [99]), - [ 'controller' => 'ad_hoc_attributes', - 'action' => 'index', - '?' => [ - 'external_identity_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'Addresses', [99]), - [ 'controller' => 'addresses', - 'action' => 'index', - '?' => [ - 'external_identity_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'TelephoneNumbers', [99]), - [ 'controller' => 'telephone_numbers', - 'action' => 'index', - '?' => [ - 'external_identity_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); diff --git a/app/templates/GroupMembers/columns.inc b/app/templates/GroupMembers/columns.inc index b1d33928b..4faec634b 100644 --- a/app/templates/GroupMembers/columns.inc +++ b/app/templates/GroupMembers/columns.inc @@ -60,4 +60,9 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'group', + 'active' => 'members' ]; \ No newline at end of file diff --git a/app/templates/GroupMembers/fields-nav.inc b/app/templates/GroupMembers/fields-nav.inc new file mode 100644 index 000000000..1dba6bd0e --- /dev/null +++ b/app/templates/GroupMembers/fields-nav.inc @@ -0,0 +1,34 @@ + 'group', + 'active' => 'members' +]; \ No newline at end of file diff --git a/app/templates/GroupNestings/columns.inc b/app/templates/GroupNestings/columns.inc index 2fa1abbfb..014c4cec8 100644 --- a/app/templates/GroupNestings/columns.inc +++ b/app/templates/GroupNestings/columns.inc @@ -37,4 +37,9 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'group', + 'active' => 'nestings' ]; \ No newline at end of file diff --git a/app/templates/GroupNestings/fields-nav.inc b/app/templates/GroupNestings/fields-nav.inc new file mode 100644 index 000000000..1374feaae --- /dev/null +++ b/app/templates/GroupNestings/fields-nav.inc @@ -0,0 +1,34 @@ + 'group', + 'active' => 'nestings' +]; \ No newline at end of file diff --git a/app/templates/GroupOwners/columns.inc b/app/templates/GroupOwners/columns.inc index e65333f78..efb861e28 100644 --- a/app/templates/GroupOwners/columns.inc +++ b/app/templates/GroupOwners/columns.inc @@ -39,4 +39,9 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'group', + 'active' => 'owners' ]; \ No newline at end of file diff --git a/app/templates/GroupOwners/fields-nav.inc b/app/templates/GroupOwners/fields-nav.inc new file mode 100644 index 000000000..d0dbed97b --- /dev/null +++ b/app/templates/GroupOwners/fields-nav.inc @@ -0,0 +1,34 @@ + 'group', + 'active' => 'owners' +]; \ No newline at end of file diff --git a/app/templates/Groups/fields-nav.inc b/app/templates/Groups/fields-nav.inc index 38d21495f..8f563a9fe 100644 --- a/app/templates/Groups/fields-nav.inc +++ b/app/templates/Groups/fields-nav.inc @@ -25,14 +25,32 @@ * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ +// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc $topLinks = [ [ 'icon' => 'sync', 'order' => 'Default', 'label' => __d('operation', 'reconcile'), 'link' => [ - 'action' => 'reconcile' + 'action' => 'reconcile', + $vv_obj->id + ], + 'class' => '' + ], + [ + 'icon' => 'history', + 'order' => 'Default', + 'label' => __d('operation', 'HistoryRecords'), + 'link' => [ + 'controller' => 'history_records', + 'action' => 'index', + '?' => ['group_id' => $vv_obj->id] ], 'class' => '' ] +]; + +$subnav = [ + 'name' => 'group', + 'active' => 'properties' ]; \ No newline at end of file diff --git a/app/templates/Identifiers/columns.inc b/app/templates/Identifiers/columns.inc index 1eb1d552e..48c82927c 100644 --- a/app/templates/Identifiers/columns.inc +++ b/app/templates/Identifiers/columns.inc @@ -34,11 +34,6 @@ $indexColumns = [ ] ]; -$bulkActions = [ - // TODO: develop bulk actions. For now, use a placeholder. - 'delete' => true -]; - $indexActions = [ [ 'controller' => 'authentication_events', @@ -52,4 +47,15 @@ $indexActions = [ ]; } ] +]; + +$bulkActions = [ + // TODO: develop bulk actions. For now, use a placeholder. + 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'identifiers' ]; \ No newline at end of file diff --git a/app/templates/Identifiers/fields-nav.inc b/app/templates/Identifiers/fields-nav.inc new file mode 100644 index 000000000..bcacd714f --- /dev/null +++ b/app/templates/Identifiers/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'identifiers' +]; \ No newline at end of file diff --git a/app/templates/Names/columns.inc b/app/templates/Names/columns.inc index 0e648e3d4..feeda0cd5 100644 --- a/app/templates/Names/columns.inc +++ b/app/templates/Names/columns.inc @@ -54,4 +54,10 @@ $rowActions = [ // TODO: develop bulk actions. For now, use a placeholder. $bulkActions = [ 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'names' ]; \ No newline at end of file diff --git a/app/templates/Names/fields-nav.inc b/app/templates/Names/fields-nav.inc new file mode 100644 index 000000000..d333f8830 --- /dev/null +++ b/app/templates/Names/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'names' +]; \ No newline at end of file diff --git a/app/templates/People/fields-nav.inc b/app/templates/People/fields-nav.inc new file mode 100644 index 000000000..e54aef215 --- /dev/null +++ b/app/templates/People/fields-nav.inc @@ -0,0 +1,48 @@ + 'history', + 'order' => 'Default', + 'label' => __d('operation', 'HistoryRecords'), + 'link' => [ + 'controller' => 'history_records', + 'action' => 'index', + '?' => [ + 'person_id' => $vv_obj->id + ] + ], + 'class' => '' + ] +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'properties' +]; \ No newline at end of file diff --git a/app/templates/People/fields.inc b/app/templates/People/fields.inc index 9c864588a..4bdb5b69e 100644 --- a/app/templates/People/fields.inc +++ b/app/templates/People/fields.inc @@ -46,130 +46,6 @@ if($vv_action == 'add') { 'names.0.primary_name' => true ]; } elseif($vv_action == 'edit') { - // XXX This is a placeholder for canvas... maybe it should become a separate page - // rather than overload fields.inc? - - print $this->Html->link( - __d('controller', 'Names', [99]), - [ 'controller' => 'names', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'EmailAddresses', [99]), - [ 'controller' => 'email_addresses', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'Identifiers', [99]), - [ 'controller' => 'identifiers', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'PersonRoles', [99]), - [ 'controller' => 'person_roles', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'HistoryRecords', [99]), - [ 'controller' => 'history_records', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'AdHocAttributes', [99]), - [ 'controller' => 'ad_hoc_attributes', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'Addresses', [99]), - [ 'controller' => 'addresses', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'TelephoneNumbers', [99]), - [ 'controller' => 'telephone_numbers', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'Urls', [99]), - [ 'controller' => 'urls', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'Pronouns', [99]), - [ 'controller' => 'pronouns', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - - print $this->Html->link( - __d('controller', 'ExternalIdentities', [99]), - [ 'controller' => 'external-identities', - 'action' => 'index', - '?' => [ - 'person_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] - ); - $a = $vv_obj->extract(['person_role_id', 'person_id']); } diff --git a/app/templates/PersonRoles/columns.inc b/app/templates/PersonRoles/columns.inc index 1637e09e7..17fc028ea 100644 --- a/app/templates/PersonRoles/columns.inc +++ b/app/templates/PersonRoles/columns.inc @@ -51,4 +51,9 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'person_roles' ]; \ No newline at end of file diff --git a/app/templates/PersonRoles/fields-nav.inc b/app/templates/PersonRoles/fields-nav.inc new file mode 100644 index 000000000..e306f822c --- /dev/null +++ b/app/templates/PersonRoles/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'person_roles', + 'subActive' => 'properties' +]; \ No newline at end of file diff --git a/app/templates/PersonRoles/fields.inc b/app/templates/PersonRoles/fields.inc index af8ad74bc..749952f73 100644 --- a/app/templates/PersonRoles/fields.inc +++ b/app/templates/PersonRoles/fields.inc @@ -61,39 +61,3 @@ if($vv_action == 'add' || $vv_action == 'edit') { print $this->Field->dateControl('valid_through'); } - -// XXX This is a placeholder for canvas... maybe it should become a separate page -// rather than overload fields.inc? - -print $this->Html->link( - __d('controller', 'AdHocAttributes', [99]), - [ 'controller' => 'ad_hoc_attributes', - 'action' => 'index', - '?' => [ - 'person_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'Addresses', [99]), - [ 'controller' => 'addresses', - 'action' => 'index', - '?' => [ - 'person_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); - -print $this->Html->link( - __d('controller', 'TelephoneNumbers', [99]), - [ 'controller' => 'telephone_numbers', - 'action' => 'index', - '?' => [ - 'person_role_id' => $vv_obj->id - ] - ], - ['class' => 'linkbutton'] -); diff --git a/app/templates/Pronouns/columns.inc b/app/templates/Pronouns/columns.inc index 92e6e3ddc..3963c2db5 100644 --- a/app/templates/Pronouns/columns.inc +++ b/app/templates/Pronouns/columns.inc @@ -41,4 +41,10 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'pronouns' ]; \ No newline at end of file diff --git a/app/templates/Pronouns/fields-nav.inc b/app/templates/Pronouns/fields-nav.inc new file mode 100644 index 000000000..ff7b40d0f --- /dev/null +++ b/app/templates/Pronouns/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'pronouns' +]; \ No newline at end of file diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index abb41d9a4..cce8353c9 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -37,9 +37,10 @@ // If you're looking to set a custom $vv_title, you might be able to use // generateDisplayField() on the Table instead -// Include subnavigation structures on edit pages -// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of fields-nav.inc into fields.inc. -if($vv_action == 'edit') { +// Include subnavigation structures on add/edit/view pages +// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of fields-nav.inc into fields.inc +// When subnav exists, include on all Edit views and on Add/View for items with a parent. +if($vv_action == 'edit' || !empty($vv_bc_parent_obj) || !empty($vv_primary_link_id)) { if(file_exists(ROOT . DS . "templates" . DS . $modelsName . DS . "fields-nav.inc")) { include(ROOT . DS . "templates" . DS . $modelsName . DS . "fields-nav.inc"); } @@ -51,11 +52,41 @@ if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { $linkFilter = [$vv_primary_link => $this->request->getQuery($vv_primary_link)]; } - ?> -
+ + + + + +
-

+ +

+ + request->getParam('controller') == 'PersonRoles' + || $this->request->getParam('controller') == 'ExternalIdentities' + || $this->request->getParam('controller') == 'ExternalIdentityRoles'): ?> +

+ +

+ +
id; foreach(($topLinks ?? []) as $t) { - if($vv_permissions[ $t['link']['action'] ]) { + // TODO: fix the following test so that cross-model links can exist in top-links (e.g. History Records index) + //if($vv_permissions[ $t['link']['action'] ]) { // We need to inject $linkFilter, but not overwrite any existing query params if(!empty($t['link']['?'])) { $t['link']['?'] = array_merge($t['link']['?'], $linkFilter); @@ -77,7 +109,7 @@ 'url' => $this->Url->build($t['link']), 'label' => $t['label'], ]; - } + //} } // Delete diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 25b49e8d9..3a12f0525 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -58,11 +58,38 @@ if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { $linkFilter = [$vv_primary_link => $this->request->getQuery($vv_primary_link)]; } - ?> -
+ + + + + +
-

+ +

+ + +

+ +

+ +
id; - // Insert actions as per the .inc file - // TODO: create an element or move this to MenuHelper so it can be used by topLinks as well as actions + // Insert actions as per the .inc file + // TODO: create an element or move this to MenuHelper so it can be used by topLinks as well as actions $actionOrderDefault = $this->Menu->getMenuOrder('Default'); foreach($rowActions as $a) { $ok = false; diff --git a/app/templates/TelephoneNumbers/columns.inc b/app/templates/TelephoneNumbers/columns.inc index a8916b276..55289a091 100644 --- a/app/templates/TelephoneNumbers/columns.inc +++ b/app/templates/TelephoneNumbers/columns.inc @@ -37,4 +37,10 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'telephone_numbers' ]; \ No newline at end of file diff --git a/app/templates/TelephoneNumbers/fields-nav.inc b/app/templates/TelephoneNumbers/fields-nav.inc new file mode 100644 index 000000000..267ae0281 --- /dev/null +++ b/app/templates/TelephoneNumbers/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'telephone_numbers' +]; \ No newline at end of file diff --git a/app/templates/Urls/columns.inc b/app/templates/Urls/columns.inc index f7a32778e..5790bff73 100644 --- a/app/templates/Urls/columns.inc +++ b/app/templates/Urls/columns.inc @@ -37,4 +37,10 @@ $indexColumns = [ $bulkActions = [ // TODO: develop bulk actions. For now, use a placeholder. 'delete' => true +]; + +$subnav = [ + 'name' => 'person', + 'active' => 'attributes', + 'subActive' => 'urls' ]; \ No newline at end of file diff --git a/app/templates/Urls/fields-nav.inc b/app/templates/Urls/fields-nav.inc new file mode 100644 index 000000000..8e2ef8f47 --- /dev/null +++ b/app/templates/Urls/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + 'subActive' => 'names' +]; \ No newline at end of file diff --git a/app/templates/element/datePicker.php b/app/templates/element/datePicker.php index e04bc9b0e..7d25f5d20 100644 --- a/app/templates/element/datePicker.php +++ b/app/templates/element/datePicker.php @@ -1,4 +1,30 @@ request->getParam('controller'); +$curAction = $this->request->getParam('action'); + +if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { + // This will work for most top-level index views + $curId = $this->request->getQuery($vv_primary_link); + $linkFilter = [$vv_primary_link => $curId]; + // For top-level nav + if(!empty($vv_person_id)) { + $curId = $vv_person_id; + $linkFilter = ['person_id' => $vv_person_id]; + } +} elseif (!empty($vv_obj)) { + // This will work for most top-level edit views + // XXX we might produce the $vv_primary_link for edit views so the approach below could be deprecated + $curId = $vv_obj->id; + if(!empty($vv_person_id)) { + $curId = $vv_person_id; + } elseif(!empty($vv_primary_link_id)) { + $curId = $vv_primary_link_id; + } + // For top-level nav while in edit pages. + if ($name == 'person') { + $linkFilter = ['person_id' => $curId]; + } elseif ($name == 'group') { + $linkFilter = ['group_id' => $curId]; + } +} +?> + + + + + + + request->getQuery($vv_primary_link); + if($isPersonRole || $isExternalId) { + if($isExternalId && !empty($vv_ei_id)) { + $curId = $vv_ei_id; + } + // We display the role or external identity name above the subnav to show the hierarchy. + // We also use this structure to set the second-level $linkFilter + print '

'; + if(!empty($vv_ei_name)) { + // We have an external identity name + print $vv_ei_name->full_name; + $linkFilter = ['external_identity_id' => $curId]; + } elseif(!empty($vv_person_role)) { + // We have a person role + print $vv_person_role; + $linkFilter = ['person_role_id' => $curId]; + } elseif(!empty($vv_obj)) { + // We are editing/viewing an object + if(!empty($vv_obj->title)) { + print $vv_obj->title; + } elseif (!empty($vv_subtitle)) { + print $vv_subtitle; + } else { + print print __d('information','global.title.none'); + } + // Set up $linkFilter for edit/view on Roles and External Identities + $curId = $vv_obj->id; + if($curController == 'PersonRoles') { + $linkFilter = ['person_role_id' => $curId]; + } + if($curController == 'ExternalIdentities') { + $linkFilter = ['external_identity_id' => $curId]; + } + } else { + // We shouldn't get here, but have a deafult in case. + print __d('information','global.title.none'); + } + print '

'; + } + ?> + + + + +
+

+ id; + if(!empty($vv_obj) && ($curController == 'ExternalIdentityRoles' && ($curAction == 'edit' || $curAction == 'view'))) { + $curId = $vv_obj->id; + } + $linkFilter = ['external_identity_role_id' => $curId]; + + if(!empty($vv_ei_role)) { + print $vv_ei_role; + } elseif(!empty($vv_obj->title)) { + print $vv_obj->title; + } else { + // As above, we shouldn't get here, but have a deafult in case. + print __d('information','global.title.none'); + } + ?> +

+ +
+ + \ No newline at end of file diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 4d5eab282..640734aa4 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -54,8 +54,8 @@ h2 { margin: 0; } h3 { - font-size: 1.6em; - line-height: 1.6em; + font-size: 1.4em; + line-height: 1.4em; margin: 0; } a { @@ -527,7 +527,7 @@ ul.form-list li.alert-banner .co-alert { font-size: 0.9em; margin-top: -1em; } -.titleNavContainer { +.pageTitleContainer { display: flex; justify-content: space-between; margin: 1em 0 0.5em; @@ -536,6 +536,9 @@ ul.form-list li.alert-banner .co-alert { .pageTitle { padding-bottom: 0.25em; } +.pageTitle h2 { + line-height: 1.2em; +} .pageTitle .deleted, .pageTitle .archived { background-color: var(--cmg-color-red-003); @@ -550,6 +553,41 @@ ul.form-list li.alert-banner .co-alert { .pageTitle .archived { background-color: var(--cmg-color-gray-003); } +/* SUBNAVIGATION & TABS */ +.supertitle { + padding: 1em 0; +} +#subnavigation nav { + padding: 0.5em 0; +} +.cm-subnav-tabs .nav-link { + text-transform: uppercase; + padding: 1em 1.5em; + color: var(--cmg-color-blue-001); +} +.cm-subnav-links .nav-link.active { + color: var(--cmg-color-gray-001); +} +.cm-subnav-links ul.list-inline { + margin: 0.5em 0 0 0; + font-size: 0.9em; +} +.cm-subnav-links .list-inline-item { + margin: 0; +} +.cm-subnav-links .list-inline-item a.nav-link { + padding: 0 1.5em 0.5em 0; +} +#external-id-role { + border-top: 1px solid var(--cmg-color-lightgray-006); +} +#external-id-role h3 { + padding: 0.5rem 1rem; + background-color: var(--cmg-color-lightgray-003); +} +#external-id-role-nav { + margin-left: 1rem; +} /* INNER CONTENT - for non-table-based layouts */ #content { padding: 2rem;