Commit | Line | Data |
---|---|---|
25523059 | 1 | <div class="crm-flex-box"> |
88b95fd8 | 2 | <div class="crm-search-criteria-column"> |
25523059 | 3 | <div ng-if=":: $ctrl.paramExists('join')"> |
2894db84 | 4 | <fieldset ng-repeat="join in $ctrl.savedSearch.api_params.join"> |
25523059 | 5 | <div class="form-inline"> |
266e8deb | 6 | <select class="form-control" ng-model="join[1]" ng-change="$ctrl.changeJoinType(join)" ng-options="o.k as o.v for o in ::joinTypes" ></select> |
4df8a1df | 7 | <input id="crm-search-join-{{ $index }}" class="form-control huge" ng-model="join[0]" crm-ui-select="{placeholder: ' ', data: getJoinEntities}" disabled > |
f9fd956a | 8 | <button type="button" class="btn btn-xs btn-danger-outline" ng-click="$ctrl.removeJoin($index)" title="{{:: ts('Remove join') }}"> |
4df8a1df CW |
9 | <i class="crm-i fa-trash" aria-hidden="true"></i> |
10 | </button> | |
25523059 | 11 | </div> |
3dfd2744 CW |
12 | <div class="api4-clause-fieldset"> |
13 | <crm-search-clause clauses="join" format="json" skip="2 + getJoin(join[0]).conditions.length" op="AND" label="{{:: ts('If') }}" hide-label="true" placeholder="ts('Add Condition')" fields="fieldsForJoin(join[0])" ></crm-search-clause> | |
14 | </div> | |
25523059 CW |
15 | </fieldset> |
16 | <fieldset> | |
17 | <div class="form-inline"> | |
266e8deb | 18 | <select class="form-control" ng-model="controls.joinType" ng-options="o.k as o.v for o in ::joinTypes" ></select> |
7c219eb3 CW |
19 | <input id="crm-search-add-join" |
20 | class="form-control crm-action-menu fa-plus" | |
21 | crm-ui-select="{placeholder: ts('Entity'), data: getJoinEntities, dropdownCss: {width: '275px'}}" | |
22 | on-crm-ui-select="$ctrl.addJoin(selection)"> | |
25523059 CW |
23 | </div> |
24 | </fieldset> | |
25 | </div> | |
26 | <fieldset ng-if=":: $ctrl.paramExists('groupBy')"> | |
2894db84 | 27 | <div class="form-inline" ng-repeat="groupBy in $ctrl.savedSearch.api_params.groupBy"> |
25523059 | 28 | <label for="crm-search-groupBy-{{ $index }}">{{:: ts('Group By') }}</label> |
ba106522 | 29 | <input id="crm-search-groupBy-{{ $index }}" class="form-control huge" ng-model="$ctrl.savedSearch.api_params.groupBy[$index]" crm-ui-select="{placeholder: ' ', data: fieldsForGroupBy}" ng-change="changeGroupBy($index)" /> |
25523059 CW |
30 | <hr> |
31 | </div> | |
32 | <div class="form-inline"> | |
7c219eb3 CW |
33 | <input id="crm-search-add-groupBy" |
34 | class="form-control crm-action-menu fa-plus" | |
35 | crm-ui-select="{placeholder: ts('Group By'), data: fieldsForGroupBy, dropdownCss: {width: '300px'}}" | |
36 | on-crm-ui-select="$ctrl.addParam('groupBy', selection)" > | |
25523059 | 37 | </div> |
25523059 CW |
38 | </fieldset> |
39 | </div> | |
88b95fd8 | 40 | <div class="crm-search-criteria-column"> |
9b057f1e | 41 | <fieldset class="api4-clause-fieldset"> |
b09e08e1 | 42 | <crm-search-clause clauses="$ctrl.savedSearch.api_params.where" format="string" op="AND" label="{{:: ts('Where') }}" fields="fieldsForWhere" ></crm-search-clause> |
25523059 | 43 | </fieldset> |
2894db84 | 44 | <fieldset ng-if="$ctrl.paramExists('having') && $ctrl.savedSearch.api_params.groupBy.length" class="api4-clause-fieldset"> |
b09e08e1 | 45 | <crm-search-clause clauses="$ctrl.savedSearch.api_params.having" format="string" op="AND" label="{{:: ts('Having') }}" fields="fieldsForHaving" ></crm-search-clause> |
25523059 CW |
46 | </fieldset> |
47 | </div> | |
48 | </div> | |
173405e2 CW |
49 | <fieldset id="crm-search-build-functions"> |
50 | <legend ng-click="controls.showFunctions = !controls.showFunctions"> | |
51 | <i class="crm-i fa-caret-{{ !controls.showFunctions ? 'right' : 'down' }}"></i> | |
52 | {{:: ts('Field Transformations') }} | |
53 | </legend> | |
54 | <div ng-if="!!controls.showFunctions"> | |
55 | <!-- Must use track by $index with an array of primitives, and manually refresh this loop when indexes change --> | |
56 | <fieldset ng-repeat="col in $ctrl.savedSearch.api_params.select track by $index" ng-if="!$ctrl.isPseudoField(col)"> | |
57 | <crm-search-function expr="$ctrl.savedSearch.api_params.select[$index]"></crm-search-function> | |
58 | </fieldset> | |
59 | </div> | |
60 | </fieldset> |