1 <md-dialog class="anyCondition-dialog" aria-label="New AnyCondition">
2 <form name="anyConditionForm" 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"
9 <span class="title">{{ vm.title | translate }}</span>
10 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
12 md-font-icon="icon-close"
13 aria-label="Close dialog"
19 <md-dialog-content ms-scroll>
20 <div class="error-list">
22 ng-repeat="error in vm.errors"
25 layout-align="space-between center"
28 <span class="message">{{error.message}}</span>
29 <span class="type">({{error.type}})</span>
31 <md-button class="md-icon-button">
33 md-font-icon="icon-alert-box"
34 aria-label="alert error"
40 <md-input-container class="md-block">
41 <label translate="TOOLS.FIELD">Field</label>
44 ng-model="vm.anyCondition.field"
48 <md-option ng-value="'queue'" ng-if="vm.trigger.channel == 'voice'">
49 {{ 'TOOLS.QUEUE' | translate }}
53 ng-value="'lastevent'"
54 ng-if="vm.trigger.channel == 'voice'"
56 {{ 'TOOLS.CALL_STATUS' | translate }}
59 <md-option ng-value="'routeId'" ng-if="vm.trigger.channel == 'voice'">
60 {{ 'TOOLS.OUTBOUNDROUTE' | translate }}
63 <md-option ng-value="'agent'" ng-if="vm.trigger.channel == 'voice'">
64 {{ 'TOOLS.AGENT' | translate }}
67 <md-option ng-value="'account'" ng-if="vm.trigger.channel != 'voice'">
68 {{ 'TOOLS.ACCOUNT' | translate }}
72 ng-value="'interaction'"
73 ng-if="vm.trigger.channel != 'voice'"
75 {{ 'TOOLS.INTERACTION' | translate }}
78 <md-option ng-value="'message'" ng-if="vm.trigger.channel != 'voice'">
79 {{ 'TOOLS.MESSAGE' | translate }}
83 ng-messages="anyConditionForm['field'].$error"
84 ng-show="anyConditionForm['field'].$touched"
87 <div ng-message="required">
88 <span translate="TOOLS.ERRORS.FIELD_REQUIRED"
89 >Field field is required</span
94 <md-input-container class="md-block">
95 <label translate="TOOLS.OPERATOR">Operator</label>
96 <md-select name="operator" ng-model="vm.anyCondition.operator" required>
97 <md-option ng-value="'equals'">
98 {{ 'TOOLS.EQUALS' | translate }}
101 <md-option ng-value="'not_equals'">
102 {{ 'TOOLS.NOT_EQUALS' | translate }}
106 ng-messages="anyConditionForm['operator'].$error"
107 ng-show="anyConditionForm['operator'].$touched"
110 <div ng-message="required">
111 <span translate="TOOLS.ERRORS.OPERATOR_REQUIRED"
112 >Operator field is required</span
116 </md-input-container>
118 ng-if="vm.anyCondition.field == 'account' && vm.trigger.channel == 'chat'"
121 <label translate="TOOLS.ACCOUNT">Account</label>
122 <md-select name="value" ng-model="vm.anyCondition.value" required>
125 ng-repeat="value in vm.chatAccounts"
126 ng-disabled="value.canSelect === false"
127 >{{ value.name }}</md-option
131 ng-messages="anyConditionForm['value'].$error"
132 ng-show="anyConditionForm['value'].$touched"
135 <div ng-message="required">
136 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
137 >Account field is required</span
141 </md-input-container>
143 ng-if="vm.anyCondition.field == 'account' && vm.trigger.channel == 'mail'"
146 <label translate="TOOLS.ACCOUNT">Account</label>
147 <md-select name="value" ng-model="vm.anyCondition.value" required>
150 ng-repeat="value in vm.mailAccounts"
151 ng-disabled="value.canSelect === false"
152 >{{ value.name }}</md-option
156 ng-messages="anyConditionForm['value'].$error"
157 ng-show="anyConditionForm['value'].$touched"
160 <div ng-message="required">
161 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
162 >Account field is required</span
166 </md-input-container>
168 ng-if="vm.anyCondition.field == 'account' && vm.trigger.channel == 'sms'"
171 <label translate="TOOLS.ACCOUNT">Account</label>
172 <md-select name="value" ng-model="vm.anyCondition.value" required>
175 ng-repeat="value in vm.smsAccounts"
176 ng-disabled="value.canSelect === false"
177 >{{ value.name }}</md-option
181 ng-messages="anyConditionForm['value'].$error"
182 ng-show="anyConditionForm['value'].$touched"
185 <div ng-message="required">
186 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
187 >Account field is required</span
191 </md-input-container>
193 ng-if="vm.anyCondition.field == 'account' && vm.trigger.channel == 'fax'"
196 <label translate="TOOLS.ACCOUNT">Account</label>
197 <md-select name="value" ng-model="vm.anyCondition.value" required>
200 ng-repeat="value in vm.faxAccounts"
201 ng-disabled="value.canSelect === false"
202 >{{ value.name }}</md-option
206 ng-messages="anyConditionForm['value'].$error"
207 ng-show="anyConditionForm['value'].$touched"
210 <div ng-message="required">
211 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
212 >Account field is required</span
216 </md-input-container>
218 ng-if="vm.anyCondition.field == 'account' && vm.trigger.channel == 'openchannel'"
221 <label translate="TOOLS.ACCOUNT">Account</label>
222 <md-select name="value" ng-model="vm.anyCondition.value" required>
225 ng-repeat="value in vm.openchannelAccounts"
226 ng-disabled="value.canSelect === false"
227 >{{ value.name }}</md-option
231 ng-messages="anyConditionForm['value'].$error"
232 ng-show="anyConditionForm['value'].$touched"
235 <div ng-message="required">
236 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
237 >Account field is required</span
241 </md-input-container>
243 ng-if="vm.anyCondition.field == 'queue' && vm.trigger.channel == 'voice'"
246 <label translate="TOOLS.QUEUE">Queue</label>
247 <md-select name="value" ng-model="vm.anyCondition.value" required>
249 ng-value="value.name"
250 ng-repeat="value in vm.queues"
251 ng-disabled="value.canSelect === false"
252 >{{ value.name }}</md-option
256 ng-messages="anyConditionForm['value'].$error"
257 ng-show="anyConditionForm['value'].$touched"
260 <div ng-message="required">
261 <span translate="TOOLS.ERRORS.QUEUE_REQUIRED"
262 >Queue field is required</span
266 </md-input-container>
268 ng-if="vm.anyCondition.field == 'routeId' && vm.trigger.channel == 'voice'"
271 <label translate="TOOLS.OUTBOUNDROUTE">OutboundRoute</label>
272 <md-select name="value" ng-model="vm.anyCondition.value" required>
275 ng-repeat="value in vm.outboundRoutes"
276 ng-disabled="value.canSelect === false"
277 >{{ value.exten }}</md-option
281 ng-messages="anyConditionForm['value'].$error"
282 ng-show="anyConditionForm['value'].$touched"
285 <div ng-message="required">
286 <span translate="TOOLS.ERRORS.OUTBOUNDROUTE_REQUIRED"
287 >OutboundRoute field is required</span
291 </md-input-container>
293 ng-if="vm.anyCondition.field == 'agent' && vm.trigger.channel == 'voice'"
296 <label translate="TOOLS.AGENT">Agent</label>
297 <md-select name="value" ng-model="vm.anyCondition.value" required>
299 ng-value="value.name"
300 ng-repeat="value in vm.agents"
301 ng-disabled="value.canSelect === false"
302 >{{ value.fullname }}</md-option
306 ng-messages="anyConditionForm['value'].$error"
307 ng-show="anyConditionForm['value'].$touched"
310 <div ng-message="required">
311 <span translate="TOOLS.ERRORS.AGENT_REQUIRED"
312 >Agent field is required</span
316 </md-input-container>
318 ng-if="vm.anyCondition.field == 'lastevent'"
321 <label translate="TOOLS.VALUE">Value</label>
322 <md-select name="value" ng-model="vm.anyCondition.value" required>
323 <md-option ng-value="'abandoned'">Abandon</md-option>
324 <md-option ng-value="'timeout'">Timeout</md-option>
325 <md-option ng-value="'complete'">Hangup</md-option>
326 <md-option ng-value="'rejected'">Reject</md-option>
327 <md-option ng-value="'called'">Ring</md-option>
328 <md-option ng-value="'connect'">Answer</md-option>
329 <md-option ng-value="'nosuchnumber'">NoSuchNumber</md-option>
330 <md-option ng-value="'busy'">Busy</md-option>
331 <md-option ng-value="'noanswer'">NoAnswer</md-option>
332 <md-option ng-value="'congestion'">Congestion</md-option>
333 <md-option ng-value="'agentreject'">AgentReject</md-option>
336 ng-messages="anyConditionForm['value'].$error"
337 ng-show="anyConditionForm['value'].$touched"
340 <div ng-message="required">
341 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
342 >Value field is required</span
346 </md-input-container>
348 ng-if="vm.anyCondition.field == 'interaction' && vm.trigger.channel != 'voice'"
351 <label translate="TOOLS.VALUE">Value</label>
352 <md-select name="value" ng-model="vm.anyCondition.value" required>
353 <md-option ng-value="'opened'">Opened</md-option>
354 <md-option ng-value="'closed'">Closed</md-option>
357 ng-messages="anyConditionForm['value'].$error"
358 ng-show="anyConditionForm['value'].$touched"
361 <div ng-message="required">
362 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
363 >Value field is required</span
367 </md-input-container>
369 ng-if="vm.anyCondition.field == 'message' && vm.trigger.channel != 'voice'"
372 <label translate="TOOLS.VALUE">Value</label>
373 <md-select name="value" ng-model="vm.anyCondition.value" required>
374 <md-option ng-value="'in'">Incoming</md-option>
375 <md-option ng-value="'out'">Outgoing</md-option>
376 <md-option ng-value="'accept'">Accepted</md-option>
377 <md-option ng-value="'reject'">Rejected</md-option>
380 ng-messages="anyConditionForm['value'].$error"
381 ng-show="anyConditionForm['value'].$touched"
384 <div ng-message="required">
385 <span translate="TOOLS.ERRORS.VALUE_REQUIRED"
386 >Value field is required</span
390 </md-input-container>
392 <div class="error-list">
394 ng-repeat="error in vm.errors"
397 layout-align="space-between center"
400 <span class="message">{{error.message}}</span>
401 <span class="type">({{error.type}})</span>
403 <md-button class="md-icon-button">
405 md-font-icon="icon-alert-box"
406 aria-label="alert error"
416 layout-align="space-between center"
417 ng-if="!vm.crudPermissions.readOnly"
419 <div layout="row" layout-align="start center">
422 ng-if="vm.crudPermissions.canEdit && !vm.newAnyCondition"
423 ng-click="vm.saveAnyCondition()"
424 class="send-button md-accent md-raised"
425 ng-disabled="anyConditionForm.$invalid || anyConditionForm.$pristine"
427 translate="TOOLS.SAVE"
428 translate-attr-aria-label="TOOLS.SAVE"
435 ng-if="vm.crudPermissions.canEdit && vm.newAnyCondition"
436 ng-click="vm.addNewAnyCondition()"
437 class="send-button md-accent md-raised"
438 ng-disabled="anyConditionForm.$invalid"
440 translate="TOOLS.ADD_ANYCONDITION"
441 translate-attr-aria-label="TOOLS.ADD_ANYCONDITION"
448 class="md-icon-button"
449 ng-if="vm.crudPermissions.canDelete && !vm.newAnyCondition"
450 ng-click="vm.deleteAnyCondition($event)"
453 translate-attr-aria-label="TOOLS.DELETE"
455 <md-icon md-font-icon="icon-delete"></md-icon>
456 <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>