1 <md-dialog class="schedule-dialog" aria-label="New Schedule">
2 <form name="scheduleForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
4 <div class="md-toolbar-tools" layout="row" layout-align="space-between center">
5 <span class="title">{{ vm.title | translate }}</span>
6 <md-button class="md-icon-button" ng-click="vm.closeDialog()">
7 <md-icon md-font-icon="icon-close" aria-label="Close dialog"></md-icon>
12 <md-dialog-content ms-scroll>
13 <div class="error-list">
14 <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">
16 <span class="message">{{error.message}}</span>
17 <span class="type">({{error.type}})</span>
19 <md-button class="md-icon-button">
20 <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>
24 <md-input-container class="md-block">
25 <label translate="TOOLS.NAME">Name</label>
26 <input type="text" name="name" ng-model="vm.schedule.name" required autofocus>
27 <div ng-messages="scheduleForm.name.$error" ng-show="scheduleForm.name.$touched" role="alert">
28 <div ng-message="required">
29 <span translate="TOOLS.ERRORS.NAME_REQUIRED">Name field is required</span>
33 <md-input-container class="md-block">
34 <label translate="TOOLS.TYPE">Type</label>
35 <md-select ng-model="vm.schedule.type">
36 <md-option ng-value="'report'">Report</md-option>
38 <div ng-messages="scheduleForm.type.$error" ng-show="scheduleForm.type.$touched" role="alert">
39 <div ng-message="required">
40 <span translate="TOOLS.ERRORS.TYPE_REQUIRED">Type field is required</span>
44 <md-input-container class="md-block">
45 <label translate="TOOLS.REPORTTYPE">ReportType</label>
46 <md-select ng-model="vm.schedule.reportType" required>
47 <md-option ng-value="'default'">Default</md-option>
48 <md-option ng-value="'custom'">Custom</md-option>
50 <div ng-messages="scheduleForm.reportType.$error" ng-show="scheduleForm.reportType.$touched" role="alert">
51 <div ng-message="required">
52 <span translate="TOOLS.ERRORS.REPORTTYPE_REQUIRED">ReportType field is required</span>
56 <md-input-container ng-if="vm.schedule.reportType == 'default'" class="md-block">
57 <label translate="TOOLS.REPORT">Report</label>
58 <md-select ng-model="vm.schedule.reportId" required>
59 <md-option ng-value="reportId.id" ng-repeat="reportId in vm.defaultReports">{{ reportId.name }}</md-option>
61 <div ng-messages="scheduleForm.reportId.$error" ng-show="scheduleForm.reportId.$touched" role="alert">
62 <div ng-message="required">
63 <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>
67 <md-input-container ng-if="vm.schedule.reportType == 'custom'" class="md-block">
68 <label translate="TOOLS.REPORT">Report</label>
69 <md-select ng-model="vm.schedule.reportId" required>
70 <md-option ng-value="reportId.id" ng-repeat="reportId in vm.customReports">{{ reportId.name }}</md-option>
72 <div ng-messages="scheduleForm.reportId.$error" ng-show="scheduleForm.reportId.$touched" role="alert">
73 <div ng-message="required">
74 <span translate="TOOLS.ERRORS.REPORT_REQUIRED">Report field is required</span>
78 <md-input-container class="md-block">
79 <label translate="TOOLS.OUTPUT">Output</label>
80 <md-select ng-model="vm.schedule.reportOutput" required>
81 <md-option ng-value="'CSV'">CSV</md-option>
82 <md-option ng-value="'PDF'">PDF</md-option>
84 <div ng-messages="scheduleForm.reportOutput.$error" ng-show="scheduleForm.reportOutput.$touched" role="alert">
85 <div ng-message="required">
86 <span translate="TOOLS.ERRORS.OUTPUT_REQUIRED">Output field is required</span>
90 <md-input-container class="md-block">
91 <label translate="TOOLS.EXECUTEON">ExecuteOn</label>
92 <md-select ng-model="vm.schedule.cronType" required>
94 <md-option ng-value="'currentDay'"> {{ 'TOOLS.CURRENTDAY' | translate }}</md-option>
96 <md-option ng-value="'daily'"> {{ 'TOOLS.DAILY' | translate }}</md-option>
98 <md-option ng-value="'weekly'"> {{ 'TOOLS.WEEKLY' | translate }}</md-option>
100 <md-option ng-value="'monthly'"> {{ 'TOOLS.MONTHLY' | translate }}</md-option>
102 <div ng-messages="scheduleForm.cronType.$error" ng-show="scheduleForm.cronType.$touched" role="alert">
103 <div ng-message="required">
104 <span translate="TOOLS.ERRORS.EXECUTEON_REQUIRED">ExecuteOn field is required</span>
107 </md-input-container>
108 <md-input-container ng-if="vm.schedule.cronType == 'currentDay'" class="md-block">
109 <label translate="TOOLS.VALIDITYSTART">ValidityStart</label>
110 <input type="number" name="validityStart" ng-model="vm.schedule.validityStart" min="0" max="24" required>
111 <div ng-messages="scheduleForm.validityStart.$error" ng-show="scheduleForm.validityStart.$touched" role="alert">
112 <div ng-message="required">
113 <span translate="TOOLS.ERRORS.VALIDITYSTART_REQUIRED">ValidityStart field is required</span>
116 </md-input-container>
117 <md-input-container ng-if="vm.schedule.cronType == 'currentDay'" class="md-block">
118 <label translate="TOOLS.VALIDITYEND">ValidityEnd</label>
119 <input type="number" name="validityEnd" ng-model="vm.schedule.validityEnd" min="0" max="24" required>
120 <div ng-messages="scheduleForm.validityEnd.$error" ng-show="scheduleForm.validityEnd.$touched" role="alert">
121 <div ng-message="required">
122 <span translate="TOOLS.ERRORS.VALIDITYEND_REQUIRED">ValidityEnd field is required</span>
125 </md-input-container>
126 <md-input-container ng-if="vm.schedule.cronType == 'currentDay'" class="md-block">
127 <label translate="TOOLS.EXECUTEEVERY">ExecuteEvery</label>
128 <md-select ng-model="vm.schedule.cron" required>
130 <md-option ng-value="'*/15 * * * *'"> {{ 'TOOLS.15MIN' | translate }}</md-option>
132 <md-option ng-value="'*/30 * * * *'"> {{ 'TOOLS.30MIN' | translate }}</md-option>
134 <md-option ng-value="'0 * * * *'"> {{ 'TOOLS.1H' | translate }}</md-option>
136 <div ng-messages="scheduleForm.cron.$error" ng-show="scheduleForm.cron.$touched" role="alert">
137 <div ng-message="required">
138 <span translate="TOOLS.ERRORS.EXECUTEEVERY_REQUIRED">ExecuteEvery field is required</span>
141 </md-input-container>
142 <md-input-container ng-if="vm.schedule.cronType == 'weekly'" class="md-block">
143 <label translate="TOOLS.WEEKDAYS">WeekDays</label>
144 <md-select ng-model="vm.schedule.weekDays" required multiple>
146 <md-option ng-value="'monday'"> {{ 'TOOLS.MON' | translate }}</md-option>
148 <md-option ng-value="'tuesday'"> {{ 'TOOLS.TUE' | translate }}</md-option>
150 <md-option ng-value="'wednesday'"> {{ 'TOOLS.WED' | translate }}</md-option>
152 <md-option ng-value="'thursday'"> {{ 'TOOLS.THU' | translate }}</md-option>
154 <md-option ng-value="'friday'"> {{ 'TOOLS.FRI' | translate }}</md-option>
156 <md-option ng-value="'saturday'"> {{ 'TOOLS.SAT' | translate }}</md-option>
158 <md-option ng-value="'sunday'"> {{ 'TOOLS.SUN' | translate }}</md-option>
160 <div ng-messages="scheduleForm.weekDays.$error" ng-show="scheduleForm.weekDays.$touched" role="alert">
161 <div ng-message="required">
162 <span translate="TOOLS.ERRORS.WEEKDAYS_REQUIRED">WeekDays field is required</span>
165 </md-input-container>
166 <md-input-container ng-if="vm.schedule.cronType == 'monthly'" class="md-block">
167 <label translate="TOOLS.MONTHDAY">MonthDay</label>
168 <input type="number" name="monthDay" ng-model="vm.schedule.monthDay" min="1" max="31" required>
169 <div ng-messages="scheduleForm.monthDay.$error" ng-show="scheduleForm.monthDay.$touched" role="alert">
170 <div ng-message="required">
171 <span translate="TOOLS.ERRORS.MONTHDAY_REQUIRED">MonthDay field is required</span>
174 </md-input-container>
175 <md-input-container ng-if="vm.schedule.cronType != 'currentDay'" class="md-block">
176 <label translate="TOOLS.HOUR">Hour</label>
177 <input type="number" name="hour" ng-model="vm.schedule.hour" min="0" max="23" required>
178 <div ng-messages="scheduleForm.hour.$error" ng-show="scheduleForm.hour.$touched" role="alert">
179 <div ng-message="required">
180 <span translate="TOOLS.ERRORS.HOUR_REQUIRED">Hour field is required</span>
183 </md-input-container>
184 <md-input-container ng-if="vm.schedule.cronType != 'currentDay'" class="md-block">
185 <label translate="TOOLS.REPORTRANGE">ReportRange</label>
186 <md-select ng-model="vm.schedule.reportRange" required>
188 <md-option ng-value="'yesterday'"> {{ 'TOOLS.PREVIOUS_DAY' | translate }}</md-option>
190 <md-option ng-value="'last7'"> {{ 'TOOLS.LAST_SEVEN_DAYS' | translate }}</md-option>
192 <md-option ng-value="'last30'"> {{ 'TOOLS.LAST_THIRTY_DAYS' | translate }}</md-option>
194 <md-option ng-value="'lastMonth'"> {{ 'TOOLS.LAST_MONTH' | translate }}</md-option>
196 <div ng-messages="scheduleForm.reportRange.$error" ng-show="scheduleForm.reportRange.$touched" role="alert">
197 <div ng-message="required">
198 <span translate="TOOLS.ERRORS.REPORTRANGE_REQUIRED">ReportRange field is required</span>
201 </md-input-container>
202 <md-input-container class="md-block">
203 <md-switch ng-model="vm.schedule.sendMail" aria-label="SendMail"><span translate="TOOLS.SENDMAIL">SendMail</span></md-switch>
204 </md-input-container>
205 <md-input-container ng-if="vm.schedule.sendMail" class="md-block">
206 <label translate="TOOLS.ACCOUNT">Account</label>
207 <md-select ng-model="vm.schedule.MailServerOutId" required>
208 <md-option ng-value="MailServerOutId.id" ng-repeat="MailServerOutId in vm.mailServerOut">{{ MailServerOutId.name }}</md-option>
210 <div ng-messages="scheduleForm.MailServerOutId.$error" ng-show="scheduleForm.MailServerOutId.$touched" role="alert">
211 <div ng-message="required">
212 <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED">Account field is required</span>
215 </md-input-container>
216 <md-input-container ng-if="vm.schedule.sendMail" class="md-block">
217 <label translate="TOOLS.EMAILADDRESS">EmailAddress</label>
218 <input type="email" name="email" ng-model="vm.schedule.email" required>
219 <div ng-messages="scheduleForm.email.$error" ng-show="scheduleForm.email.$touched" role="alert">
220 <div ng-message="required">
221 <span translate="TOOLS.ERRORS.EMAILADDRESS_REQUIRED">EmailAddress field is required</span>
223 <div ng-message="email">
224 <span translate="TOOLS.ERRORS.EMAILADDRESS_MUST_VALID">EmailAddress must be a valid e-mail address</span>
227 </md-input-container>
228 <md-input-container class="md-block">
229 <md-switch ng-model="vm.schedule.active" aria-label="Active"><span translate="TOOLS.ACTIVE">Active</span></md-switch>
230 </md-input-container>
231 <md-input-container class="md-block">
232 <label translate="TOOLS.DESCRIPTION">Description</label>
233 <input type="" name="description" ng-model="vm.schedule.description">
234 <div ng-messages="scheduleForm.description.$error" ng-show="scheduleForm.description.$touched" role="alert">
235 <div ng-message="required">
236 <span translate="TOOLS.ERRORS.DESCRIPTION_REQUIRED">Description field is required</span>
239 </md-input-container>
241 <div class="error-list">
242 <div ng-repeat="error in vm.errors" class="error" layout="row" layout-align="space-between center">
244 <span class="message">{{error.message}}</span>
245 <span class="type">({{error.type}})</span>
247 <md-button class="md-icon-button">
248 <md-icon md-font-icon="icon-alert-box" aria-label="alert error" class="s16"></md-icon>
254 <md-dialog-actions layout="row" layout-align="space-between center">
255 <div layout="row" layout-align="start center">
256 <md-button type="submit" ng-if="!vm.newSchedule" ng-click="vm.saveSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid || scheduleForm.$pristine" aria-label="SAVE" translate="TOOLS.SAVE" translate-attr-aria-label="TOOLS.SAVE">
260 <md-button type="submit" ng-if="vm.newSchedule" ng-click="vm.addNewSchedule()" class="send-button md-accent md-raised" ng-disabled="scheduleForm.$invalid" aria-label="ADD" translate="TOOLS.ADD_SCHEDULE" translate-attr-aria-label="TOOLS.ADD_SCHEDULE">
265 <md-button class="md-icon-button" ng-if="!vm.newSchedule" ng-click="vm.deleteSchedule($event)" aria-label="DELETE" translate translate-attr-aria-label="TOOLS.DELETE">
266 <md-icon md-font-icon="icon-delete"></md-icon>
267 <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>