diff --git a/app/src/Controller/PeopleController.php b/app/src/Controller/PeopleController.php
index c1d2e5e14..4577075c6 100644
--- a/app/src/Controller/PeopleController.php
+++ b/app/src/Controller/PeopleController.php
@@ -76,66 +76,4 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
return parent::beforeRender($event);
}
-
- /**
- * Person overview / canvas
- *
- * @since COmanage Registry v5.0.0
- */
-
- public function canvas(string $id) {
- /* XXX Simply including parent::edit() is nearly all that's required - but we need
- to delve a little deeper to get data from underlying relationships. We might send a contains()
- override to parent::edit() which would allow this to be more DRY
- // Keep the following as an example for now.
- parent::edit($id, false);
-
- // We've just set the vv_supertitle in the parent controller.
- // Pass it to the title for use in the breadcrumbs.
- $this->set('vv_title', $this->viewBuilder()->getVar('vv_supertitle'));
- */
-
- /* The following is nearly identical to parent::edit/view */
- $modelsName = $this->name;
- $table = $this->$modelsName;
- $tableName = $table->getTable();
- $query = $table->findById($id);
-
- // This contain() directive is the primary deviation from standard edit()/view().
- // We need to drill down to deeper related models for display.
- $query = $query->contain([
- 'PrimaryName',
- 'Names' => ['Types'],
- 'Addresses' => ['Types'],
- 'AdHocAttributes',
- 'EmailAddresses' => ['Types'],
- 'GroupMembers',
- 'GroupOwners',
- 'Identifiers' => ['Types'],
- 'PersonRoles' => ['Cous','Types'],
- 'Pronouns',
- 'TelephoneNumbers' => ['Types'],
- 'Urls' => ['Types']
- ]);
-
- try {
- // Pull the current record
- $obj = $query->firstOrFail();
- } catch(\Exception $e) {
- // findById throws Cake\Datasource\Exception\RecordNotFoundException
- $this->Flash->error($e->getMessage());
- // XXX This redirects to an Exception page because $id is not found.
- // XXX A 404 with error would be better.
- return $this->generateRedirect((int)$id);
- }
-
- $this->set('vv_obj', $obj);
- $this->getPrimaryLink();
- $this->populateAutoViewVars($obj);
-
- $this->set('vv_title', $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));
- }
}
\ No newline at end of file
diff --git a/app/templates/People/canvas.php b/app/templates/People/canvas.php
deleted file mode 100644
index 54b25ba3a..000000000
--- a/app/templates/People/canvas.php
+++ /dev/null
@@ -1,173 +0,0 @@
- 'person',
- 'active' => 'canvas'
- ];
-
- $linkFilter = [];
- if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) {
- $linkFilter = [$vv_primary_link => $this->request->getQuery($vv_primary_link)];
- }
-
- $objId = null;
- if(!empty($vv_obj)) {
- $objId = $vv_obj->id;
- }
-
- // Person Attributes to display.
- $attributes = [
- 'names',
- 'email_addresses',
- 'identifiers',
- 'ad_hoc_attributes',
- 'addresses',
- 'telephone_numbers',
- 'urls',
- 'pronouns'
- ];
-
- // Count the number of widgets that will be displayed
- $widgetCount = 0;
- foreach($attributes as $attr) {
- if(!empty($vv_obj[$attr])) {
- $widgetCount++;
- }
- }
-
-?>
-
-
- = $this->element('subnavigation', $subnav); ?>
-
-
-
-
-
-
- element(
- 'mveaJs',
- [
- 'htmlId' => 'person-canvas-' . $attr . '-js',
- 'parentId' => $objId,
- 'mveaType' => $attr,
- 'entityType' => 'person'
- ]
- );
- }
- }
- ?>
-
-
-
-
-
- element(
- 'mvea',
- [
- 'vv_obj' => $vv_obj,
- 'mveaType' => $attr,
- 'entityType' => 'person'
- ]
- );
- }
- }
- ?>
-
-
- */ ?>
-
-
-
-
-
- = $this->Html->link(
- __d('controller', 'PersonRoles', [99]),
- [ 'controller' => 'person_roles',
- 'action' => 'index',
- '?' => ['person_id' => $objId]
- ]
- ); ?>
-
-
-
-
- -
-
- = $this->Html->link(
- !(empty($role['title'])) ? $role['title'] : __d('information','global.title.none'),
- [ 'controller' => 'person_roles',
- 'action' => 'edit',
- $role['id']
- ],
- ['class' => 'row-link']
- ); ?>
-
-
-
-
- = $role['cou']['name'] ?>
-
-
-
-
-
-
-
- = __d('enumeration', 'StatusEnum.' . $role['status']); ?>
-
-
-
- = __d('enumeration', 'StatusEnum.' . $role['status']); ?>
-
-
-
-
-
- = !empty($role['affiliation_type']['display_name']) ? $role['affiliation_type']['display_name'] : $role['affiliation_type']['value'] ?>
-
-
-
- = __d('information', 'entity.id', [$role["id"]]); ?>
-
-
-
-
-
-
-
diff --git a/app/templates/People/columns.inc b/app/templates/People/columns.inc
index 4e001764d..e64a5f37b 100644
--- a/app/templates/People/columns.inc
+++ b/app/templates/People/columns.inc
@@ -30,7 +30,7 @@ $indexColumns = [
'type' => 'link',
'model' => 'primary_name',
'field' => 'full_name',
- 'action' => 'canvas',
+ 'action' => 'edit',
// XXX see comments in the controller about sorting on given vs family
'sortable' => 'PrimaryName.family'
],
diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php
index 8925cddf8..7b1f8e8fc 100644
--- a/app/templates/Standard/add-edit-view.php
+++ b/app/templates/Standard/add-edit-view.php
@@ -72,78 +72,129 @@
}
?>
-
-
-
-
= $vv_title; ?>
-
- request->getParam('controller') == 'PersonRoles'
- || $this->request->getParam('controller') == 'ExternalIdentities'
- || $this->request->getParam('controller') == 'ExternalIdentityRoles'): ?>
- = $vv_title; ?>
-
- = $vv_title; ?>
-
-
-
+
+
id;
-
- foreach(($topLinks ?? []) as $t) {
- // 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);
- } else {
- $t['link']['?'] = $linkFilter;
- }
-
- $action_args['vv_actions'][] = [
- 'order' => $this->Menu->getMenuOrder($t['order']),
- 'icon' => $this->Menu->getMenuIcon($t['icon']),
- 'url' => $this->Url->build($t['link']),
- 'label' => $t['label'],
- ];
- //}
- }
-
- // Delete
- if($vv_action != 'add' && !empty($vv_obj->id) && $vv_permissions['delete']) {
- $actionPostBtnArray = ['action' => 'delete', $vv_obj->id];
- $actionUrl = $this->Url->build(['action' => 'delete', $vv_obj->id]);
- $action_args['vv_actions'][] = array(
- 'order' => $this->Menu->getMenuOrder('Delete'),
- 'icon' => $this->Menu->getMenuIcon('Delete'),
- 'url' => 'javascript:void(0);',
- 'label' => __d('operation', 'delete'),
- 'class' => 'deletebutton nospin',
- 'onclick' => array(
- 'dg_bd_txt' => __d('operation', 'delete.confirm', [$vv_obj->id]),
- 'dg_post_btn_array' => $actionPostBtnArray,
- 'dg_url' => $actionUrl,
- 'dg_conf_btn' => __d('operation', 'remove'),
- 'dg_cancel_btn' => __d('operation', 'cancel'),
- 'dg_title' => __d('operation', 'remove'),
- 'dg_bd_txt_repl_str' => ''
- )
- );
- }
-
- if(!empty($action_args['vv_actions'])) {
- print '
';
- print $this->element('menuAction', $action_args);
- print '
';
+ // Person Attributes to display.
+ $attributes = [
+ 'names',
+ 'email_addresses',
+ 'identifiers',
+ 'ad_hoc_attributes',
+ 'addresses',
+ 'telephone_numbers',
+ 'urls',
+ 'pronouns'
+ ];
+
+ // Count the number of widgets that will be displayed
+ $widgetCount = 0;
+ foreach($attributes as $attr) {
+ if(!empty($vv_obj[$attr])) {
+ $widgetCount++;
}
+ }
+
+ $objId = null;
+ if(!empty($vv_obj)) {
+ $objId = $vv_obj->id;
+ }
?>
-
+
+
+
+ element(
+ 'mveaJs',
+ [
+ 'htmlId' => 'person-canvas-' . $attr . '-js',
+ 'parentId' => $objId,
+ 'mveaType' => $attr,
+ 'entityType' => 'person'
+ ]
+ );
+ }
+ }
+ // XXX Add the DOB as its own special card.
+ ?>
+
+
+
+
+
+
+
= $vv_title; ?>
+
+ request->getParam('controller') == 'PersonRoles'
+ || $this->request->getParam('controller') == 'ExternalIdentities'
+ || $this->request->getParam('controller') == 'ExternalIdentityRoles'): ?>
+ = $vv_title; ?>
+
+ = $vv_title; ?>
+
+
+
+ id;
+
+ foreach(($topLinks ?? []) as $t) {
+ // 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);
+ } else {
+ $t['link']['?'] = $linkFilter;
+ }
+
+ $action_args['vv_actions'][] = [
+ 'order' => $this->Menu->getMenuOrder($t['order']),
+ 'icon' => $this->Menu->getMenuIcon($t['icon']),
+ 'url' => $this->Url->build($t['link']),
+ 'label' => $t['label'],
+ ];
+ //}
+ }
+
+ // Delete
+ if($vv_action != 'add' && !empty($vv_obj->id) && $vv_permissions['delete']) {
+ $actionPostBtnArray = ['action' => 'delete', $vv_obj->id];
+ $actionUrl = $this->Url->build(['action' => 'delete', $vv_obj->id]);
+ $action_args['vv_actions'][] = array(
+ 'order' => $this->Menu->getMenuOrder('Delete'),
+ 'icon' => $this->Menu->getMenuIcon('Delete'),
+ 'url' => 'javascript:void(0);',
+ 'label' => __d('operation', 'delete'),
+ 'class' => 'deletebutton nospin',
+ 'onclick' => array(
+ 'dg_bd_txt' => __d('operation', 'delete.confirm', [$vv_obj->id]),
+ 'dg_post_btn_array' => $actionPostBtnArray,
+ 'dg_url' => $actionUrl,
+ 'dg_conf_btn' => __d('operation', 'remove'),
+ 'dg_cancel_btn' => __d('operation', 'cancel'),
+ 'dg_title' => __d('operation', 'remove'),
+ 'dg_bd_txt_repl_str' => ''
+ )
+ );
+ }
+
+ if(!empty($action_args['vv_actions'])) {
+ print '
';
+ print $this->element('menuAction', $action_args);
+ print '
';
+ }
+ ?>
+
+
diff --git a/app/templates/element/mveaJs.php b/app/templates/element/mveaJs.php
index 517e777e7..aa404dae2 100644
--- a/app/templates/element/mveaJs.php
+++ b/app/templates/element/mveaJs.php
@@ -59,7 +59,7 @@
core: {
parentId: '= $parentId ?>',
mveaType: '= $mveaType ?>',
- mveaController: '= $mveaController ?>',
+ mveaController: '= Cake\Utility\Inflector::dasherize($mveaController) ?>',
webroot: '= $this->request->getAttribute('webroot') ?>'
},
txt: JSON.parse('= json_encode($vueHelper->locales()) ?>'),
diff --git a/app/templates/element/subnavigation.php b/app/templates/element/subnavigation.php
index 8d23e4262..09a43ad79 100644
--- a/app/templates/element/subnavigation.php
+++ b/app/templates/element/subnavigation.php
@@ -88,7 +88,7 @@
= $supertitle ?>
-
+
= __d('enumeration', 'StatusEnum.' . $vv_obj['status']); ?>
@@ -294,19 +294,6 @@
$isGroupsTab = ($active == 'groups') ? true : false;
?>
-
- Html->link(
- __d('menu', 'overview'),
- [ 'controller' => 'people',
- 'action' => 'canvas',
- $curId
- ],
- ['class' => $linkClass]
- );
- ?>
-
request->getQuery($vv_primary_link);
if($isPersonRole || $isExternalId) {
if($isExternalId && !empty($vv_ei_id)) {
@@ -474,6 +462,9 @@
// Properties
$cc = 'people';
$cid = $curId;
+ if($isPersonTab) {
+ $cid = $parentId;
+ }
if($isPersonRole) {
$cc = 'person-roles';
$cid = !empty($vv_person_role_id) ? $vv_person_role_id : $curId;
diff --git a/app/webroot/js/comanage/components/mvea/mvea-item.js b/app/webroot/js/comanage/components/mvea/mvea-item.js
index ff0fccfc6..7a1df06d5 100644
--- a/app/webroot/js/comanage/components/mvea/mvea-item.js
+++ b/app/webroot/js/comanage/components/mvea/mvea-item.js
@@ -34,9 +34,18 @@ export default {
core: Object,
txt: Object
},
+ computed: {
+ mveaLink: function() {
+ // For now, link to the underlying PHP form. We will change this behavior as we develop the JS forms.
+ return this.core.webroot + this.core.mveaController + '/edit/' + this.mvea.id;
+ }
+ },
methods: {
calcLangHR(lang) {
return constructLanguageString(lang)
+ },
+ followRowLink() {
+ location.href = this.mveaLink;
}
},
mounted() {
@@ -44,12 +53,14 @@ export default {
},
template: `
-
+
-
+
{{ this.txt.unverified }}
@@ -78,9 +89,9 @@ export default {
-
+
{{ this.txt.login }}
@@ -88,19 +99,19 @@ export default {
-
+
{{ this.mvea.tag }}
-
+
-
+
{{ this.mvea.type.display_name }}
-
+
@@ -133,9 +144,9 @@ export default {
-
+
{{ this.mvea.type.display_name }}