// Add client-side vars for the search UI
$vars = [
- 'operators' => \Civi\Api4\Utils\CoreUtil::getOperators(),
+ 'operators' => CRM_Utils_Array::makeNonAssociative($this->getOperators()),
'schema' => $this->schema,
'links' => $this->getLinks(),
'loadOptions' => $this->loadOptions,
parent::run();
}
+ /**
+ * @return string[]
+ */
+ private function getOperators() {
+ return [
+ '=' => '=',
+ '!=' => '≠',
+ '>' => '>',
+ '<' => '<',
+ '>=' => '≥',
+ '<=' => '≤',
+ 'CONTAINS' => ts('Contains'),
+ 'IN' => ts('Is In'),
+ 'NOT IN' => ts('Not In'),
+ 'LIKE' => ts('Is Like'),
+ 'NOT LIKE' => ts('Not Like'),
+ 'BETWEEN' => ts('Is Between'),
+ 'NOT BETWEEN' => ts('Not Between'),
+ 'IS NULL' => ts('Is Null'),
+ 'IS NOT NULL' => ts('Not Null'),
+ ];
+ }
+
/**
* Populates $this->schema & $this->allowedEntities
*/
</div>
<div ng-if="!$ctrl.conjunctions[clause[0]]" class="api4-input-group">
<input class="form-control" ng-model="clause[0]" crm-ui-select="{data: data.fields, allowClear: true, placeholder: 'Field'}" />
- <select class="form-control api4-operator" ng-model="clause[1]" ng-options="o for o in $ctrl.operators" ></select>
+ <select class="form-control api4-operator" ng-model="clause[1]" ng-options="o.key as o.value for o in $ctrl.operators" ></select>
<input class="form-control" ng-model="clause[2]" crm-search-value="{field: clause[0], op: clause[1], format: data.format}" />
</div>
<fieldset class="clearfix" ng-if="$ctrl.conjunctions[clause[0]]" crm-search-clause="{format: data.format, clauses: clause[1], op: clause[0], fields: data.fields, groupParent: data.clauses, groupIndex: index}">
return;
}
if (inputType === 'Date') {
- if (_.includes(['=', '!=', '<>', '>', '>=', '<', '<='], op)) {
+ if (_.includes(['=', '!=', '>', '>=', '<', '<='], op)) {
$el.crmDatepicker({time: (field.input_attrs && field.input_attrs.time) || false});
}
- } else if (_.includes(['=', '!=', '<>', 'IN', 'NOT IN', 'CONTAINS'], op) && (field.fk_entity || field.options || dataType === 'Boolean')) {
+ } else if (_.includes(['=', '!=', 'IN', 'NOT IN', 'CONTAINS'], op) && (field.fk_entity || field.options || dataType === 'Boolean')) {
if (field.options) {
if (field.options === true) {
$el.addClass('loading');
}
#bootstrap-theme.crm-search .api4-operator {
- width: 90px;
+ width: 110px;
}
#bootstrap-theme.crm-search .api4-add-where-group-menu {