2 id="integrations-freshsalesAccount"
3 class="page-layout simple tabbed"
7 <div class="header md-accent-bg" layout="row" layout-align="start center">
8 <div class="white-fg" layout="row" layout-align="start center" flex>
10 class="goto-freshsalesAccounts-button md-icon-button"
11 aria-label="Go to freshsalesAccounts"
12 ng-click="vm.gotoFreshsalesAccounts()"
14 translate-attr-aria-label="INTEGRATIONS.GO_TO_FRESHSALESACCOUNTS"
16 <md-icon md-font-icon="icon-arrow-left"></md-icon>
19 <div layout="row" layout-align="start center">
20 <div class="freshsalesAccount-image" hide-xs>
21 <img ng-src="assets/images/business/freshsalesAccounts.jpg" />
24 <div layout="column" layout-align="start start">
26 #{{vm.freshsalesAccount.id}}
27 <span ng-if="vm.freshsalesAccount.name"
28 >{{vm.freshsalesAccount.name}}</span
31 <div class="subtitle secondary-text">
32 <span translate="INTEGRATIONS.CREATED_AT"></span>
33 <span>{{vm.freshsalesAccount.createdAt | date:'medium'}}</span>
41 ng-click="vm.saveFreshsalesAccount()"
42 ng-if="vm.crudPermissions.canEdit"
43 class="send-button md-accent md-raised"
44 ng-disabled="(generalForm.$invalid) || (configurationsForm.$invalid)"
45 translate="INTEGRATIONS.SAVE"
46 translate-attr-aria-label="INTEGRATIONS.SAVE"
57 md-selected="vm.selectedTab"
58 md-stretch-tabs="always"
65 <span translate="INTEGRATIONS.ACCOUNT">ACCOUNT</span>
69 class="freshsalesAccount-detail-form-container general md-background-bg md-whiteframe-1dp"
71 <div class="pb-16" layout="row" layout-align="start center">
72 <div class="h2 secondary-text" translate="INTEGRATIONS.GENERAL">
76 <form name="generalForm" novalidate>
77 <md-input-container class="md-block">
78 <label translate="INTEGRATIONS.NAME">Name</label>
82 ng-model="vm.freshsalesAccount.name"
85 ng-disabled="!vm.crudPermissions.canEdit"
89 ng-messages="generalForm['name'].$error"
90 ng-show="generalForm['name'].$touched"
93 <div ng-message="required">
94 <span translate="INTEGRATIONS.ERRORS.NAME_REQUIRED"
95 >Name field is required</span
100 <md-input-container class="md-block">
101 <label translate="INTEGRATIONS.USERNAME">Username</label>
105 ng-model="vm.freshsalesAccount.username"
107 ng-disabled="!vm.crudPermissions.canEdit"
111 ng-messages="generalForm['username'].$error"
112 ng-show="generalForm['username'].$touched"
115 <div ng-message="required">
116 <span translate="INTEGRATIONS.ERRORS.USERNAME_REQUIRED"
117 >Username field is required</span
121 </md-input-container>
122 <md-input-container class="md-block">
123 <label translate="INTEGRATIONS.URI">Uri</label>
127 ng-model="vm.freshsalesAccount.remoteUri"
129 ng-disabled="!vm.crudPermissions.canEdit"
133 ng-messages="generalForm['remoteUri'].$error"
134 ng-show="generalForm['remoteUri'].$touched"
137 <div ng-message="required">
138 <span translate="INTEGRATIONS.ERRORS.URI_REQUIRED"
139 >Uri field is required</span
142 <div ng-message="url">
143 <span translate="INTEGRATIONS.ERRORS.URI_MUST_VALID_URL"
144 >Uri must be a valid url http://www.xcally.com</span
148 </md-input-container>
149 <md-input-container class="md-block">
150 <label translate="INTEGRATIONS.APIKEY">ApiKey</label>
154 ng-model="vm.freshsalesAccount.apiKey"
156 ng-disabled="!vm.crudPermissions.canEdit"
160 ng-messages="generalForm['apiKey'].$error"
161 ng-show="generalForm['apiKey'].$touched"
164 <div ng-message="required">
165 <span translate="INTEGRATIONS.ERRORS.APIKEY_REQUIRED"
166 >ApiKey field is required</span
170 </md-input-container>
171 <md-input-container class="md-block">
172 <label translate="INTEGRATIONS.MOTIONPROXYADDRESS"
173 >MotionProxyAddress</label
178 ng-model="vm.freshsalesAccount.serverUrl"
179 ng-disabled="!vm.crudPermissions.canEdit"
183 <span translate="INTEGRATIONS.HELP.MOTIONPROXYADDRESS"></span>
186 ng-messages="generalForm['serverUrl'].$error"
187 ng-show="generalForm['serverUrl'].$touched"
190 <div ng-message="required">
192 translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_REQUIRED"
193 >MotionProxyAddress field is required</span
196 <div ng-message="url">
198 translate="INTEGRATIONS.ERRORS.MOTIONPROXYADDRESS_MUST_VALID_URL"
199 >MotionProxyAddress must be a valid url
200 http://www.xcally.com</span
204 </md-input-container>
205 <md-input-container class="md-block">
206 <label translate="INTEGRATIONS.DESCRIPTION">Description</label>
210 ng-model="vm.freshsalesAccount.description"
211 ng-disabled="!vm.crudPermissions.canEdit"
215 ng-messages="generalForm['description'].$error"
216 ng-show="generalForm['description'].$touched"
219 <div ng-message="required">
220 <span translate="INTEGRATIONS.ERRORS.DESCRIPTION_REQUIRED"
221 >Description field is required</span
225 </md-input-container>
232 <span translate="INTEGRATIONS.CONFIGURATIONS">CONFIGURATIONS</span>
236 class="freshsalesAccount-detail-form-container configurations md-background-bg md-whiteframe-1dp"
238 <div class="pb-16" layout="row" layout-align="start center">
240 class="h2 secondary-text"
241 translate="INTEGRATIONS.CONFIGURATIONS"
247 ng-controller="FreshsalesAccountConfigurationsController as vm_cc"
248 ng-init="vm_cc.init(vm.freshsalesAccount, vm.crudPermissions)"
251 <md-card class="md-whiteframe-1dp" flex="30">
252 <div layout="row" layout-align="center center">
253 <md-subheader flex="75" class="md-no-sticky"
254 >{{ 'INTEGRATIONS.CONFIGURATIONS' | translate
259 ng-if="vm_cc.crudPermissions.canEdit"
260 ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)"
261 class="md-icon-button"
262 aria-label="create freshsalesConfiguration"
264 <md-icon md-font-icon="icon-plus"></md-icon>
270 layout-align="center center"
271 ng-repeat="freshsalesConfiguration in vm_cc.configurations"
273 md-colors="{background: (vm_cc.selectedFreshsalesConfiguration == $index ? 'accent' : 'grey-A100')}"
274 ng-click="vm_cc.getFreshsalesConfiguration($index)"
276 <span class="text-truncate" flex="80"
277 >{{ freshsalesConfiguration.name }}</span
279 <md-menu ng-if="vm_cc.crudPermissions.canDelete">
281 class="md-icon-button"
284 translate-attr-aria-label="INTEGRATIONS.MORE"
285 ng-click="$mdOpenMenu($event)"
287 <md-icon md-font-icon="icon-dots-vertical"></md-icon>
289 <md-menu-content width="3">
290 <md-menu-item ng-if="vm_cc.crudPermissions.canDelete">
292 ng-click="vm_cc.deleteFreshsalesConfiguration($event, freshsalesConfiguration)"
293 translate="INTEGRATIONS.DELETE_FRESHSALESCONFIGURATION"
295 Delete FreshsalesConfiguration
304 <md-card class="md-whiteframe-1dp" flex="65">
305 <md-tabs ng-if="vm_cc.configurations.length" md-dynamic-height>
308 <span translate="INTEGRATIONS.SUBJECTS">SUBJECTS</span>
312 class="md-table-toolbar md-default no-padding"
313 ng-hide="vm_cc.selectedSubjects.length"
315 <div class="md-toolbar-tools">
318 on-search="vm_cc.query.subject = query"
319 on-collapse="vm_cc.query.subject = undefined"
323 ng-if="vm_cc.crudPermissions.canEdit"
324 class="md-icon-button"
325 ng-click="vm_cc.createOrEditSubject($event)"
326 aria-label="add subject"
328 translate-attr-label="INTEGRATIONS.ADD_SUBJECT"
330 <md-icon md-font-icon="icon-plus"></md-icon>
335 class="md-table-toolbar md-accent"
336 ng-show="vm_cc.selectedSubjects.length"
338 <div class="md-toolbar-tools">
339 <span class="md-subhead"
340 >{{vm_cc.selectedSubjects.length}}
341 {{vm_cc.selectedSubjects.length > 1 ? 'items' :
342 'item'}} selected</span
346 ng-if="vm_cc.crudPermissions.canDelete"
347 class="md-icon-button"
348 ng-click="vm_cc.deleteSelectedSubjects($event)"
349 aria-label="delete selected"
351 translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
353 <md-icon md-font-icon="icon-delete"></md-icon>
358 class="md-whiteframe-1dp padding-horizontal"
364 ng-model="vm_cc.selectedSubjects"
369 {{ 'INTEGRATIONS.ID' | translate }}
372 {{ 'INTEGRATIONS.TYPE' | translate }}
375 {{ 'INTEGRATIONS.CONTENT' | translate }}
377 <th md-column width="10px"></th>
385 ng-repeat="subject in vm_cc.subjects | filter: vm_cc.query.subject"
388 ng-click="vm_cc.createOrEditSubject($event, subject)"
395 ng-click="vm_cc.createOrEditSubject($event, subject)"
399 <span ng-if="subject.FieldId"
400 >{{subject.nameField ||
401 subject.idField}}</span
403 <span ng-if="!subject.FieldId"
404 >{{subject.type}}</span
408 ng-switch="subject.type"
409 ng-click="vm_cc.createOrEditSubject($event, subject)"
412 <span ng-switch-when="string"
413 >{{subject.content}}</span
416 ng-switch-when="variable"
418 >{{subject.variableName}}</span
421 ng-switch-when="customVariable"
424 vm_cc.variablesById[subject.VariableId].name
427 <span ng-switch-when="keyValue">
429 <span ng-switch="description.keyType">
430 <span ng-switch-when="string"
431 >{{subject.keyContent}}</span
434 ng-switch-when="variable"
436 >{{subject.variableName}}</span
439 ng-switch-when="customVariable"
442 vm_cc.variablesById[subject.VariableId].name
447 <span ng-switch-default
448 >{{subject.content}}</span
454 ng-if="!vm_cc.crudPermissions.readOnly"
458 class="md-icon-button"
461 translate-attr-aria-label="INTEGRATIONS.MORE"
462 ng-click="$mdOpenMenu($event)"
465 md-font-icon="icon-dots-vertical"
469 <md-menu-content width="3">
471 ng-if="vm_cc.crudPermissions.canEdit"
474 ng-click="vm_cc.createOrEditSubject($event, subject)"
475 translate="INTEGRATIONS.EDIT_SUBJECT"
481 ng-if="vm_cc.crudPermissions.canDelete"
484 ng-click="vm_cc.deleteSubjectConfirm($event, subject)"
485 translate="INTEGRATIONS.DELETE_SUBJECT"
496 </md-table-container>
502 <span translate="INTEGRATIONS.DESCRIPTIONS"
508 class="md-table-toolbar md-default no-padding"
509 ng-hide="vm_cc.selectedDescriptions.length"
511 <div class="md-toolbar-tools">
514 on-search="vm_cc.query.description = query"
515 on-collapse="vm_cc.query.description = undefined"
519 ng-if="vm_cc.crudPermissions.canEdit"
520 class="md-icon-button"
521 ng-click="vm_cc.createOrEditDescription($event)"
522 aria-label="add description"
524 translate-attr-label="INTEGRATIONS.ADD_DESCRIPTION"
526 <md-icon md-font-icon="icon-plus"></md-icon>
531 class="md-table-toolbar md-accent"
532 ng-show="vm_cc.selectedDescriptions.length"
534 <div class="md-toolbar-tools">
535 <span class="md-subhead"
536 >{{vm_cc.selectedDescriptions.length}}
537 {{vm_cc.selectedDescriptions.length > 1 ? 'items' :
538 'item'}} selected</span
542 ng-if="vm_cc.crudPermissions.canDelete"
543 class="md-icon-button"
544 ng-click="vm_cc.deleteSelectedDescriptions($event)"
545 aria-label="delete selected"
547 translate-attr-label="INTEGRATIONS.DELETE_SELECTED"
549 <md-icon md-font-icon="icon-delete"></md-icon>
554 class="md-whiteframe-1dp padding-horizontal"
560 ng-model="vm_cc.selectedDescriptions"
565 {{ 'INTEGRATIONS.ID' | translate }}
568 {{ 'INTEGRATIONS.TYPE' | translate }}
571 {{ 'INTEGRATIONS.CONTENT' | translate }}
573 <th md-column width="10px"></th>
579 md-select="description"
581 ng-repeat="description in vm_cc.descriptions | filter: vm_cc.query.description"
584 ng-click="vm_cc.createOrEditDescription($event, description)"
591 ng-click="vm_cc.createOrEditDescription($event, description)"
595 <span ng-if="description.FieldId"
596 >{{description.nameField ||
597 description.idField}}</span
599 <span ng-if="!description.FieldId"
600 >{{description.type}}</span
604 ng-switch="description.type"
605 ng-click="vm_cc.createOrEditDescription($event, description)"
608 <span ng-switch-when="string"
609 >{{description.content}}</span
612 ng-switch-when="variable"
614 >{{description.variableName}}</span
617 ng-switch-when="customVariable"
620 vm_cc.variablesById[description.VariableId].name
623 <span ng-switch-when="keyValue">
625 <span ng-switch="description.keyType">
626 <span ng-switch-when="string"
627 >{{description.keyContent}}</span
630 ng-switch-when="variable"
632 >{{description.variableName}}</span
635 ng-switch-when="customVariable"
638 vm_cc.variablesById[description.VariableId].name
643 <span ng-switch-default
644 >{{description.content}}</span
650 ng-if="!vm_cc.crudPermissions.readOnly"
654 class="md-icon-button"
657 translate-attr-aria-label="INTEGRATIONS.MORE"
658 ng-click="$mdOpenMenu($event)"
661 md-font-icon="icon-dots-vertical"
665 <md-menu-content width="3">
667 ng-if="vm_cc.crudPermissions.canEdit"
670 ng-click="vm_cc.createOrEditDescription($event, description)"
671 translate="INTEGRATIONS.EDIT_DESCRIPTION"
677 ng-if="vm_cc.crudPermissions.canDelete"
680 ng-click="vm_cc.deleteDescriptionConfirm($event, description)"
681 translate="INTEGRATIONS.DELETE_DESCRIPTION"
692 </md-table-container>
698 ng-if="!vm_cc.configurations.length && vm_cc.crudPermissions.canEdit"
699 ng-click="vm_cc.createOrEditFreshsalesConfiguration($event)"
702 layout-align="center center"
706 class="padding-20 md-whiteframe-3dp md-accent-bg"
708 layout-align="center center"
710 <md-button class="md-icon-button">
711 <md-icon md-font-icon="icon-plus"></md-icon>
714 aria-label="add configuration"
716 translate-attr-label="INTEGRATIONS.ADD_CONFIGURATION"
717 >ADD CONFIGURATION</span