From f2425270f169759c09d159bc9dfa1d65530cf0f5 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 13 Sep 2020 13:21:16 -0400 Subject: [PATCH] Search ext: update to plural entity titles --- ext/search/CRM/Search/Page/Ang.php | 4 ++-- ext/search/ang/search/crmSearch.component.js | 10 +++++----- ext/search/ang/search/crmSearch.html | 2 +- ext/search/ang/search/crmSearchActions.component.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/search/CRM/Search/Page/Ang.php b/ext/search/CRM/Search/Page/Ang.php index b6a03e2bbf..2549f622d5 100644 --- a/ext/search/CRM/Search/Page/Ang.php +++ b/ext/search/CRM/Search/Page/Ang.php @@ -83,9 +83,9 @@ class CRM_Search_Page_Ang extends CRM_Core_Page { */ private function getSchema() { $schema = \Civi\Api4\Entity::get() - ->addSelect('name', 'title', 'description', 'icon') + ->addSelect('name', 'titlePlural', 'description', 'icon') ->addWhere('name', '!=', 'Entity') - ->addOrderBy('title') + ->addOrderBy('titlePlural') ->setChain([ 'get' => ['$name', 'getActions', ['where' => [['name', '=', 'get']]], ['params']], ])->execute(); diff --git a/ext/search/ang/search/crmSearch.component.js b/ext/search/ang/search/crmSearch.component.js index 51f2532bc4..66a14f0f2c 100644 --- a/ext/search/ang/search/crmSearch.component.js +++ b/ext/search/ang/search/crmSearch.component.js @@ -23,7 +23,7 @@ $scope.controls = {}; $scope.joinTypes = [{k: false, v: ts('Optional')}, {k: true, v: ts('Required')}]; - $scope.entities = formatForSelect2(CRM.vars.search.schema, 'name', 'title', ['description', 'icon']); + $scope.entities = formatForSelect2(CRM.vars.search.schema, 'name', 'titlePlural', ['description', 'icon']); this.perm = { editGroups: CRM.checkPerm('edit groups') }; @@ -40,7 +40,7 @@ if (entity) { joinEntities.push({ id: link.entity + ' AS ' + link.alias, - text: entity.title, + text: entity.titlePlural, description: '(' + link.alias + ')', icon: entity.icon }); @@ -408,7 +408,7 @@ var mainEntity = searchMeta.getEntity(ctrl.entity), result = [{ - text: mainEntity.title, + text: mainEntity.titlePlural, icon: mainEntity.icon, children: formatFields(ctrl.entity, '') }]; @@ -416,7 +416,7 @@ var joinName = join[0].split(' AS '), joinEntity = searchMeta.getEntity(joinName[0]); result.push({ - text: joinEntity.title + ' (' + joinName[1] + ')', + text: joinEntity.titlePlural + ' (' + joinName[1] + ')', icon: joinEntity.icon, children: formatFields(joinEntity.name, joinName[1] + '.') }); @@ -529,7 +529,7 @@ $scope.saveGroup = function() { var selectField = ctrl.entity === 'Contact' ? 'id' : 'contact_id'; if (ctrl.entity !== 'Contact' && !searchMeta.getField('contact_id')) { - CRM.alert(ts('Cannot create smart group from %1.', {1: searchMeta.getEntity(true).title}), ts('Missing contact_id'), 'error', {expires: 5000}); + CRM.alert(ts('Cannot create smart group from %1.', {1: searchMeta.getEntity(true).titlePlural}), ts('Missing contact_id'), 'error', {expires: 5000}); return; } var model = { diff --git a/ext/search/ang/search/crmSearch.html b/ext/search/ang/search/crmSearch.html index bd0feabcba..3500ef31c7 100644 --- a/ext/search/ang/search/crmSearch.html +++ b/ext/search/ang/search/crmSearch.html @@ -1,5 +1,5 @@