*/
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();
$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')
};
if (entity) {
joinEntities.push({
id: link.entity + ' AS ' + link.alias,
- text: entity.title,
+ text: entity.titlePlural,
description: '(' + link.alias + ')',
icon: entity.icon
});
var mainEntity = searchMeta.getEntity(ctrl.entity),
result = [{
- text: mainEntity.title,
+ text: mainEntity.titlePlural,
icon: mainEntity.icon,
children: formatFields(ctrl.entity, '')
}];
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] + '.')
});
$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 = {
<div id="bootstrap-theme" class="crm-search">
- <h1 crm-page-title>{{:: ts('Create Search for %1', {1: $ctrl.getEntity($ctrl.entity).title}) }}</h1>
+ <h1 crm-page-title>{{:: ts('Create Search for %1', {1: $ctrl.getEntity($ctrl.entity).titlePlural}) }}</h1>
<!--This warning will show if bootstrap is unavailable. Normally it will be hidden by the bootstrap .collapse class.-->
<div class="messages warning no-popup collapse">
templateUrl: '~/search/crmSearchActions.html',
controller: function($scope, crmApi4, dialogService, searchMeta) {
var ts = $scope.ts = CRM.ts(),
- entityTitle = searchMeta.getEntity(this.entity).title,
+ entityTitle = searchMeta.getEntity(this.entity).titlePlural,
ctrl = this;
this.init = function() {