diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po
index 7c215af73..841a93e7b 100644
--- a/app/resources/locales/en_US/information.po
+++ b/app/resources/locales/en_US/information.po
@@ -39,6 +39,15 @@ msgstr "Please select the collaboration (CO) you wish to manage."
msgid "entity.id"
msgstr "ID: {0}"
+msgid "noattrs"
+msgstr "No attributes"
+
+msgid "notset"
+msgstr "not set"
+
+msgid "pagination.format"
+msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}"
+
msgid "ExternalIdentities.source"
msgstr "This External Identity was created from {0} ({1})"
diff --git a/app/src/Controller/DashboardsController.php b/app/src/Controller/DashboardsController.php
index ffaebb9c5..0593c028d 100644
--- a/app/src/Controller/DashboardsController.php
+++ b/app/src/Controller/DashboardsController.php
@@ -325,9 +325,9 @@ public function search() {
// Gather our search string.
$q = '';
- if(!empty($this->request->getQuery('q'))) {
+ if(!empty($this->request->getData('q'))) {
// A search was passed in from the form on the Global Search bar.
- $q = trim($this->request->getQuery('q'));
+ $q = trim($this->request->getData('q'));
}
// Only process the request if we have a string of non-space characters
@@ -412,7 +412,7 @@ public function search() {
$this->Flash->information(__d('result',
'search.exact',
- [filter_var($this->request->getQuery('q'), FILTER_SANITIZE_SPECIAL_CHARS),
+ [filter_var($this->request->getData('q'), FILTER_SANITIZE_SPECIAL_CHARS),
__d('controller', $matchClass, [1])]));
// Redirect to the matchClass controller
diff --git a/app/src/Model/Table/ExternalIdentitiesTable.php b/app/src/Model/Table/ExternalIdentitiesTable.php
index 1b9390035..bf9f8d703 100644
--- a/app/src/Model/Table/ExternalIdentitiesTable.php
+++ b/app/src/Model/Table/ExternalIdentitiesTable.php
@@ -126,6 +126,17 @@ public function initialize(array $config): void {
]);
$this->setIndexContains(['PrimaryName']);
+ $this->setViewContains([
+ 'PrimaryName',
+ 'Addresses',
+ 'AdHocAttributes',
+ 'EmailAddresses',
+ 'Identifiers',
+ 'Names',
+ 'Pronouns',
+ 'TelephoneNumbers',
+ 'Urls'
+ ]);
$this->setViewContains([
'PrimaryName',
diff --git a/app/src/View/Helper/FieldHelper.php b/app/src/View/Helper/FieldHelper.php
index 632ade5d7..635014567 100644
--- a/app/src/View/Helper/FieldHelper.php
+++ b/app/src/View/Helper/FieldHelper.php
@@ -208,76 +208,95 @@ public function control(string $fieldName,
*/
public function dateControl(string $fieldName, string $dateType=DateTypeEnum::Standard): string {
- // A datetime field will be rendered as a plain text input with adjacent date and time pickers
- // that will interact with the field value. Allowing direct access to the input field is for
- // accessibility purposes.
-
- $pickerType = $dateType;
- // Special-case the very common "valid_from" and "valid_through" fields so we won't need
- // to specify their types in fields.inc.
- if($fieldName == 'valid_from') {
- $pickerType = DateTypeEnum::FromTime;
- }
- if($fieldName == 'valid_through') {
- $pickerType = DateTypeEnum::ThroughTime;
- }
-
- // Append the timezone to the label -- TODO: see that the timezone gets output to the display
- $label = __d('field', $fieldName.".tz", [$this->_View->get('vv_tz')]);
-
- // Create the options array for the (text input) form control
- $coptions = [];
- $coptions['class'] = 'form-control datepicker';
-
- if($pickerType == DateTypeEnum::DateOnly) {
- $coptions['placeholder'] = 'YYYY-MM-DD';
- $coptions['pattern'] = '\d{4}-\d{2}-\d{2}';
- $coptions['title'] = __d('field', 'datepicker.enterDate');
+ if($this->action == 'view') {
+ // return the date as plaintext
+ $coptions = [];
+ $entity = $this->getView()->get('vv_obj');
+ if (!empty($entity->$fieldName)) {
+ // Adjust the time back to the user's timezone
+ if ($dateType == DateTypeEnum::DateOnly) {
+ $controlCode = '';
+ } else {
+ $controlCode = '';
+ }
+ } else {
+ $controlCode = __d('information', 'notset');
+ }
+ // Return this to the generic control() function
+ return $this->control($fieldName, $coptions, ctrlCode: $controlCode, labelIsTextOnly: true);
+
} else {
- $coptions['placeholder'] = 'YYYY-MM-DD HH:MM:SS';
- $coptions['pattern'] = '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}';
- $coptions['title'] = __d('field', 'datepicker.enterDateTime');
- }
- $coptions['id'] = str_replace("_", "-", $fieldName);
+ // A datetime field will be rendered as a plain text input with adjacent date and time pickers
+ // that will interact with the field value. Allowing direct access to the input field is for
+ // accessibility purposes.
+
+ $pickerType = $dateType;
+ // Special-case the very common "valid_from" and "valid_through" fields so we won't need
+ // to specify their types in fields.inc.
+ if ($fieldName == 'valid_from') {
+ $pickerType = DateTypeEnum::FromTime;
+ }
+ if ($fieldName == 'valid_through') {
+ $pickerType = DateTypeEnum::ThroughTime;
+ }
- $entity = $this->getView()->get('vv_obj');
+ // Append the timezone to the label -- TODO: see that the timezone gets output to the display
+ $label = __d('field', $fieldName . ".tz", [$this->_View->get('vv_tz')]);
- // Default the picker date to today
- $now = FrozenTime::now();
- $pickerDate = $now->i18nFormat('yyyy-MM-dd');
-
- // Get the existing values, if present
- if(!empty($entity->$fieldName)) {
- // Adjust the time back to the user's timezone
- if($pickerType == DateTypeEnum::DateOnly) {
- $coptions['value'] = $entity->$fieldName->i18nFormat("yyyy-MM-dd", $this->getView()->get('vv_tz'));
+ // Create the options array for the (text input) form control
+ $coptions = [];
+ $coptions['class'] = 'form-control datepicker';
+
+ if ($pickerType == DateTypeEnum::DateOnly) {
+ $coptions['placeholder'] = 'YYYY-MM-DD';
+ $coptions['pattern'] = '\d{4}-\d{2}-\d{2}';
+ $coptions['title'] = __d('field', 'datepicker.enterDate');
} else {
- $coptions['value'] = $entity->$fieldName->i18nFormat("yyyy-MM-dd HH:mm:ss", $this->getView()->get('vv_tz'));
+ $coptions['placeholder'] = 'YYYY-MM-DD HH:MM:SS';
+ $coptions['pattern'] = '\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}';
+ $coptions['title'] = __d('field', 'datepicker.enterDateTime');
}
- $pickerDate = $entity->$fieldName->i18nFormat("yyyy-MM-dd", $this->getView()->get('vv_tz'));
- }
-
- // Set the date picker floor year value (-100 years)
- $pickerDateFT = new FrozenTime($pickerDate);
- $pickerDateFT = $pickerDateFT->subYears(100);
- $pickerFloor = $pickerDateFT->i18nFormat("yyyy-MM-dd");
-
- $date_picker_args = [
- 'fieldName' => $fieldName,
- 'pickerDate' => $pickerDate,
- 'pickerType' => $pickerType,
- 'pickerFloor' => $pickerFloor
- ];
-
- // Create a text field to hold our value and call the datePicker
- $controlCode = $this->Form->text($fieldName, $coptions)
- . $this->getView()->element('datePicker', $date_picker_args);
+ $coptions['id'] = str_replace("_", "-", $fieldName);
- // Specify a class on the
form control wrapper
- $liClass = "fields-datepicker";
-
- // Pass everything to the generic control() function
- return $this->control($fieldName, $coptions, ctrlCode: $controlCode, cssClass: $liClass);
+ $entity = $this->getView()->get('vv_obj');
+
+ // Default the picker date to today
+ $now = FrozenTime::now();
+ $pickerDate = $now->i18nFormat('yyyy-MM-dd');
+
+ // Get the existing values, if present
+ if(!empty($entity->$fieldName)) {
+ // Adjust the time back to the user's timezone
+ if($pickerType == DateTypeEnum::DateOnly) {
+ $coptions['value'] = $entity->$fieldName->i18nFormat("yyyy-MM-dd", $this->getView()->get('vv_tz'));
+ } else {
+ $coptions['value'] = $entity->$fieldName->i18nFormat("yyyy-MM-dd HH:mm:ss", $this->getView()->get('vv_tz'));
+ }
+ $pickerDate = $entity->$fieldName->i18nFormat("yyyy-MM-dd", $this->getView()->get('vv_tz'));
+ }
+
+ // Set the date picker floor year value (-100 years)
+ $pickerDateFT = new FrozenTime($pickerDate);
+ $pickerDateFT = $pickerDateFT->subYears(100);
+ $pickerFloor = $pickerDateFT->i18nFormat("yyyy-MM-dd");
+
+ $date_picker_args = [
+ 'fieldName' => $fieldName,
+ 'pickerDate' => $pickerDate,
+ 'pickerType' => $pickerType,
+ 'pickerFloor' => $pickerFloor
+ ];
+
+ // Create a text field to hold our value and call the datePicker
+ $controlCode = $this->Form->text($fieldName, $coptions)
+ . $this->getView()->element('datePicker', $date_picker_args);
+
+ // Specify a class on the
form control wrapper
+ $liClass = "fields-datepicker";
+
+ // Pass everything to the generic control() function
+ return $this->control($fieldName, $coptions, ctrlCode: $controlCode, cssClass: $liClass);
+ }
}
/**
diff --git a/app/templates/ExternalIdentities/columns.inc b/app/templates/ExternalIdentities/columns.inc
index 5ed7c1df5..6a516d069 100644
--- a/app/templates/ExternalIdentities/columns.inc
+++ b/app/templates/ExternalIdentities/columns.inc
@@ -30,6 +30,7 @@
$indexColumns = [
'name' => [
'type' => 'link',
+ 'action' => 'view',
'model' => 'primary_name',
'field' => 'full_name',
// XXX see comments in the controller about sorting on given vs family
diff --git a/app/templates/ExternalIdentityRoles/columns.inc b/app/templates/ExternalIdentityRoles/columns.inc
index 751584bbd..a925abfbe 100644
--- a/app/templates/ExternalIdentityRoles/columns.inc
+++ b/app/templates/ExternalIdentityRoles/columns.inc
@@ -30,6 +30,7 @@
$indexColumns = [
'title' => [
'type' => 'link',
+ 'action' => 'view',
'sortable' => true
],
'affiliation_type_id' => [
diff --git a/app/templates/ExternalIdentityRoles/fields.inc b/app/templates/ExternalIdentityRoles/fields.inc
index d1301089d..abab0817b 100644
--- a/app/templates/ExternalIdentityRoles/fields.inc
+++ b/app/templates/ExternalIdentityRoles/fields.inc
@@ -25,8 +25,7 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
-// This view does not currently support read-only
-if($vv_action == 'add' || $vv_action == 'edit') {
+if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
print $this->Field->control('affiliation_type_id', labelText: __d('field', 'affiliation'));
print $this->Field->control('status', ['empty' => false]);
diff --git a/app/templates/element/mveaCanvas.php b/app/templates/element/mveaCanvas.php
index 7da504939..61e30b6d0 100644
--- a/app/templates/element/mveaCanvas.php
+++ b/app/templates/element/mveaCanvas.php
@@ -69,7 +69,7 @@
?>