379baf8fd8f3e7acbb7e5a97fade45b70fb00206
[motion-next.git] /
1 <md-dialog class="agent-dialog" aria-label="agent dispose">
2   <form name="disposition" class="md-inline-form" novalidate>
3     <md-toolbar class="md-background-bg">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title" translate="DASHBOARDS.DISPOSE"></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     <md-dialog-content ms-scroll>
19       <div>
20         <md-input-container class="md-block">
21           <label translate="DASHBOARDS.DISPOSITION">Disposition</label>
22           <md-select
23             name="disposition"
24             ng-model="vm.firstLevelDisposition"
25             ng-change="vm.onDispositionChange('first')"
26             required
27           >
28             <md-option
29               ng-value="disposition"
30               ng-repeat="disposition in vm.dispositions | filter: { level: 'first' }"
31             >
32               {{ disposition.name }}</md-option
33             >
34             <md-option
35               ng-value="globalDisposition"
36               ng-repeat="globalDisposition in vm.globalDispositions | filter: { level: 'first' }"
37             >
38               {{ globalDisposition.name }}</md-option
39             >
40           </md-select>
41           <div
42             ng-messages="dispositionForm.disposition.$error"
43             ng-show="dispositionForm.disposition.$touched"
44             role="alert"
45           >
46             <div ng-message="required">
47               <span translate="DASHBOARDS.ERRORS.DISPOSITION_REQUIRED"
48                 >Disposition field is required</span
49               >
50             </div>
51           </div>
52         </md-input-container>
53         <div
54           ng-if="vm.firstLevelDisposition && vm.anySecondLevelDisposition"
55           layout="row"
56           layout-align="start center"
57         >
58           <md-input-container class="md-block" flex>
59             <label translate="DASHBOARDS.SECOND_LEVEL_DISPOSITION"
60               >Second Level Disposition</label
61             >
62             <md-select
63               name="secondLevelDisposition"
64               ng-model="vm.secondLevelDisposition"
65               ng-change="vm.onDispositionChange('second')"
66             >
67               <md-option
68                 ng-value="disposition"
69                 ng-repeat="disposition in vm.dispositions | filter: { level: 'second', ParentId: vm.firstLevelDisposition.id }"
70               >
71                 {{ disposition.name }}</md-option
72               >
73               <md-option
74                 ng-value="globalDisposition"
75                 ng-repeat="globalDisposition in vm.globalDispositions | filter: { level: 'second', ParentId: vm.firstLevelDisposition.id }"
76               >
77                 {{ globalDisposition.name }}</md-option
78               >
79             </md-select>
80           </md-input-container>
81           <md-button
82             ng-if="vm.secondLevelDisposition"
83             ng-click="vm.clearDispositionSelection('second')"
84             class="md-icon-button"
85           >
86             <md-icon
87               md-font-icon="icon-cancel"
88               aria-label="Clear second level disposition selection"
89             >
90             </md-icon>
91           </md-button>
92         </div>
93         <div
94           ng-if="vm.secondLevelDisposition && vm.anyThirdLevelDisposition"
95           layout="row"
96           layout-align="start center"
97         >
98           <md-input-container class="md-block" flex>
99             <label translate="DASHBOARDS.THIRD_LEVEL_DISPOSITION"
100               >Third Level Disposition</label
101             >
102             <md-select
103               name="thirdLevelDisposition"
104               ng-model="vm.thirdLevelDisposition"
105               ng-change="vm.onDispositionChange('third')"
106             >
107               <md-option
108                 ng-value="disposition"
109                 ng-repeat="disposition in vm.dispositions | filter: { level: 'third', ParentId: vm.secondLevelDisposition.id }"
110               >
111                 {{ disposition.name }}</md-option
112               >
113               <md-option
114                 ng-value="globalDisposition"
115                 ng-repeat="globalDisposition in vm.globalDispositions | filter: { level: 'third', ParentId: vm.secondLevelDisposition.id }"
116               >
117                 {{ globalDisposition.name }}</md-option
118               >
119             </md-select>
120           </md-input-container>
121           <md-button
122             ng-if="vm.thirdLevelDisposition"
123             ng-click="vm.clearDispositionSelection('third')"
124             class="md-icon-button"
125           >
126             <md-icon
127               md-font-icon="icon-cancel"
128               aria-label="Clear third level disposition selection"
129             >
130             </md-icon>
131           </md-button>
132         </div>
133         <md-input-container class="md-block">
134           <label translate="DASHBOARDS.NOTE">Note</label>
135           <textarea
136             ng-model="vm.note"
137             md-maxlength="255"
138             max-rows="5"
139             autofocus
140           ></textarea>
141         </md-input-container>
142       </div>
143     </md-dialog-content>
144     <md-dialog-actions layout="row" layout-align="space-between center">
145       <div layout="row" layout-align="start center">
146         <md-button
147           ng-disabled="disposition.$invalid || disposition.$pristine"
148           class="send-button md-raised md-accent"
149           ng-click="vm.saveDisposition()"
150         >
151           {{(vm.selectedDisposition.name ? 'DASHBOARDS.DISPOSE' :
152           'DASHBOARDS.SAVE') | translate}}
153         </md-button>
154       </div>
155     </md-dialog-actions>
156   </form>
157 </md-dialog>