5b4ecf72e9fe2bfd71572bad0f0b57b341630ce6
[motion-next.git] /
1 <md-dialog class="voicePrefix-dialog" aria-label="New voicePrefix">
2   <form name="voicePrefixForm" 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="VOICE.NAME">Name</label>
42         <input
43           type="text"
44           name="name"
45           ng-model="vm.voicePrefix.name"
46           ng-pattern="/^[A-Za-z0-9\.\_]+$/i"
47           ng-required="true"
48           autofocus
49         />
50
51         <div class="hint"><span translate="VOICE.HELP.NAME"></span></div>
52         <div
53           ng-messages="voicePrefixForm['name'].$error"
54           ng-show="voicePrefixForm['name'].$touched"
55           role="alert"
56         >
57           <div ng-message="required">
58             <span translate="VOICE.ERRORS.NAME_REQUIRED"
59               >Name field is required</span
60             >
61           </div>
62           <div ng-message="pattern">
63             <span
64               translate="VOICE.ERRORS.NAME_MUST_VALID_PATTERN"
65               translate-values="{ regex: '/^[A-Za-z0-9\.\_]+$/i' }"
66               >Name must be valid pattern
67             </span>
68           </div>
69         </div>
70       </md-input-container>
71       <md-input-container class="md-block">
72         <label translate="VOICE.OUTBOUNDROUTE">OutboundRoute</label>
73         <md-select
74           name="VoiceExtensionId"
75           ng-model="vm.voicePrefix.VoiceExtensionId"
76           required
77         >
78           <md-option
79             ng-value="VoiceExtensionId.id"
80             ng-repeat="VoiceExtensionId in vm.outboundRoutes"
81             ng-disabled="VoiceExtensionId.canSelect === false"
82             >{{ VoiceExtensionId.exten }}</md-option
83           >
84         </md-select>
85         <div
86           ng-messages="voicePrefixForm['VoiceExtensionId'].$error"
87           ng-show="voicePrefixForm['VoiceExtensionId'].$touched"
88           role="alert"
89         >
90           <div ng-message="required">
91             <span translate="VOICE.ERRORS.OUTBOUNDROUTE_REQUIRED"
92               >OutboundRoute field is required</span
93             >
94           </div>
95         </div>
96       </md-input-container>
97       <md-input-container class="md-block">
98         <label translate="VOICE.CALLERIDALL">CallerIdAll</label>
99         <input
100           type="text"
101           name="callerIdAll"
102           ng-model="vm.voicePrefix.callerIdAll"
103           ng-pattern='/"(.*)"\s&lt;(.*?)&gt;$/'
104         />
105
106         <div class="hint"><span translate="VOICE.HELP.CALLERIDALL"></span></div>
107         <div
108           ng-messages="voicePrefixForm['callerIdAll'].$error"
109           ng-show="voicePrefixForm['callerIdAll'].$touched"
110           role="alert"
111         >
112           <div ng-message="required">
113             <span translate="VOICE.ERRORS.CALLERIDALL_REQUIRED"
114               >CallerIdAll field is required</span
115             >
116           </div>
117           <div ng-message="pattern">
118             <span
119               translate="VOICE.ERRORS.CALLERIDALL_MUST_VALID_PATTERN"
120               translate-values="{ regex: '/&quot;(.*)&quot;\s&lt;(.*?)&gt;$/' }"
121               >CallerIdAll must be valid pattern
122             </span>
123           </div>
124         </div>
125       </md-input-container>
126       <md-input-container class="md-block">
127         <label translate="VOICE.DESCRIPTION">Description</label>
128         <input
129           type="text"
130           name="description"
131           ng-model="vm.voicePrefix.description"
132         />
133
134         <div
135           ng-messages="voicePrefixForm['description'].$error"
136           ng-show="voicePrefixForm['description'].$touched"
137           role="alert"
138         >
139           <div ng-message="required">
140             <span translate="VOICE.ERRORS.DESCRIPTION_REQUIRED"
141               >Description field is required</span
142             >
143           </div>
144         </div>
145       </md-input-container>
146
147       <div class="error-list">
148         <div
149           ng-repeat="error in vm.errors"
150           class="error"
151           layout="row"
152           layout-align="space-between center"
153         >
154           <div>
155             <span class="message">{{error.message}}</span>
156             <span class="type">({{error.type}})</span>
157           </div>
158           <md-button class="md-icon-button">
159             <md-icon
160               md-font-icon="icon-alert-box"
161               aria-label="alert error"
162               class="s16"
163             ></md-icon>
164           </md-button>
165         </div>
166       </div>
167     </md-dialog-content>
168
169     <md-dialog-actions
170       layout="row"
171       layout-align="space-between center"
172       ng-if="!vm.crudPermissions.readOnly"
173     >
174       <div layout="row" layout-align="start center">
175         <md-button
176           type="submit"
177           ng-if="vm.crudPermissions.canEdit && !vm.newvoicePrefix"
178           ng-click="vm.savevoicePrefix()"
179           class="send-button md-accent md-raised"
180           ng-disabled="voicePrefixForm.$invalid || voicePrefixForm.$pristine"
181           aria-label="SAVE"
182           translate="VOICE.SAVE"
183           translate-attr-aria-label="VOICE.SAVE"
184         >
185           SAVE
186         </md-button>
187
188         <md-button
189           type="submit"
190           ng-if="vm.crudPermissions.canEdit && vm.newvoicePrefix"
191           ng-click="vm.addNewvoicePrefix()"
192           class="send-button md-accent md-raised"
193           ng-disabled="voicePrefixForm.$invalid"
194           aria-label="ADD"
195           translate="VOICE.ADD_VOICEPREFIX"
196           translate-attr-aria-label="VOICE.ADD_VOICEPREFIX"
197         >
198           ADD VOICEPREFIX
199         </md-button>
200       </div>
201       <div layout="row">
202         <md-button
203           class="md-icon-button"
204           ng-if="vm.crudPermissions.canDelete && !vm.newvoicePrefix"
205           ng-click="vm.deletevoicePrefix($event)"
206           aria-label="DELETE"
207           translate
208           translate-attr-aria-label="VOICE.DELETE"
209         >
210           <md-icon md-font-icon="icon-delete"></md-icon>
211           <md-tooltip><span translate="VOICE.DELETE">DELETE</span></md-tooltip>
212         </md-button>
213       </div>
214     </md-dialog-actions>
215   </form>
216 </md-dialog>