224e9c583e6a6c77b161e9924f3c5dead7ab72f5
[motion-next.git] /
1 <md-dialog class="ivrCampaign-dialog" aria-label="New IvrCampaign">
2   <form name="ivrCampaignForm" 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="MOTIONDIALER.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.ivrCampaign.name"
46           ng-pattern="/^[A-Za-z0-9\.\_]+$/i"
47           ng-required="true"
48           autofocus
49           ng-disabled="!vm.newIvrCampaign"
50         />
51
52         <div class="hint"><span translate="MOTIONDIALER.HELP.NAME"></span></div>
53         <div
54           ng-messages="ivrCampaignForm['name'].$error"
55           ng-show="ivrCampaignForm['name'].$touched"
56           role="alert"
57         >
58           <div ng-message="required">
59             <span translate="MOTIONDIALER.ERRORS.NAME_REQUIRED"
60               >Name field is required</span
61             >
62           </div>
63           <div ng-message="pattern">
64             <span
65               translate="MOTIONDIALER.ERRORS.NAME_MUST_VALID_PATTERN"
66               translate-values="{ regex: '/^[A-Za-z0-9\.\_]+$/i' }"
67               >Name must be valid pattern
68             </span>
69           </div>
70         </div>
71       </md-input-container>
72       <md-input-container class="md-block">
73         <md-switch ng-model="vm.ivrCampaign.active" aria-label="Active"
74           ><span translate="MOTIONDIALER.ACTIVE">Active</span></md-switch
75         >
76       </md-input-container>
77       <md-input-container class="md-block">
78         <label translate="MOTIONDIALER.TRUNK">Trunk</label>
79         <md-select name="TrunkId" ng-model="vm.ivrCampaign.TrunkId" required>
80           <md-option
81             ng-value="TrunkId.id"
82             ng-repeat="TrunkId in vm.trunks"
83             ng-disabled="TrunkId.canSelect === false"
84             >{{ TrunkId.name }}</md-option
85           >
86         </md-select>
87         <div
88           ng-messages="ivrCampaignForm['TrunkId'].$error"
89           ng-show="ivrCampaignForm['TrunkId'].$touched"
90           role="alert"
91         >
92           <div ng-message="required">
93             <span translate="MOTIONDIALER.ERRORS.TRUNK_REQUIRED"
94               >Trunk field is required</span
95             >
96           </div>
97         </div>
98       </md-input-container>
99       <md-input-container class="md-block">
100         <label translate="MOTIONDIALER.INTERVAL">Interval</label>
101         <md-select
102           name="IntervalId"
103           ng-model="vm.ivrCampaign.IntervalId"
104           required
105         >
106           <md-option
107             ng-value="IntervalId.id"
108             ng-repeat="IntervalId in vm.interval"
109             ng-disabled="IntervalId.canSelect === false"
110             >{{ IntervalId.name }}</md-option
111           >
112         </md-select>
113         <div
114           ng-messages="ivrCampaignForm['IntervalId'].$error"
115           ng-show="ivrCampaignForm['IntervalId'].$touched"
116           role="alert"
117         >
118           <div ng-message="required">
119             <span translate="MOTIONDIALER.ERRORS.INTERVAL_REQUIRED"
120               >Interval field is required</span
121             >
122           </div>
123         </div>
124       </md-input-container>
125       <md-input-container class="md-block">
126         <label translate="MOTIONDIALER.CHECKDUPLICATE">CheckDuplicate</label>
127         <md-select
128           name="dialCheckDuplicateType"
129           ng-model="vm.ivrCampaign.dialCheckDuplicateType"
130           required
131         >
132           <md-option ng-value="'always'">
133             {{ 'MOTIONDIALER.ALWAYS' | translate }}
134           </md-option>
135
136           <md-option ng-value="'never'">
137             {{ 'MOTIONDIALER.NEVER' | translate }}
138           </md-option>
139
140           <md-option ng-value="'onlyIfOpen'">
141             {{ 'MOTIONDIALER.ONLY_IF_OPEN' | translate }}
142           </md-option>
143         </md-select>
144         <div
145           ng-messages="ivrCampaignForm['dialCheckDuplicateType'].$error"
146           ng-show="ivrCampaignForm['dialCheckDuplicateType'].$touched"
147           role="alert"
148         >
149           <div ng-message="required">
150             <span translate="MOTIONDIALER.ERRORS.CHECKDUPLICATE_REQUIRED"
151               >CheckDuplicate field is required</span
152             >
153           </div>
154         </div>
155       </md-input-container>
156       <md-input-container class="md-block">
157         <label translate="MOTIONDIALER.CALLYSQUAREPROJECT"
158           >CallySquareProject</label
159         >
160         <md-select
161           name="SquareProjectId"
162           ng-model="vm.ivrCampaign.SquareProjectId"
163           required
164         >
165           <md-option
166             ng-value="SquareProjectId.id"
167             ng-repeat="SquareProjectId in vm.projects"
168             ng-disabled="SquareProjectId.canSelect === false"
169             >{{ SquareProjectId.name }}</md-option
170           >
171         </md-select>
172         <div
173           ng-messages="ivrCampaignForm['SquareProjectId'].$error"
174           ng-show="ivrCampaignForm['SquareProjectId'].$touched"
175           role="alert"
176         >
177           <div ng-message="required">
178             <span translate="MOTIONDIALER.ERRORS.CALLYSQUAREPROJECT_REQUIRED"
179               >CallySquareProject field is required</span
180             >
181           </div>
182         </div>
183       </md-input-container>
184       <md-input-container class="md-block">
185         <label translate="MOTIONDIALER.CONCURRENTCALLS">ConcurrentCalls</label>
186         <input
187           type="number"
188           name="limitCalls"
189           ng-model="vm.ivrCampaign.limitCalls"
190           min="1"
191           max="200"
192           ng-required="true"
193         />
194
195         <div class="hint">
196           <span translate="MOTIONDIALER.HELP.CONCURRENTCALLS"></span>
197         </div>
198         <div
199           ng-messages="ivrCampaignForm['limitCalls'].$error"
200           ng-show="ivrCampaignForm['limitCalls'].$touched"
201           role="alert"
202         >
203           <div ng-message="required">
204             <span translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_REQUIRED"
205               >ConcurrentCalls field is required</span
206             >
207           </div>
208           <div ng-message="min">
209             <span
210               translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
211               >ConcurrentCalls must be a valid greater or equal than</span
212             >
213             <span>1</span>
214           </div>
215           <div ng-message="max">
216             <span
217               translate="MOTIONDIALER.ERRORS.CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO"
218               >ConcurrentCalls must be a valid greater or equal than</span
219             >
220             <span>200</span>
221           </div>
222         </div>
223       </md-input-container>
224       <md-input-container class="md-block">
225         <label translate="MOTIONDIALER.DESCRIPTION">Description</label>
226         <input
227           type="text"
228           name="description"
229           ng-model="vm.ivrCampaign.description"
230         />
231
232         <div
233           ng-messages="ivrCampaignForm['description'].$error"
234           ng-show="ivrCampaignForm['description'].$touched"
235           role="alert"
236         >
237           <div ng-message="required">
238             <span translate="MOTIONDIALER.ERRORS.DESCRIPTION_REQUIRED"
239               >Description field is required</span
240             >
241           </div>
242         </div>
243       </md-input-container>
244
245       <div class="error-list">
246         <div
247           ng-repeat="error in vm.errors"
248           class="error"
249           layout="row"
250           layout-align="space-between center"
251         >
252           <div>
253             <span class="message">{{error.message}}</span>
254             <span class="type">({{error.type}})</span>
255           </div>
256           <md-button class="md-icon-button">
257             <md-icon
258               md-font-icon="icon-alert-box"
259               aria-label="alert error"
260               class="s16"
261             ></md-icon>
262           </md-button>
263         </div>
264       </div>
265     </md-dialog-content>
266
267     <md-dialog-actions
268       layout="row"
269       layout-align="space-between center"
270       ng-if="!vm.crudPermissions.readOnly"
271     >
272       <div layout="row" layout-align="start center">
273         <md-button
274           type="submit"
275           ng-if="vm.crudPermissions.canEdit && !vm.newIvrCampaign"
276           ng-click="vm.saveIvrCampaign()"
277           class="send-button md-accent md-raised"
278           ng-disabled="ivrCampaignForm.$invalid || ivrCampaignForm.$pristine"
279           aria-label="SAVE"
280           translate="MOTIONDIALER.SAVE"
281           translate-attr-aria-label="MOTIONDIALER.SAVE"
282         >
283           SAVE
284         </md-button>
285
286         <md-button
287           type="submit"
288           ng-if="vm.crudPermissions.canEdit && vm.newIvrCampaign"
289           ng-click="vm.addNewIvrCampaign()"
290           class="send-button md-accent md-raised"
291           ng-disabled="ivrCampaignForm.$invalid"
292           aria-label="ADD"
293           translate="MOTIONDIALER.ADD_IVRCAMPAIGN"
294           translate-attr-aria-label="MOTIONDIALER.ADD_IVRCAMPAIGN"
295         >
296           ADD IVRCAMPAIGN
297         </md-button>
298       </div>
299       <div layout="row">
300         <md-button
301           class="md-icon-button"
302           ng-if="vm.crudPermissions.canDelete && !vm.newIvrCampaign"
303           ng-click="vm.deleteIvrCampaign($event)"
304           aria-label="DELETE"
305           translate
306           translate-attr-aria-label="MOTIONDIALER.DELETE"
307         >
308           <md-icon md-font-icon="icon-delete"></md-icon>
309           <md-tooltip
310             ><span translate="MOTIONDIALER.DELETE">DELETE</span></md-tooltip
311           >
312         </md-button>
313       </div>
314     </md-dialog-actions>
315   </form>
316 </md-dialog>