1 <eg-string #defaultSearchSavedString i18n-text text="Default search saved"></eg-string>
2 <eg-string #defaultSearchResetString i18n-text text="Default search reset"></eg-string>
4 <div id="acq-search-form" class="pl-3 pr-3 pt-3 pb-3 mb-3">
7 <div class="col form-group form-inline">
8 <label i18n>Search for records matching
9 <select class="form-inline ml-1 mr-1" id="acq-search-conjunction" [ngModelOptions]="{standalone: true}" [(ngModel)]="searchConjunction">
10 <option value="all">all</option>
11 <option value="any">any</option>
13 of the following terms:</label>
15 <div class="col-auto">
16 <a class="with-material-icon no-href text-primary"
17 title="Show Form" i18n-title
19 *ngIf="!showForm" (click)="showForm=true"><span class="sr-only" i18n>Show Form</span>
20 <span class="material-icons" aria-hidden="true">expand_more</span>
22 <a class="with-material-icon no-href text-primary"
23 title="Hide Form" i18n-title
25 *ngIf="showForm" (click)="showForm=false"><span class="sr-only" i18n>Hide Form</span>
26 <span class="material-icons" aria-hidden="true">expand_less</span>
30 <div class="row mb-1" *ngFor="let t of searchTerms; let idx=index" [hidden]="!showForm">
31 <div class="col-md-5 col-lg-3">
32 <select class="form-control" id="selected-search-term" [ngModelOptions]="{standalone: true}" [ngModel]="t.field"
33 (ngModelChange)="old = t.field; t.field = $event"
34 (change)="clearSearchTerm(t, old)">
35 <option disabled="disabled" i18n>Select Search Field</option>
36 <optgroup *ngFor="let g of hints" label="{{availableSearchFields[g]['__label']}}">
37 <option *ngFor="let o of availableSearchFields[g]['__fields']" value="{{g}}:{{o}}">
38 {{availableSearchFields[g]['__label']}} - {{availableSearchFields[g][o].label}}
43 <div class="col-xs-2 pl-3">
44 <select class="form-control" id="selected-search-op" [ngModelOptions]="{standalone: true}" [(ngModel)]="t.op"
45 (ngModelChange)="oldOp = t.op; t.op = $event"
46 (change)="clearSearchTermValueAfterOpChange(t, oldOp)">
47 <option i18n value="">is</option>
48 <option i18n value="__not">is NOT</option>
49 <option i18n value="__fuzzy" [hidden]="searchTermDatatypes[t.field] !== 'text' && searchFieldLinkedClasses[t.field] !== 'acqpro' && searchFieldLinkedClasses[t.field] !== 'au'">contains</option>
50 <option i18n value="__not,__fuzzy" [hidden]="searchTermDatatypes[t.field] !== 'text' && searchFieldLinkedClasses[t.field] !== 'acqpro' && searchFieldLinkedClasses[t.field] !== 'au'">does NOT contain</option>
51 <option i18n value="__starts" [hidden]="searchTermDatatypes[t.field] !== 'text'">STARTS with</option>
52 <option i18n value="__ends" [hidden]="searchTermDatatypes[t.field] !== 'text'">ENDS with</option>
53 <option i18n value="__lte" [hidden]="searchTermDatatypes[t.field] !== 'timestamp' && !dateLikeSearchFields[t.field]">is on or BEFORE</option>
54 <option i18n value="__gte" [hidden]="searchTermDatatypes[t.field] !== 'timestamp' && !dateLikeSearchFields[t.field]">is on or AFTER</option>
55 <option i18n value="__between" [hidden]="searchTermDatatypes[t.field] !== 'timestamp'">is BETWEEN</option>
56 <option i18n value="__age" [hidden]="searchTermDatatypes[t.field] !== 'timestamp'">age (relative date)</option>
57 <option i18n value="__isnotnull" [hidden]="searchTermDatatypes[t.field] === 'id' || searchTermFieldIsRequired[t.field]">exists</option>
58 <option i18n value="__isnull" [hidden]="searchTermDatatypes[t.field] === 'id' || searchTermFieldIsRequired[t.field]">does NOT exist</option>
59 <option i18n value="__in">matches a term from a file</option>
62 <div class="col-sm-3">
63 <ng-container *ngIf="t.op === '__in' || t.op === '__isnull' || t.op === '__isnotnull'">
64 <ng-container *ngIf="t.op === '__in'">
65 <eg-file-reader [(ngModel)]="t.value1" [ngModelOptions]="{standalone: true}"></eg-file-reader>
68 <ng-container *ngIf="t.op !== '__in' && t.op !== '__isnull' && t.op !== '__isnotnull'">
69 <div *ngIf="t.field.endsWith(':state') && (t.op === '' || t.op === '__not'); else notStateField">
70 <eg-combobox *ngIf="t.op !== '__fuzzy'"
71 [asyncSupportsEmptyTermClick]="true"
72 [idlClass]="searchFieldLinkedClasses[t.field]"
73 [selectedId]="t.value1"
74 (onChange)="t.value1 = $event ? $event.id : ''">
77 <ng-template #notStateField>
78 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="text" *ngIf="searchTermDatatypes[t.field] === 'id'" class="form-control" />
79 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="text" *ngIf="searchTermDatatypes[t.field] === 'text'" class="form-control" />
80 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="number" *ngIf="searchTermDatatypes[t.field] === 'int'" class="form-control" />
81 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="number" *ngIf="searchTermDatatypes[t.field] === 'money'" class="form-control" />
82 <select [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" *ngIf="searchTermDatatypes[t.field] === 'bool'" class="form-control">
83 <option i18n value="t">Yes</option>
84 <option i18n value="f">No</option>
86 <eg-org-select *ngIf="searchTermDatatypes[t.field] === 'org_unit'"
87 [initialOrgId]="t.value1"
88 (onChange)="setOrgUnitSearchValue($event, t)">
90 <ng-container *ngIf="searchTermDatatypes[t.field] === 'link'">
91 <ng-container *ngIf="searchFieldLinkedClasses[t.field] === 'acqpro'">
92 <eg-combobox *ngIf="t.op !== '__fuzzy' && t.op !== '__not,__fuzzy'"
93 [idlClass]="searchFieldLinkedClasses[t.field]"
94 [selectedId]="t.value1"
95 (onChange)="t.value1 = $event ? $event.id : ''">
97 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="text" *ngIf="t.op === '__fuzzy' || t.op === '__not,__fuzzy'" class="form-control" />
99 <ng-container *ngIf="searchFieldLinkedClasses[t.field] === 'au'">
100 <eg-combobox *ngIf="!t.op.includes('__fuzzy')"
101 [idlClass]="searchFieldLinkedClasses[t.field]"
102 [selectedId]="t.value1"
103 (onChange)="t.value1 = $event ? $event.id : ''">
105 <input [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1" type="text" *ngIf="t.op.includes('__fuzzy')" class="form-control" />
107 <ng-container *ngIf="searchFieldLinkedClasses[t.field] !== 'acqpro' && searchFieldLinkedClasses[t.field] !== 'au'">
109 [asyncSupportsEmptyTermClick]="t.field.endsWith('cancel_reason') || t.field.endsWith(':claim_policy') || t.field.endsWith('_method')"
110 [idlClass]="searchFieldLinkedClasses[t.field]"
111 [selectedId]="t.value1"
112 (onChange)="t.value1 = $event ? $event.id : ''">
116 <eg-date-select *ngIf="searchTermDatatypes[t.field] === 'timestamp' && t.op !== '__age'"
117 [initialIso]="t.value1"
118 (onChangeAsIso)="t.value1 = $event ? $event : ''; t.is_date = true">
120 <ng-container *ngIf="searchTermDatatypes[t.field] === 'timestamp' && t.op === '__between'">
121 <span i18n>and</span>
123 [initialIso]="t.value2"
124 (onChangeAsIso)="t.value2 = $event ? $event : ''; t.is_date = true">
127 <eg-interval-input *ngIf="searchTermDatatypes[t.field] === 'timestamp' && t.op === '__age'"
128 [ngModelOptions]="{standalone: true}" [(ngModel)]="t.value1">
133 <div class="col-xs-2 pl-3 pr-1">
134 <button class="btn btn-sm material-icon-button" type="button"
135 (click)="addSearchTerm()"
136 i18n-title title="Add Search Row"><span class="sr-only">Add Search Row</span>
137 <span class="material-icons" aria-hidden="true">add_circle_outline</span>
139 <button class="btn btn-sm material-icon-button" type="button"
140 (click)="delSearchTerm(idx)"
141 i18n-title title="Remove Search Row"><span class="sr-only">Remove Search Row</span>
142 <span class="material-icons" aria-hidden="true">remove_circle_outline</span>
146 <div class="row" [hidden]="!showForm">
147 <div class="col-sm-2">
148 <button class="btn btn-success" (click)="submitSearch()" type="submit" i18n>Search</button>
150 <div class="col-xs-3"></div>
151 <div class="col-xs-5 pl-3">
152 <button class="btn btn-primary mr-1" (click)="saveSearchAsDefault()" type="button" i18n>Set As Default {{searchTypeLabel}} Search</button>
153 <button class="btn btn-secondary" (click)="clearDefaultSearch()" type="button" [disabled]="!hasDefaultSearch" i18n>
157 <div class="col-xs-3 pl-5">
158 <input class="form-check-input" type="checkbox" id="retrieve-immediately"
159 (change)="saveRunImmediately()"
160 [ngModelOptions]="{standalone: true}" [(ngModel)]="runImmediately"/>
161 <label for="retrieve-immediately" class="form-check-label" i18n>Retrieve Results Immediately</label>