1 <md-dialog class="import-dialog" aria-label="Import contact">
2 <form name="importForm" class="md-inline-form" novalidate>
3 <md-toolbar class="md-accent md-hue-2">
5 class="md-toolbar-tools"
7 layout-align="space-between center"
9 <span class="title" translate="CONTACTMANAGER.IMPORT_CONTACTS"
10 >Import Contacts</span
13 ng-if="vm.result.finish || !vm.processing"
14 class="md-icon-button"
15 ng-click="vm.closeDialog()"
18 md-font-icon="icon-close"
19 aria-label="Close dialog"
25 <div md-background-bg layout="row" layout-align="start start">
27 ng-disabled="!vm.processing || vm.result.finish"
28 md-mode="indeterminate"
30 ></md-progress-linear>
33 <md-dialog-content ms-scroll>
34 <div class="error-list">
36 ng-repeat="error in vm.errors"
39 layout-align="space-between center"
42 <span class="message">{{error.message}}</span>
43 <span class="type">({{error.type}})</span>
45 <md-button class="md-icon-button">
47 md-font-icon="icon-alert-box"
48 aria-label="alert error"
56 <md-content ng-show="!vm.processing">
57 <div class="form-title" translate="CONTACTMANAGER.CONTACTMANAGER">
62 class="md-icon-float md-block"
63 ng-repeat="contactField in vm.contactFields"
66 >{{'CONTACTMANAGER.' + contactField.key | uppercase |
70 name="{{contactField.key}}"
71 ng-model="vm.binding[contactField.key]"
72 placeholder="{{'CONTACTMANAGER.' + contactField.key | uppercase | translate}}"
73 ng-required="contactField.required"
75 <md-option ng-value="field" ng-repeat="field in vm.fields"
76 >{{ field }}</md-option
78 <md-option ng-value="null" ng-hide="contactField.required">
79 <em>{{ 'CONTACTMANAGER.NONE' | translate }}</em>
84 <md-input-container class="md-icon-float md-block">
85 <label translate="CONTACTMANAGER.LIST">List</label>
89 placeholder="Select a list"
90 ng-change="vm.onChangeList()"
93 <md-option ng-value="list.id" ng-repeat="list in vm.lists.rows"
94 >{{list.name}}</md-option
100 class="md-icon-float md-block"
101 ng-repeat="customField in vm.customFields.rows"
103 <label>{{customField.alias}}</label>
105 ng-model="vm.binding['cf_' + customField.id]"
106 placeholder="{{customField.alias}}"
107 ng-required="customField.required"
109 <md-option ng-value="field" ng-repeat="field in vm.fields"
110 >{{ field }}</md-option
112 <md-option ng-value="null" ng-hide="customField.required">
113 <em>{{ 'CONTACTMANAGER.NONE' | translate }}</em>
116 </md-input-container>
118 <md-input-container class="md-icon-float md-block">
119 <label translate="CONTACTMANAGER.COMPANY">Company</label>
122 ng-model="vm.CompanyId"
123 placeholder="Select a company"
126 ng-value="company.id"
127 ng-repeat="company in vm.companies.rows"
128 >{{company.name}}</md-option
130 <md-option ng-value="null">
131 <em translate="CONTACTMANAGER.NONE">None</em>
134 </md-input-container>
136 <md-input-container class="md-icon-float md-block">
138 ng-model="vm.duplicates"
139 placeholder="{{ 'CONTACTMANAGER.CHECK_DUPLICATES' | translate}}"
143 ng-value="contactField.key"
144 ng-repeat="contactField in vm.contactFields"
145 >{{ 'CONTACTMANAGER.' + contactField.key | uppercase |
146 translate}}</md-option
149 </md-input-container>
151 <div ng-if="vm.license.dialer">
152 <div class="form-title" translate="CONTACTMANAGER.MOTIONDIALER">
157 class="md-icon-float md-block"
158 ng-repeat="motionBullField in vm.motionBullFields"
161 >{{'CONTACTMANAGER.' + motionBullField.key | uppercase |
165 name="{{motionBullField.key}}"
166 ng-model="vm.binding[motionBullField.key]"
167 placeholder="{{'CONTACTMANAGER.' + motionBullField.key | uppercase | translate}}"
168 ng-required="motionBullField.required"
170 <md-option ng-value="field" ng-repeat="field in vm.fields"
171 >{{ field }}</md-option
173 <md-option ng-value="null" ng-hide="contactField.required">
174 <em>{{ 'CONTACTMANAGER.NONE' | translate }}</em>
177 </md-input-container>
181 <div class="error-list" ng-if="vm.result.finish">
182 <div class="info" layout="row" layout-align="space-between center">
184 <div class="message">
185 {{'CONTACTMANAGER.UPLOAD_COMPLETED' | translate | uppercase}}
186 ({{vm.result.elapsed}}s)
189 <md-button class="md-icon-button">
191 md-font-icon="icon-alert-box"
192 aria-label="alert error"
199 <div layout="row" ng-if="vm.processing">
200 <!-- WIDGET PROCESSING -->
201 <ms-widget ng-if="!vm.result.finish" class="h-140" flex>
203 <ms-widget-front class="p-16 white-bg">
207 layout-align="center center"
210 <div class="md-display-1 pb-8 orange-fg">
211 <span ng-bind="vm.result.rows"></span>
214 ng-if="vm.processing"
215 class="font-weight-500 secondary-text"
217 Please wait, we are processing your contacts...
223 <!-- / WIDGET PROCESSING -->
224 <!-- WIDGET SUCCESS -->
225 <ms-widget ng-if="vm.result.finish" class="h-140" flex>
227 <ms-widget-front class="p-16 white-bg">
231 layout-align="center center"
234 <div class="md-display-1 pb-8 green-fg">
235 <span ng-bind="vm.result.affectedRows"></span>
238 class="font-weight-500 secondary-text"
239 translate="CONTACTMANAGER.SUCCESS"
247 <!-- / WIDGET SUCCESS -->
249 <!-- WIDGET FAILURE -->
250 <ms-widget ng-if="vm.result.finish" class="h-140" flex>
252 <ms-widget-front class="p-16 white-bg">
256 layout-align="center center"
259 <div class="md-display-1 pb-8 red-fg">
260 <span ng-bind="vm.result.failedRows"></span>
263 class="font-weight-500 secondary-text"
264 translate="CONTACTMANAGER.FAILURE"
272 <!-- / WIDGET FAILURE -->
274 <!-- WIDGET DUPLICATES -->
276 ng-if="vm.result.duplicatedRows && vm.result.finish"
281 <ms-widget-front class="p-16 white-bg">
285 layout-align="center center"
288 <div class="md-display-1 pb-8 orange-fg">
289 <span ng-bind="vm.result.duplicatedRows"></span>
292 class="font-weight-500 secondary-text"
293 translate="CONTACTMANAGER.DUPLICATES"
301 <!-- / WIDGET DUPLICATES -->
306 <md-dialog-actions layout="row" layout-align="space-between center">
309 ng-if="!vm.processing"
310 ng-disabled="importForm.$invalid || importForm.$pristine"
311 ng-click="vm.uploadCsv()"
312 class="md-accent md-raised"
314 translate="CONTACTMANAGER.UPLOAD"
315 translate-attr-aria-label="CONTACTMANAGER.IMPORT"
320 ng-if="vm.processing && !vm.result.finish && !vm.stopping"
321 ng-click="vm.stopUpload()"
322 class="md-accent md-raised"
323 aria-label="Stop Upload"
324 translate="CONTACTMANAGER.STOP"
325 translate-attr-aria-label="CONTACTMANAGER.STOP"
330 ng-if="vm.result.finish && vm.result.errors.length"
331 ng-csv="vm.getArrayErrors()"
332 csv-header="vm.getHeaderErrors()"
333 class="md-accent md-raised"
334 aria-label="Export Errors"
335 filename="contacts_import_errors.csv"
337 <md-icon md-font-icon="icon-file-excel"></md-icon>
338 {{'CONTACTMANAGER.EXPORT_ERRORS' | translate}}