f85fec6098571d9d9cb263a6d33a09b135603203
[motion-next.git] /
1 <md-dialog class="dashboarditem-dialog" aria-label="New DashboardItem">
2   <form name="dashboarditemForm" class="md-inline-form" novalidate>
3     <md-toolbar class="md-accent md-hue-2">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title">{{ vm.title | translate }}</span>
10         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
11           <md-icon
12             md-font-icon="icon-close"
13             aria-label="Close dialog"
14           ></md-icon>
15         </md-button>
16       </div>
17     </md-toolbar>
18
19     <md-dialog-content ms-scroll>
20       <div class="error-list">
21         <div
22           ng-repeat="error in vm.errors"
23           class="error"
24           layout="row"
25           layout-align="space-between center"
26         >
27           <div>
28             <span class="message">{{error.message}}</span>
29             <span class="type">({{error.type}})</span>
30           </div>
31           <md-button class="md-icon-button">
32             <md-icon
33               md-font-icon="icon-alert-box"
34               aria-label="alert error"
35               class="s16"
36             ></md-icon>
37           </md-button>
38         </div>
39       </div>
40       <md-input-container class="md-block">
41         <label translate="TOOLS.TYPE">Type</label>
42         <md-select
43           name="type"
44           ng-model="vm.dashboarditem.type"
45           autofocus
46           ng-disabled="!vm.newDashboardItem"
47         >
48           <md-option ng-value="'counter'">
49             {{ 'TOOLS.COUNTER' | translate }}
50           </md-option>
51
52           <md-option ng-value="'multibar-chart'">
53             {{ 'TOOLS.MULTIBARCHART' | translate }}
54           </md-option>
55
56           <md-option ng-value="'pie-chart'">
57             {{ 'TOOLS.PIECHART' | translate }}
58           </md-option>
59
60           <md-option ng-value="'web-report'">
61             {{ 'TOOLS.WEBREPORT' | translate }}
62           </md-option>
63
64           <md-option ng-value="'iframe'">
65             {{ 'TOOLS.IFRAME' | translate }}
66           </md-option>
67
68           <md-option ng-value="'clock'">
69             {{ 'TOOLS.CLOCK' | translate }}
70           </md-option>
71
72           <md-option ng-value="'custom'">
73             {{ 'TOOLS.CUSTOMTYPE' | translate }}
74           </md-option>
75         </md-select>
76         <div
77           ng-messages="dashboarditemForm['type'].$error"
78           ng-show="dashboarditemForm['type'].$touched"
79           role="alert"
80         >
81           <div ng-message="required">
82             <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
83               >Type field is required</span
84             >
85           </div>
86         </div>
87       </md-input-container>
88       <md-input-container class="md-block">
89         <label translate="TOOLS.TITLE">Title</label>
90         <input
91           type="text"
92           name="title"
93           ng-model="vm.dashboarditem.title"
94           md-maxlength="255"
95           ng-required="true"
96         />
97
98         <div
99           ng-messages="dashboarditemForm['title'].$error"
100           ng-show="dashboarditemForm['title'].$touched"
101           role="alert"
102         >
103           <div ng-message="required">
104             <span translate="TOOLS.ERRORS.TITLE_REQUIRED"
105               >Title field is required</span
106             >
107           </div>
108           <div ng-message="md-maxlength">
109             <span
110               translate="TOOLS.ERRORS.TITLE_MAX_LENGTH"
111               translate-values="{max: 255}"
112               >Title must have a maximum length equal to 255</span
113             >
114           </div>
115         </div>
116       </md-input-container>
117       <md-input-container
118         ng-if="vm.dashboarditem.type == 'iframe'"
119         class="md-block"
120       >
121         <label translate="TOOLS.URL">Url</label>
122         <input
123           type="url"
124           name="attrUrl"
125           ng-model="vm.dashboarditem.attrUrl"
126           ng-required="true"
127         />
128
129         <div
130           ng-messages="dashboarditemForm['attrUrl'].$error"
131           ng-show="dashboarditemForm['attrUrl'].$touched"
132           role="alert"
133         >
134           <div ng-message="required">
135             <span translate="TOOLS.ERRORS.URL_REQUIRED"
136               >Url field is required</span
137             >
138           </div>
139           <div ng-message="url">
140             <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
141               >Url must be a valid url http://www.xcally.com</span
142             >
143           </div>
144         </div>
145       </md-input-container>
146       <md-input-container
147         ng-if="vm.dashboarditem.type == 'custom'"
148         class="md-block"
149       >
150         <label translate="TOOLS.PATH">Path</label>
151         <input
152           type="text"
153           name="attrPath"
154           ng-model="vm.dashboarditem.attrPath"
155           ng-required="true"
156         />
157
158         <div
159           ng-messages="dashboarditemForm['attrPath'].$error"
160           ng-show="dashboarditemForm['attrPath'].$touched"
161           role="alert"
162         >
163           <div ng-message="required">
164             <span translate="TOOLS.ERRORS.PATH_REQUIRED"
165               >Path field is required</span
166             >
167           </div>
168         </div>
169       </md-input-container>
170       <md-input-container
171         ng-if="vm.dashboarditem.type == 'clock'"
172         class="md-block"
173       >
174         <label translate="TOOLS.FORMAT">Format</label>
175         <input
176           type="text"
177           name="attrHourFormat"
178           ng-model="vm.dashboarditem.attrHourFormat"
179           ng-required="true"
180         />
181
182         <div
183           ng-messages="dashboarditemForm['attrHourFormat'].$error"
184           ng-show="dashboarditemForm['attrHourFormat'].$touched"
185           role="alert"
186         >
187           <div ng-message="required">
188             <span translate="TOOLS.ERRORS.FORMAT_REQUIRED"
189               >Format field is required</span
190             >
191           </div>
192         </div>
193       </md-input-container>
194       <md-input-container
195         ng-if="vm.dashboarditem.type == 'clock'"
196         class="md-block"
197       >
198         <label translate="TOOLS.TIMEZONE">Timezone</label>
199         <md-select
200           name="attrTimezone"
201           ng-model="vm.dashboarditem.attrTimezone"
202           required
203         >
204           <md-option ng-value="'-12.00'">GMT-12.00</md-option>
205           <md-option ng-value="'-11.00'">GMT-11.00</md-option>
206           <md-option ng-value="'-10.00'">GMT-10.00</md-option>
207           <md-option ng-value="'-9.00'">GMT-9.00</md-option>
208           <md-option ng-value="'-8.00'">GMT-8.00</md-option>
209           <md-option ng-value="'-7.00'">GMT-7.00</md-option>
210           <md-option ng-value="'-6.00'">GMT-6.00</md-option>
211           <md-option ng-value="'-5.00'">GMT-5.00</md-option>
212           <md-option ng-value="'-4.00'">GMT-4.00</md-option>
213           <md-option ng-value="'-3.30'">GMT-3.30</md-option>
214           <md-option ng-value="'-3.00'">GMT-3.00</md-option>
215           <md-option ng-value="'-2.00'">GMT-2.00</md-option>
216           <md-option ng-value="'-1.00'">GMT-1.00</md-option>
217           <md-option ng-value="'0.00'">GMT 0.00</md-option>
218           <md-option ng-value="'1.00'">GMT+1.00</md-option>
219           <md-option ng-value="'2.00'">GMT+2.00</md-option>
220           <md-option ng-value="'3.00'">GMT+3.00</md-option>
221           <md-option ng-value="'3.30'">GMT+3.30</md-option>
222           <md-option ng-value="'4.00'">GMT+4.00</md-option>
223           <md-option ng-value="'4.30'">GMT+4.30</md-option>
224           <md-option ng-value="'5.00'">GMT+5.00</md-option>
225           <md-option ng-value="'5.30'">GMT+5.30</md-option>
226           <md-option ng-value="'5.45'">GMT+5.45</md-option>
227           <md-option ng-value="'6.00'">GMT+6.00</md-option>
228           <md-option ng-value="'6.30'">GMT+6.30</md-option>
229           <md-option ng-value="'7.00'">GMT+7.00</md-option>
230           <md-option ng-value="'8.00'">GMT+8.00</md-option>
231           <md-option ng-value="'9.00'">GMT+9.00</md-option>
232           <md-option ng-value="'9.30'">GMT+9.30</md-option>
233           <md-option ng-value="'10.00'">GMT+10.00</md-option>
234           <md-option ng-value="'11.00'">GMT+11.00</md-option>
235           <md-option ng-value="'12.00'">GMT+12.00</md-option>
236           <md-option ng-value="'13.00'">GMT+13.00</md-option>
237         </md-select>
238         <div
239           ng-messages="dashboarditemForm['attrTimezone'].$error"
240           ng-show="dashboarditemForm['attrTimezone'].$touched"
241           role="alert"
242         >
243           <div ng-message="required">
244             <span translate="TOOLS.ERRORS.TIMEZONE_REQUIRED"
245               >Timezone field is required</span
246             >
247           </div>
248         </div>
249       </md-input-container>
250       <md-input-container
251         ng-if="vm.dashboarditem.type == 'counter'"
252         class="md-block"
253       >
254         <label translate="TOOLS.METRIC">Metric</label>
255         <md-select
256           name="attrMetric"
257           ng-model="vm.dashboarditem.attrMetric"
258           required
259         >
260           <md-option ng-value="'total'">
261             {{ 'TOOLS.TOTAL' | translate }}
262           </md-option>
263
264           <md-option ng-value="'abandoned'">
265             {{ 'TOOLS.ABANDONED' | translate }}
266           </md-option>
267
268           <md-option ng-value="'waiting'">
269             {{ 'TOOLS.WAITING' | translate }}
270           </md-option>
271
272           <md-option ng-value="'talking'">
273             {{ 'TOOLS.TALKING' | translate }}
274           </md-option>
275
276           <md-option ng-value="'answered'">
277             {{ 'TOOLS.ANSWERED' | translate }}
278           </md-option>
279
280           <md-option ng-value="'unmanaged'">
281             {{ 'TOOLS.UNMANAGED' | translate }}
282           </md-option>
283         </md-select>
284         <div
285           ng-messages="dashboarditemForm['attrMetric'].$error"
286           ng-show="dashboarditemForm['attrMetric'].$touched"
287           role="alert"
288         >
289           <div ng-message="required">
290             <span translate="TOOLS.ERRORS.METRIC_REQUIRED"
291               >Metric field is required</span
292             >
293           </div>
294         </div>
295       </md-input-container>
296       <md-input-container
297         ng-if="['multibar-chart', 'pie-chart'].includes(vm.dashboarditem.type)"
298         class="md-block"
299       >
300         <label translate="TOOLS.SERIE1">Serie1</label>
301         <md-select
302           name="attrSerie1"
303           ng-model="vm.dashboarditem.attrSerie1"
304           required
305         >
306           <md-option ng-value="'total'">
307             {{ 'TOOLS.TOTAL' | translate }}
308           </md-option>
309
310           <md-option ng-value="'abandoned'">
311             {{ 'TOOLS.ABANDONED' | translate }}
312           </md-option>
313
314           <md-option ng-value="'waiting'">
315             {{ 'TOOLS.WAITING' | translate }}
316           </md-option>
317
318           <md-option ng-value="'talking'">
319             {{ 'TOOLS.TALKING' | translate }}
320           </md-option>
321
322           <md-option ng-value="'answered'">
323             {{ 'TOOLS.ANSWERED' | translate }}
324           </md-option>
325
326           <md-option ng-value="'unmanaged'">
327             {{ 'TOOLS.UNMANAGED' | translate }}
328           </md-option>
329         </md-select>
330         <div
331           ng-messages="dashboarditemForm['attrSerie1'].$error"
332           ng-show="dashboarditemForm['attrSerie1'].$touched"
333           role="alert"
334         >
335           <div ng-message="required">
336             <span translate="TOOLS.ERRORS.SERIE1_REQUIRED"
337               >Serie1 field is required</span
338             >
339           </div>
340         </div>
341       </md-input-container>
342       <md-input-container
343         ng-if="['multibar-chart', 'pie-chart'].includes(vm.dashboarditem.type)"
344         class="md-block"
345       >
346         <label translate="TOOLS.SERIE2">Serie2</label>
347         <md-select name="attrSerie2" ng-model="vm.dashboarditem.attrSerie2">
348           <md-option ng-value="'null'">
349             {{ 'TOOLS.NONE' | translate }}
350           </md-option>
351
352           <md-option ng-value="'total'">
353             {{ 'TOOLS.TOTAL' | translate }}
354           </md-option>
355
356           <md-option ng-value="'abandoned'">
357             {{ 'TOOLS.ABANDONED' | translate }}
358           </md-option>
359
360           <md-option ng-value="'waiting'">
361             {{ 'TOOLS.WAITING' | translate }}
362           </md-option>
363
364           <md-option ng-value="'talking'">
365             {{ 'TOOLS.TALKING' | translate }}
366           </md-option>
367
368           <md-option ng-value="'answered'">
369             {{ 'TOOLS.ANSWERED' | translate }}
370           </md-option>
371
372           <md-option ng-value="'unmanaged'">
373             {{ 'TOOLS.UNMANAGED' | translate }}
374           </md-option>
375         </md-select>
376         <div
377           ng-messages="dashboarditemForm['attrSerie2'].$error"
378           ng-show="dashboarditemForm['attrSerie2'].$touched"
379           role="alert"
380         >
381           <div ng-message="required">
382             <span translate="TOOLS.ERRORS.SERIE2_REQUIRED"
383               >Serie2 field is required</span
384             >
385           </div>
386         </div>
387       </md-input-container>
388       <md-input-container
389         ng-if="['multibar-chart', 'pie-chart'].includes(vm.dashboarditem.type)"
390         class="md-block"
391       >
392         <label translate="TOOLS.SERIE3">Serie3</label>
393         <md-select name="attrSerie3" ng-model="vm.dashboarditem.attrSerie3">
394           <md-option ng-value="'null'">
395             {{ 'TOOLS.NONE' | translate }}
396           </md-option>
397
398           <md-option ng-value="'total'">
399             {{ 'TOOLS.TOTAL' | translate }}
400           </md-option>
401
402           <md-option ng-value="'abandoned'">
403             {{ 'TOOLS.ABANDONED' | translate }}
404           </md-option>
405
406           <md-option ng-value="'waiting'">
407             {{ 'TOOLS.WAITING' | translate }}
408           </md-option>
409
410           <md-option ng-value="'talking'">
411             {{ 'TOOLS.TALKING' | translate }}
412           </md-option>
413
414           <md-option ng-value="'answered'">
415             {{ 'TOOLS.ANSWERED' | translate }}
416           </md-option>
417
418           <md-option ng-value="'unmanaged'">
419             {{ 'TOOLS.UNMANAGED' | translate }}
420           </md-option>
421         </md-select>
422         <div
423           ng-messages="dashboarditemForm['attrSerie3'].$error"
424           ng-show="dashboarditemForm['attrSerie3'].$touched"
425           role="alert"
426         >
427           <div ng-message="required">
428             <span translate="TOOLS.ERRORS.SERIE3_REQUIRED"
429               >Serie3 field is required</span
430             >
431           </div>
432         </div>
433       </md-input-container>
434       <md-input-container
435         ng-if="vm.dashboarditem.type == 'web-report'"
436         class="md-block"
437       >
438         <label translate="TOOLS.REPORT">Report</label>
439         <input
440           type="search"
441           name="report"
442           ng-model="vm.dashboarditem.report"
443           ng-required="true"
444           autocomplete="off"
445           ng-click="vm.searchReport()"
446         />
447         <md-icon
448           md-font-icon="icon-magnify"
449           ng-click="vm.searchReport()"
450           aria-label="Search Report"
451         ></md-icon>
452         <div
453           ng-messages="dashboarditemForm['report'].$error"
454           ng-show="dashboarditemForm['report'].$touched"
455           role="alert"
456         >
457           <div ng-message="required">
458             <span translate="TOOLS.ERRORS.REPORT_REQUIRED"
459               >Report field is required</span
460             >
461           </div>
462         </div>
463       </md-input-container>
464       <md-input-container
465         ng-if="vm.dashboarditem.type == 'web-report'"
466         class="md-block"
467       >
468         <label translate="TOOLS.REFRESH">Refresh</label>
469         <input
470           type="number"
471           name="attrRefresh"
472           ng-model="vm.dashboarditem.attrRefresh"
473           min="5"
474           ng-required="true"
475         />
476
477         <div
478           ng-messages="dashboarditemForm['attrRefresh'].$error"
479           ng-show="dashboarditemForm['attrRefresh'].$touched"
480           role="alert"
481         >
482           <div ng-message="required">
483             <span translate="TOOLS.ERRORS.REFRESH_REQUIRED"
484               >Refresh field is required</span
485             >
486           </div>
487           <div ng-message="min">
488             <span
489               translate="TOOLS.ERRORS.REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
490               >Refresh must be a valid greater or equal than</span
491             >
492             <span>5</span>
493           </div>
494         </div>
495       </md-input-container>
496       <md-input-container
497         ng-if="['multibar-chart', 'pie-chart', 'counter'].includes(vm.dashboarditem.type)"
498         class="md-block"
499       >
500         <label translate="TOOLS.FILTERVOICEQUEUES">FilterVoiceQueues</label>
501         <md-select
502           name="attrVoiceQueues"
503           ng-model="vm.dashboarditem.attrVoiceQueues"
504           multiple
505         >
506           <md-option
507             ng-value="attrVoiceQueues.id"
508             ng-repeat="attrVoiceQueues in vm.voiceQueues"
509             ng-disabled="attrVoiceQueues.canSelect === false"
510             >{{ attrVoiceQueues.name }}</md-option
511           >
512         </md-select>
513         <div
514           ng-messages="dashboarditemForm['attrVoiceQueues'].$error"
515           ng-show="dashboarditemForm['attrVoiceQueues'].$touched"
516           role="alert"
517         >
518           <div ng-message="required">
519             <span translate="TOOLS.ERRORS.FILTERVOICEQUEUES_REQUIRED"
520               >FilterVoiceQueues field is required</span
521             >
522           </div>
523         </div>
524       </md-input-container>
525       <md-input-container
526         ng-if="['counter', 'clock'].includes(vm.dashboarditem.type)"
527         class="md-block"
528       >
529         <label translate="TOOLS.FONTSIZE">FontSize</label>
530         <input
531           type="number"
532           name="attrFontSize"
533           ng-model="vm.dashboarditem.attrFontSize"
534           min="12"
535           max="40"
536           ng-required="true"
537         />
538
539         <div
540           ng-messages="dashboarditemForm['attrFontSize'].$error"
541           ng-show="dashboarditemForm['attrFontSize'].$touched"
542           role="alert"
543         >
544           <div ng-message="required">
545             <span translate="TOOLS.ERRORS.FONTSIZE_REQUIRED"
546               >FontSize field is required</span
547             >
548           </div>
549           <div ng-message="min">
550             <span
551               translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
552               >FontSize must be a valid greater or equal than</span
553             >
554             <span>12</span>
555           </div>
556           <div ng-message="max">
557             <span
558               translate="TOOLS.ERRORS.FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO"
559               >FontSize must be a valid greater or equal than</span
560             >
561             <span>40</span>
562           </div>
563         </div>
564       </md-input-container>
565       <div
566         flex
567         md-color-picker
568         ng-model="vm.dashboarditem.foreground"
569         label="{{'TOOLS.FOREGROUND' | translate}}"
570         md-color-hex="true"
571         md-color-rgb="false"
572         md-color-hsl="false"
573         md-color-history="false"
574         md-color-material-palette="false"
575         md-color-alpha-channel="false"
576         open-on-input="true"
577       ></div>
578       <div
579         flex
580         md-color-picker
581         ng-model="vm.dashboarditem.background"
582         label="{{'TOOLS.BACKGROUND' | translate}}"
583         md-color-hex="true"
584         md-color-rgb="false"
585         md-color-hsl="false"
586         md-color-history="false"
587         md-color-material-palette="false"
588         md-color-alpha-channel="false"
589         open-on-input="true"
590       ></div>
591       <md-input-container class="md-block">
592         <label translate="TOOLS.LINK">link</label>
593         <input type="url" name="link" ng-model="vm.dashboarditem.link" />
594
595         <div
596           ng-messages="dashboarditemForm['link'].$error"
597           ng-show="dashboarditemForm['link'].$touched"
598           role="alert"
599         >
600           <div ng-message="required">
601             <span translate="TOOLS.ERRORS.LINK_REQUIRED"
602               >link field is required</span
603             >
604           </div>
605           <div ng-message="url">
606             <span translate="TOOLS.ERRORS.LINK_MUST_VALID_URL"
607               >link must be a valid url http://www.xcally.com</span
608             >
609           </div>
610         </div>
611       </md-input-container>
612
613       <div class="error-list">
614         <div
615           ng-repeat="error in vm.errors"
616           class="error"
617           layout="row"
618           layout-align="space-between center"
619         >
620           <div>
621             <span class="message">{{error.message}}</span>
622             <span class="type">({{error.type}})</span>
623           </div>
624           <md-button class="md-icon-button">
625             <md-icon
626               md-font-icon="icon-alert-box"
627               aria-label="alert error"
628               class="s16"
629             ></md-icon>
630           </md-button>
631         </div>
632       </div>
633     </md-dialog-content>
634
635     <md-dialog-actions
636       layout="row"
637       layout-align="space-between center"
638       ng-if="!vm.crudPermissions.readOnly"
639     >
640       <div layout="row" layout-align="start center">
641         <md-button
642           type="submit"
643           ng-if="vm.crudPermissions.canEdit && !vm.newDashboardItem"
644           ng-click="vm.saveDashboardItem()"
645           class="send-button md-accent md-raised"
646           ng-disabled="dashboarditemForm.$invalid || dashboarditemForm.$pristine"
647           aria-label="SAVE"
648           translate="TOOLS.SAVE"
649           translate-attr-aria-label="TOOLS.SAVE"
650         >
651           SAVE
652         </md-button>
653
654         <md-button
655           type="submit"
656           ng-if="vm.crudPermissions.canEdit && vm.newDashboardItem"
657           ng-click="vm.addNewDashboardItem()"
658           class="send-button md-accent md-raised"
659           ng-disabled="dashboarditemForm.$invalid"
660           aria-label="ADD"
661           translate="TOOLS.ADD_DASHBOARDITEM"
662           translate-attr-aria-label="TOOLS.ADD_DASHBOARDITEM"
663         >
664           ADD DASHBOARDITEM
665         </md-button>
666       </div>
667       <div layout="row">
668         <md-button
669           class="md-icon-button"
670           ng-if="vm.crudPermissions.canDelete && !vm.newDashboardItem"
671           ng-click="vm.deleteDashboardItem($event)"
672           aria-label="DELETE"
673           translate
674           translate-attr-aria-label="TOOLS.DELETE"
675         >
676           <md-icon md-font-icon="icon-delete"></md-icon>
677           <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>
678         </md-button>
679       </div>
680     </md-dialog-actions>
681   </form>
682 </md-dialog>