1 <md-dialog class="allCondition-dialog" aria-label="New AllCondition">
2 <form name="allConditionForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
10 >{{ vm.newAllCondition ? 'TOOLS.NEW_ALLCONDITION' :
11 'TOOLS.EDIT_ALLCONDITION' | translate }}</span
13 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
15 md-font-icon="icon-close"
16 aria-label="Close dialog"
21 <md-dialog-content ms-scroll>
22 <md-input-container class="md-block">
23 <label translate="TOOLS.FIELD">Field</label>
26 ng-model="vm.allCondition.field"
27 ng-change="vm.onFieldSelection()"
31 <md-option ng-value="'queue'" ng-if="vm.trigger.channel == 'voice'">
32 {{ 'TOOLS.QUEUE' | translate }}
35 ng-value="'lastevent'"
36 ng-if="vm.trigger.channel == 'voice'"
38 {{ 'TOOLS.CALL_STATUS' | translate }}
40 <md-option ng-value="'routeId'" ng-if="vm.trigger.channel == 'voice'">
41 {{ 'TOOLS.OUTBOUNDROUTE' | translate }}
43 <md-option ng-value="'agent'" ng-if="vm.trigger.channel == 'voice'">
44 {{ 'TOOLS.AGENT' | translate }}
46 <md-option ng-value="'account'" ng-if="vm.trigger.channel != 'voice'">
47 {{ 'TOOLS.ACCOUNT' | translate }}
50 ng-value="'interaction'"
51 ng-if="vm.trigger.channel != 'voice'"
53 {{ 'TOOLS.INTERACTION' | translate }}
55 <md-option ng-value="'message'" ng-if="vm.trigger.channel != 'voice'">
56 {{ 'TOOLS.MESSAGE' | translate }}
60 ng-messages="allConditionForm['field'].$error"
61 ng-show="allConditionForm['field'].$touched"
64 <div ng-message="required">
65 <span translate="TOOLS.ERRORS.FIELD_REQUIRED"
66 >Field field is required</span
71 <md-input-container class="md-block">
72 <label translate="TOOLS.OPERATOR">Operator</label>
73 <md-select name="operator" ng-model="vm.allCondition.operator" required>
74 <md-option ng-value="'equals'">
75 {{ 'TOOLS.EQUALS' | translate }}
77 <md-option ng-value="'not_equals'">
78 {{ 'TOOLS.NOT_EQUALS' | translate }}
82 ng-messages="allConditionForm['operator'].$error"
83 ng-show="allConditionForm['operator'].$touched"
86 <div ng-message="required">
87 <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED"
88 >Operator field is required</span
94 ng-if="vm.allCondition.field == 'account'"
97 <label translate="TOOLS.ACCOUNT">Account</label>
98 <md-select name="value" ng-model="vm.allCondition.value" required>
101 ng-repeat="value in vm.accounts"
102 ng-disabled="value.canSelect === false"
104 {{ value.name }}</md-option
108 ng-messages="allConditionForm['value'].$error"
109 ng-show="allConditionForm['value'].$touched"
112 <div ng-message="required">
113 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
114 >Account field is required</span
118 </md-input-container>
120 ng-if="vm.allCondition.field == 'queue' && vm.trigger.channel == 'voice'"
123 <label translate="TOOLS.QUEUE">Queue</label>
124 <md-select name="value" ng-model="vm.allCondition.value" required>
126 ng-value="value.name"
127 ng-repeat="value in vm.queues"
128 ng-disabled="value.canSelect === false"
130 {{ value.name }}</md-option
134 ng-messages="allConditionForm['value'].$error"
135 ng-show="allConditionForm['value'].$touched"
138 <div ng-message="required">
139 <span translate="TOOLS.ERRORS.QUEUE_REQUIRED"
140 >Queue field is required</span
144 </md-input-container>
146 ng-if="vm.allCondition.field == 'routeId' && vm.trigger.channel == 'voice'"
149 <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>
150 <md-select name="value" ng-model="vm.allCondition.value" required>
153 ng-repeat="value in vm.outboundRoutes"
154 ng-disabled="value.canSelect === false"
156 {{ value.exten }}</md-option
160 ng-messages="allConditionForm['value'].$error"
161 ng-show="allConditionForm['value'].$touched"
164 <div ng-message="required">
165 <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED"
166 >OutboundRoute field is required</span
170 </md-input-container>
172 ng-if="vm.allCondition.field == 'agent' && vm.trigger.channel == 'voice'"
175 <label translate="TOOLS.AGENT">Agent</label>
176 <md-select name="value" ng-model="vm.allCondition.value" required>
178 ng-value="value.name"
179 ng-repeat="value in vm.agents"
180 ng-disabled="value.canSelect === false"
182 {{ value.fullname }}</md-option
186 ng-messages="allConditionForm['value'].$error"
187 ng-show="allConditionForm['value'].$touched"
190 <div ng-message="required">
191 <span translate="TOOLS.ERRORS.AGENT_REQUIRED"
192 >Agent field is required</span
196 </md-input-container>
198 ng-if="vm.allCondition.field == 'lastevent'"
201 <label translate="TOOLS.VALUE">Value</label>
202 <md-select name="value" ng-model="vm.allCondition.value" required>
204 ng-value="status.value"
205 ng-repeat="status in vm.callStatuses"
207 {{ status.name }}</md-option
211 ng-messages="allConditionForm['value'].$error"
212 ng-show="allConditionForm['value'].$touched"
215 <div ng-message="required">
216 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
217 >Value field is required</span
221 </md-input-container>
223 ng-if="vm.allCondition.field == 'interaction' && vm.trigger.channel != 'voice'"
226 <label translate="TOOLS.VALUE">Value</label>
227 <md-select name="value" ng-model="vm.allCondition.value" required>
228 <md-option ng-value="'opened'">Opened</md-option>
229 <md-option ng-value="'closed'">Closed</md-option>
232 ng-messages="allConditionForm['value'].$error"
233 ng-show="allConditionForm['value'].$touched"
236 <div ng-message="required">
237 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
238 >Value field is required</span
242 </md-input-container>
244 ng-if="vm.allCondition.field == 'message' && vm.trigger.channel != 'voice'"
247 <label translate="TOOLS.VALUE">Value</label>
248 <md-select name="value" ng-model="vm.allCondition.value" required>
249 <md-option ng-value="'in'">Incoming</md-option>
250 <md-option ng-value="'out'">Outgoing</md-option>
251 <md-option ng-value="'accept'">Accepted</md-option>
252 <md-option ng-value="'reject'">Rejected</md-option>
255 ng-messages="allConditionForm['value'].$error"
256 ng-show="allConditionForm['value'].$touched"
259 <div ng-message="required">
260 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
261 >Value field is required</span
265 </md-input-container>
266 <div class="error-list">
268 ng-repeat="error in vm.errors"
271 layout-align="space-between center"
274 <span class="message">{{error.message}}</span>
275 <span class="type">({{error.type}})</span>
277 <md-button class="md-icon-button">
279 md-font-icon="icon-alert-box"
280 aria-label="alert error"
289 layout-align="space-between center"
290 ng-if="!vm.crudPermissions.readOnly"
292 <div layout="row" layout-align="start center">
295 ng-if="vm.crudPermissions.canEdit && !vm.newAllCondition"
296 ng-click="vm.saveAllCondition()"
297 class="send-button md-accent md-raised"
298 ng-disabled="allConditionForm.$invalid || allConditionForm.$pristine"
300 translate="TOOLS.SAVE"
301 translate-attr-aria-label="TOOLS.SAVE"
307 ng-if="vm.crudPermissions.canEdit && vm.newAllCondition"
308 ng-click="vm.addNewAllCondition()"
309 class="send-button md-accent md-raised"
310 ng-disabled="allConditionForm.$invalid"
312 translate="TOOLS.ADD_ALLCONDITION"
313 translate-attr-aria-label="TOOLS.ADD_ALLCONDITION"
320 class="md-icon-button"
321 ng-if="vm.crudPermissions.canDelete && !vm.newAllCondition"
322 ng-click="vm.deleteAllCondition($event)"
325 translate-attr-aria-label="TOOLS.DELETE"
327 <md-icon md-font-icon="icon-delete"></md-icon>
328 <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>