});
angular.module('api4Explorer').controller('Api4Explorer', function($scope, $routeParams, $location, $timeout, $http, crmUiHelp, crmApi4) {
- var ts = $scope.ts = CRM.ts('api4');
+ var ts = $scope.ts = CRM.ts();
$scope.entities = entities;
$scope.actions = actions;
$scope.fields = [];
},
templateUrl: '~/api4Explorer/WhereClause.html',
link: function (scope, element, attrs) {
- var ts = scope.ts = CRM.ts('api4');
+ var ts = scope.ts = CRM.ts();
scope.newClause = '';
scope.conjunctions = ['AND', 'OR', 'NOT'];
scope.operators = CRM.vars.api4.operators;
},
require: 'ngModel',
link: function (scope, element, attrs, ctrl) {
- var ts = scope.ts = CRM.ts('api4'),
- multi = _.includes(['IN', 'NOT IN'], scope.data.op),
+ var ts = scope.ts = CRM.ts(),
+ multi = _.includes(['IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'], scope.data.op),
entity = $routeParams.api4entity,
action = $routeParams.api4action;
if (!op) {
op = field.serialize || dataType === 'Array' ? 'IN' : '=';
}
- multi = _.includes(['IN', 'NOT IN'], op);
+ multi = _.includes(['IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'], op);
if (op === 'IS NULL' || op === 'IS NOT NULL') {
$el.hide();
return;
{id: '0', text: ts('No')}
]});
}
- } else if (dataType === 'Integer') {
+ } else if (dataType === 'Integer' && !multi) {
$el.attr('type', 'number');
}
}
},
templateUrl: '~/api4Explorer/Chain.html',
link: function (scope, element, attrs) {
- var ts = scope.ts = CRM.ts('api4');
+ var ts = scope.ts = CRM.ts();
function changeEntity(newEntity, oldEntity) {
// When clearing entity remove this chain