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 4bf4fea62..d28792885 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,7 @@ 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)); } 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..157ea46fc --- /dev/null +++ b/app/templates/EmailAddresses/fields-nav.inc @@ -0,0 +1,35 @@ + 'person', + 'active' => 'attributes', + '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/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/Groups/fields-nav.inc b/app/templates/GroupMembers/fields-nav.inc similarity index 81% rename from app/templates/Groups/fields-nav.inc rename to app/templates/GroupMembers/fields-nav.inc index 38d21495f..1dba6bd0e 100644 --- a/app/templates/Groups/fields-nav.inc +++ b/app/templates/GroupMembers/fields-nav.inc @@ -1,6 +1,6 @@ 'sync', - 'order' => 'Default', - 'label' => __d('operation', 'reconcile'), - 'link' => [ - 'action' => 'reconcile' - ], - 'class' => '' - ] +// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc +$topLinks = []; + +$subnav = [ + 'name' => '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/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/People/fields.inc b/app/templates/People/fields.inc index 3b81e76f6..4bdb5b69e 100644 --- a/app/templates/People/fields.inc +++ b/app/templates/People/fields.inc @@ -46,119 +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', '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/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index abb41d9a4..ffae2843c 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,30 @@ if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) { $linkFilter = [$vv_primary_link => $this->request->getQuery($vv_primary_link)]; } - ?> -