Commit d011f511c90819393142ad4f5f5d111b80749799
Exists in
master
Merge branch 'master' of git.viithiisys.com:viithiisys/acufuel
Showing
3 changed files
Show diff stats
app/partials/ContactView/ContactView.controller.js
1 | 'use strict'; | 1 | 'use strict'; |
2 | 2 | ||
3 | //Load controller | 3 | //Load controller |
4 | angular.module('acufuel') | 4 | angular.module('acufuel') |
5 | 5 | ||
6 | .controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', 'ViewcontactService', 'NgTableParams', function($scope, $uibModal, ContactViewService, ViewCompanyService, ViewcontactService, NgTableParams) { | 6 | .controller('ContactViewController', ['$scope', '$uibModal', 'ContactViewService', 'ViewCompanyService', 'ViewcontactService', 'NgTableParams', function($scope, $uibModal, ContactViewService, ViewCompanyService, ViewcontactService, NgTableParams) { |
7 | 7 | ||
8 | $(document).ready(function() { | 8 | $(document).ready(function() { |
9 | $('#contacts').DataTable(); | 9 | $('#contacts').DataTable(); |
10 | }); | 10 | }); |
11 | 11 | ||
12 | ContactViewService.getContacts().then(function(result) { | 12 | ContactViewService.getContacts().then(function(result) { |
13 | $scope.contactList = result; | 13 | $scope.contactList = result; |
14 | }) | 14 | }) |
15 | 15 | ||
16 | $scope.search = ""; | ||
17 | $scope.minlength = 2; | ||
18 | |||
19 | |||
20 | $scope.searchString= function(value){ | ||
21 | ContactViewService.getSearchResults(value).then(function(result) { | ||
22 | $scope.contactList = result; | ||
23 | console.log("result", result); | ||
24 | for (var i = 0; i < $scope.contactList.length; i++) { | ||
25 | if ($scope.contactList[i].owner != null) { | ||
26 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { | ||
27 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | $scope.displayContactList = new NgTableParams({ | ||
32 | page: 1, | ||
33 | count: 10, | ||
34 | }, { | ||
35 | data: $scope.contactList | ||
36 | }); | ||
37 | }) | ||
38 | } | ||
39 | |||
16 | $scope.reset = function(){ | 40 | $scope.reset = function(){ |
17 | $("input").val(""); | 41 | $("input").val(""); |
18 | } | 42 | } |
19 | 43 | ||
20 | $scope.data = {}; | 44 | $scope.data = {}; |
21 | getAllContacts(); | 45 | getAllContacts(); |
22 | 46 | ||
23 | $scope.changePriceEmail = function(id, index){ | 47 | $scope.changePriceEmail = function(id, index){ |
24 | event.stopPropagation(); | 48 | event.stopPropagation(); |
25 | var contactId = id; | 49 | var contactId = id; |
26 | var statusData = "status=" + $scope.contactList[index].priceEmail; | 50 | var statusData = "status=" + $scope.contactList[index].priceEmail; |
27 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { | 51 | ViewcontactService.changePriceEmail(contactId, statusData).then(function(result) { |
28 | if(result.success){ | 52 | if(result.success){ |
29 | $('#toogleMail').css('display', 'block'); | 53 | $('#toogleMail').css('display', 'block'); |
30 | if($scope.contactList[index].priceEmail == true){ | 54 | if($scope.contactList[index].priceEmail == true){ |
31 | $scope.messageText = 'You have enabled price distribution for this contact'; | 55 | $scope.messageText = 'You have enabled price distribution for this contact'; |
32 | }else{ | 56 | }else{ |
33 | $scope.messageText = 'You have disabled price distribution for this contact'; | 57 | $scope.messageText = 'You have disabled price distribution for this contact'; |
34 | } | 58 | } |
35 | } | 59 | } |
36 | }) | 60 | }) |
37 | } | 61 | } |
38 | 62 | ||
39 | $scope.cancelToogle = function(){ | 63 | $scope.cancelToogle = function(){ |
40 | $('#toogleMail').css('display', 'none'); | 64 | $('#toogleMail').css('display', 'none'); |
41 | } | 65 | } |
42 | 66 | ||
43 | 67 | ||
44 | function getAllContacts(){ | 68 | function getAllContacts(){ |
45 | ContactViewService.getContacts().then(function(result) { | 69 | ContactViewService.getContacts().then(function(result) { |
46 | console.log('log', result); | 70 | console.log('log', result); |
47 | $scope.contactList = result; | 71 | $scope.contactList = result; |
48 | for (var i = 0; i < $scope.contactList.length; i++) { | 72 | for (var i = 0; i < $scope.contactList.length; i++) { |
49 | if ($scope.contactList[i].owner != null) { | 73 | if ($scope.contactList[i].owner != null) { |
50 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { | 74 | if ($scope.contactList[i].owner.companyName != null || $scope.contactList[i].owner.companyName != undefined) { |
51 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; | 75 | $scope.contactList[i].owner = $scope.contactList[i].owner.companyName; |
52 | } | 76 | } |
53 | } | 77 | } |
54 | } | 78 | } |
55 | $scope.displayContactList = new NgTableParams({ | 79 | $scope.displayContactList = new NgTableParams({ |
56 | page: 1, | 80 | page: 1, |
57 | count: 10, | 81 | count: 10, |
58 | }, { | 82 | }, { |
59 | data: $scope.contactList | 83 | data: $scope.contactList |
60 | }); | 84 | }); |
61 | }) | 85 | }) |
62 | } | 86 | } |
63 | 87 | ||
64 | 88 | ||
65 | /*ContactViewService.getCompanies().then(function(result) { | 89 | ContactViewService.getCompanies().then(function(result) { |
66 | $scope.companies = result; | 90 | $scope.companies = result; |
67 | 91 | ||
68 | })*/ | 92 | }) |
69 | 93 | ||
70 | $scope.contactData = {}; | 94 | $scope.contactData = {}; |
71 | $scope.contactData.contactList = []; | 95 | $scope.contactData.contactList = []; |
72 | $scope.addContact = function(){ | 96 | $scope.addContact = function(){ |
73 | $scope.contactData.contactList.push($scope.data); | 97 | $scope.contactData.contactList.push($scope.data); |
74 | ViewCompanyService.addContact($scope.contactData).then(function(result) { | 98 | ViewCompanyService.addContact($scope.contactData).then(function(result) { |
75 | if(result.success){ | 99 | if(result.success){ |
76 | toastr.success(''+result.success+'', { | 100 | toastr.success(''+result.success+'', { |
77 | closeButton: true | 101 | closeButton: true |
78 | }) | 102 | }) |
79 | $('#contact-modal-3').modal('hide'); | 103 | $('#contact-modal-3').modal('hide'); |
80 | }else{ | 104 | }else{ |
81 | toastr.error(''+result.statusText+'', { | 105 | toastr.error(''+result.statusText+'', { |
82 | closeButton: true | 106 | closeButton: true |
83 | }) | 107 | }) |
84 | } | 108 | } |
85 | }) | 109 | }) |
86 | } | 110 | } |
87 | 111 | ||
88 | }]); | 112 | }]); |
app/partials/ContactView/ContactView.html
1 | <style> | 1 | <style> |
2 | .subnavbar .mainnav > li:nth-child(3) > a{ | 2 | .subnavbar .mainnav > li:nth-child(3) > a{ |
3 | color: #ff9900; | 3 | color: #ff9900; |
4 | } | 4 | } |
5 | </style> | 5 | </style> |
6 | <div class="main"> | 6 | <div class="main"> |
7 | <div class="container"> | 7 | <div class="container"> |
8 | <div class="row"> | 8 | <div class="row"> |
9 | <div class="col-md-12"> | 9 | <div class="col-md-12"> |
10 | <div class="widget stacked "> | 10 | <div class="widget stacked "> |
11 | <div class="widget-content"> | 11 | <div class="widget-content"> |
12 | <div class="tabbable"> | 12 | <div class="tabbable"> |
13 | <ul class="nav nav-tabs"> | 13 | <ul class="nav nav-tabs"> |
14 | <li> | 14 | <li> |
15 | <a ui-sref="app.customers">Company View | 15 | <a ui-sref="app.customers">Company View |
16 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 16 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
17 | </a> | 17 | </a> |
18 | </li> | 18 | </li> |
19 | <li class="active"> | 19 | <li class="active"> |
20 | <a ui-sref="app.ContactView">Contact View | 20 | <a ui-sref="app.ContactView">Contact View |
21 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 21 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
22 | </a> | 22 | </a> |
23 | </li> | 23 | </li> |
24 | <li> | 24 | <li> |
25 | <a ui-sref="app.FuelVendors">Fuel Vendors | 25 | <a ui-sref="app.FuelVendors">Fuel Vendors |
26 | <i class="fa fa-caret-down" aria-hidden="true"></i> | 26 | <i class="fa fa-caret-down" aria-hidden="true"></i> |
27 | </a> | 27 | </a> |
28 | </li> | 28 | </li> |
29 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table"></li> | 29 | <li style="margin: 0px 10px 4px 40px;"><input type="text" style="height:31px;"class="form-control" name="name" id="name" placeholder="Search In Table" ng-model="search" ng-keyup="searchString(search)" ng-minlength="minlength"></li> |
30 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> | 30 | <li><button type="button" class="btn btn-default btn-sm">Clear Search And Filters</button></li> |
31 | <li style="float: right"> <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm"> <i class="fa fa-plus" aria-hidden="true"></i> Add Contact </button></li> | 31 | <li style="float: right"> <button type="submit" data-toggle="modal" data-target="#contact-modal-3" class="btn btn-success btn-sm"> <i class="fa fa-plus" aria-hidden="true"></i> Add Contact </button></li> |
32 | </ul> | 32 | </ul> |
33 | <br> | 33 | <br> |
34 | <div class="tab-content customer-table" style="margin:0px"> | 34 | <div class="tab-content customer-table" style="margin:0px"> |
35 | <div class="tab-pane active" id="companyView"> | 35 | <div class="tab-pane active" id="companyView"> |
36 | <table ng-table="displayContactList" class="table table-striped table-condensed" show-filter="true"> | 36 | <table ng-table="displayContactList" class="table table-striped table-condensed" show-filter="true"> |
37 | <tr ng-repeat="row in $data track by row.id" style="cursor: pointer;" ui-sref="app.viewContact({id : row.id})"> | 37 | <tr ng-repeat="row in $data track by row.id" style="cursor: pointer;" ui-sref="app.viewContact({id : row.id})"> |
38 | <td data-title="'Last Name'" filter="{lastName: 'text'}" sortable="'lastName'"> | 38 | <td data-title="'Last Name'" filter="{lastName: 'text'}" sortable="'lastName'"> |
39 | {{row.lastName}} | 39 | {{row.lastName}} |
40 | </td> | 40 | </td> |
41 | <td data-title="'First Name'" filter="{firstName: 'text'}" sortable="'firstName'"> | 41 | <td data-title="'First Name'" filter="{firstName: 'text'}" sortable="'firstName'"> |
42 | {{row.firstName}} | 42 | {{row.firstName}} |
43 | </td> | 43 | </td> |
44 | <td data-title="'Company Name'" filter="{owner: 'text'}" sortable="'owner'"> | 44 | <td data-title="'Company Name'" filter="{owner: 'text'}" sortable="'owner'"> |
45 | {{row.owner}} | 45 | {{row.owner}} |
46 | </td> | 46 | </td> |
47 | <td data-title="'Work Phone'" filter="{workPhone: 'text'}" sortable="'workPhone'"> | 47 | <td data-title="'Work Phone'" filter="{workPhone: 'text'}" sortable="'workPhone'"> |
48 | {{row.workPhone}} | 48 | {{row.workPhone}} |
49 | </td> | 49 | </td> |
50 | <td data-title="'Mobile Phone'" filter="{mobilePhone: 'text'}" sortable="'mobilePhone'"> | 50 | <td data-title="'Mobile Phone'" filter="{mobilePhone: 'text'}" sortable="'mobilePhone'"> |
51 | {{row.mobilePhone}} | 51 | {{row.mobilePhone}} |
52 | </td> | 52 | </td> |
53 | <td data-title="'Title'" filter="{title: 'text'}" sortable="'title'"> | 53 | <td data-title="'Title'" filter="{title: 'text'}" sortable="'title'"> |
54 | {{row.title}} | 54 | {{row.title}} |
55 | </td> | 55 | </td> |
56 | <td data-title="'Pricing Email'"> | 56 | <td data-title="'Pricing Email'"> |
57 | <toggle ng-model="row.priceEmail" ng-change="changePriceEmail(row.id, $index)" size="customToogle"></toggle> | 57 | <toggle ng-model="row.priceEmail" ng-change="changePriceEmail(row.id, $index)" size="customToogle"></toggle> |
58 | </td> | 58 | </td> |
59 | <td data-title="'User Name'" filter="{userName: 'text'}" sortable="'userName'"> | 59 | <td data-title="'User Name'" filter="{userName: 'text'}" sortable="'userName'"> |
60 | {{row.userName}} | 60 | {{row.userName}} |
61 | </td> | 61 | </td> |
62 | </tr> | 62 | </tr> |
63 | </table> | 63 | </table> |
64 | 64 | ||
65 | <button type="button" class="btn btn-warning exportBtn">Export Customers</button> | 65 | <button type="button" class="btn btn-warning exportBtn">Export Customers</button> |
66 | 66 | ||
67 | <!-- <table class="table table-striped"> | 67 | <!-- <table class="table table-striped"> |
68 | <thead> | 68 | <thead> |
69 | <tr> | 69 | <tr> |
70 | <th> | 70 | <th> |
71 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 71 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
72 | <label class="font-company">Last Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 72 | <label class="font-company">Last Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
73 | </th> | 73 | </th> |
74 | 74 | ||
75 | <th> | 75 | <th> |
76 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 76 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
77 | <label class="font-company">First Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 77 | <label class="font-company">First Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
78 | </th> | 78 | </th> |
79 | <th> | 79 | <th> |
80 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 80 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
81 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> | 81 | <label class="font-company">Company Name <i class="fa fa-sort" aria-hidden="true"></i></label> |
82 | </th> | 82 | </th> |
83 | 83 | ||
84 | <th> | 84 | <th> |
85 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 85 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
86 | <label class="font-company">Work Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 86 | <label class="font-company">Work Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
87 | <th> | 87 | <th> |
88 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 88 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
89 | <label class="font-company">Mobile Phone <i class="fa fa-sort" aria-hidden="true"></i></label> | 89 | <label class="font-company">Mobile Phone <i class="fa fa-sort" aria-hidden="true"></i></label> |
90 | </th> | 90 | </th> |
91 | <th> | 91 | <th> |
92 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 92 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
93 | <label class="font-company">Title <i class="fa fa-sort" aria-hidden="true"></i></label> | 93 | <label class="font-company">Title <i class="fa fa-sort" aria-hidden="true"></i></label> |
94 | </th> | 94 | </th> |
95 | 95 | ||
96 | <th> | 96 | <th> |
97 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 97 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
98 | <label class="font-company">Price Email<i class="fa fa-sort" aria-hidden="true"></i></label> | 98 | <label class="font-company">Price Email<i class="fa fa-sort" aria-hidden="true"></i></label> |
99 | </th> | 99 | </th> |
100 | <th> | 100 | <th> |
101 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> | 101 | <input type="text" class="form-control" style="height:31px;" name="name" id="name"> |
102 | <label class="font-company">Username<i class="fa fa-sort" aria-hidden="true"></i></label> | 102 | <label class="font-company">Username<i class="fa fa-sort" aria-hidden="true"></i></label> |
103 | </th> | 103 | </th> |
104 | </tr> | 104 | </tr> |
105 | </thead> | 105 | </thead> |
106 | <tbody> | 106 | <tbody> |
107 | <tr ng-repeat="contact in contactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> | 107 | <tr ng-repeat="contact in contactList" style="cursor: pointer;" ui-sref="app.viewContact({id : contact.id})"> |
108 | <td>{{contact.lastName}}</td> | 108 | <td>{{contact.lastName}}</td> |
109 | <td>{{contact.firstName}}</td> | 109 | <td>{{contact.firstName}}</td> |
110 | <td>{{contact.owner.companyName}}</td> | 110 | <td>{{contact.owner.companyName}}</td> |
111 | <td>{{contact.workPhone}}</td> | 111 | <td>{{contact.workPhone}}</td> |
112 | <td>{{contact.mobilePhone}}</td> | 112 | <td>{{contact.mobilePhone}}</td> |
113 | <td>{{contact.title}}</td> | 113 | <td>{{contact.title}}</td> |
114 | <td> | 114 | <td> |
115 | <toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle> | 115 | <toggle ng-model="contact.priceEmail" ng-change="changePriceEmail(contact.id, $index)" size="customToogle"></toggle> |
116 | </td> | 116 | </td> |
117 | <td>{{contact.userName}}</td> | 117 | <td>{{contact.userName}}</td> |
118 | </tr> | 118 | </tr> |
119 | </tbody> | 119 | </tbody> |
120 | </table> --> | 120 | </table> --> |
121 | <!-- <div class="row" style="margin-left: 0px;"> | 121 | <!-- <div class="row" style="margin-left: 0px;"> |
122 | <div class="col-md-2"> | 122 | <div class="col-md-2"> |
123 | <button type="button" class="btn btn-warning">Export Customers</button> | 123 | <button type="button" class="btn btn-warning">Export Customers</button> |
124 | </div> | 124 | </div> |
125 | <div class="col-md-10"> | 125 | <div class="col-md-10"> |
126 | <div class="row" style="margin-left: 0px;"> | 126 | <div class="row" style="margin-left: 0px;"> |
127 | <div class="col-md-6"> | 127 | <div class="col-md-6"> |
128 | </div> | 128 | </div> |
129 | <div class="col-md-2"> | 129 | <div class="col-md-2"> |
130 | <select class="form-control"> | 130 | <select class="form-control"> |
131 | <option>20 Records Per Page</option> | 131 | <option>20 Records Per Page</option> |
132 | <option>50 Records Per Page</option> | 132 | <option>50 Records Per Page</option> |
133 | <option>100 Records Per Page</option> | 133 | <option>100 Records Per Page</option> |
134 | </select> | 134 | </select> |
135 | </div> | 135 | </div> |
136 | <div class="col-md-4"> | 136 | <div class="col-md-4"> |
137 | <ul class="pagination" style="margin:0px"> | 137 | <ul class="pagination" style="margin:0px"> |
138 | <li><a href="javascript:;">ยซ</a></li> | 138 | <li><a href="javascript:;">ยซ</a></li> |
139 | <li class="active"><a href="#">1</a></li> | 139 | <li class="active"><a href="#">1</a></li> |
140 | <li><a href="javascript:;">2</a></li> | 140 | <li><a href="javascript:;">2</a></li> |
141 | <li><a href="javascript:;">3</a></li> | 141 | <li><a href="javascript:;">3</a></li> |
142 | <li><a href="javascript:;">4</a></li> | 142 | <li><a href="javascript:;">4</a></li> |
143 | <li><a href="javascript:;">5</a></li> | 143 | <li><a href="javascript:;">5</a></li> |
144 | <li><a href="javascript:;">ยป</a></li> | 144 | <li><a href="javascript:;">ยป</a></li> |
145 | </ul> | 145 | </ul> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | </div> | 148 | </div> |
149 | </div> --> | 149 | </div> --> |
150 | </div> | 150 | </div> |
151 | </div> | 151 | </div> |
152 | </div> | 152 | </div> |
153 | </div> | 153 | </div> |
154 | <!-- /widget-content --> | 154 | <!-- /widget-content --> |
155 | </div> | 155 | </div> |
156 | <!-- /widget --> | 156 | <!-- /widget --> |
157 | </div> | 157 | </div> |
158 | <!-- /span8 --> | 158 | <!-- /span8 --> |
159 | </div> | 159 | </div> |
160 | <!-- /row --> | 160 | <!-- /row --> |
161 | </div> | 161 | </div> |
162 | <!-- /container --> | 162 | <!-- /container --> |
163 | </div> | 163 | </div> |
164 | <!-- /main --> | 164 | <!-- /main --> |
165 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> | 165 | <form class="modal multi-step" id="contact-modal-3" name="companyForm"> |
166 | <div class="modal-dialog modal-lg"> | 166 | <div class="modal-dialog modal-lg"> |
167 | <div class="modal-content"> | 167 | <div class="modal-content"> |
168 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> | 168 | <div class="modal-body step-1" data-step="1" style="padding: 0;"> |
169 | <div> | 169 | <div> |
170 | <div class="row" style="margin: 0;"> | 170 | <div class="row" style="margin: 0;"> |
171 | <div> | 171 | <div> |
172 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> | 172 | <div class="widget" style="margin-bottom: 0; box-shadow: none;"> |
173 | <div class="widget-header"> | 173 | <div class="widget-header"> |
174 | <i class="icon-pencil"></i> | 174 | <i class="icon-pencil"></i> |
175 | <i class="fa fa-tasks" aria-hidden="true"></i> | 175 | <i class="fa fa-tasks" aria-hidden="true"></i> |
176 | <h3>Add a New Contact</h3> | 176 | <h3>Add a New Contact</h3> |
177 | <div class="clearfix"></div> | 177 | <div class="clearfix"></div> |
178 | </div> | 178 | </div> |
179 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> | 179 | <div class="widget-content" style="padding-left: 0; padding-right: 0; border-bottom: 0;"> |
180 | <div class="col-xs-12"> | 180 | <div class="col-xs-12"> |
181 | <div class="col-md-6"> | 181 | <div class="col-md-6"> |
182 | <div class="pull-left" style="width: 110px;"> | 182 | <div class="pull-left" style="width: 110px;"> |
183 | <label class="new-input-label"><b>First Name</b></label> | 183 | <label class="new-input-label"><b>First Name</b></label> |
184 | </div> | 184 | </div> |
185 | <div class="pull-left" style="margin-left: 15px;"> | 185 | <div class="pull-left" style="margin-left: 15px;"> |
186 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> | 186 | <input type="tel" ng-model="data.firstName" class="form-control" placeholder=""> |
187 | </div> | 187 | </div> |
188 | <div class="clearfix"></div> | 188 | <div class="clearfix"></div> |
189 | </div> | 189 | </div> |
190 | <div class="col-md-6"> | 190 | <div class="col-md-6"> |
191 | 191 | ||
192 | <div class="pull-left" style="width: 110px;"> | 192 | <div class="pull-left" style="width: 110px;"> |
193 | <label class="new-input-label"><b>Last Name</b></label> | 193 | <label class="new-input-label"><b>Last Name</b></label> |
194 | </div> | 194 | </div> |
195 | <div class="pull-left" style="margin-left: 15px;"> | 195 | <div class="pull-left" style="margin-left: 15px;"> |
196 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> | 196 | <input type="tel" ng-model="data.lastName" class="form-control" id="Address" placeholder=""> |
197 | </div> | 197 | </div> |
198 | <div class="clearfix"></div> | 198 | <div class="clearfix"></div> |
199 | </div> | 199 | </div> |
200 | </div> | 200 | </div> |
201 | <div class="clearfix"></div><br> | 201 | <div class="clearfix"></div><br> |
202 | <div class="col-xs-12"> | 202 | <div class="col-xs-12"> |
203 | <div class="col-md-6"> | 203 | <div class="col-md-6"> |
204 | <div class="pull-left" style="width: 110px;"> | 204 | <div class="pull-left" style="width: 110px;"> |
205 | <label class="new-input-label"><b>Title</b></label> | 205 | <label class="new-input-label"><b>Title</b></label> |
206 | </div> | 206 | </div> |
207 | <div class="pull-left" style="margin-left: 15px;"> | 207 | <div class="pull-left" style="margin-left: 15px;"> |
208 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> | 208 | <input type="tel" ng-model="data.title" class="form-control" id="Address" placeholder=""> |
209 | </div> | 209 | </div> |
210 | <div class="clearfix"></div> | 210 | <div class="clearfix"></div> |
211 | </div> | 211 | </div> |
212 | <div class="col-md-6"> | 212 | <div class="col-md-6"> |
213 | 213 | ||
214 | <div class="pull-left" style="width: 110px;"> | 214 | <div class="pull-left" style="width: 110px;"> |
215 | <label class="new-input-label"><b>Email</b></label> | 215 | <label class="new-input-label"><b>Email</b></label> |
216 | </div> | 216 | </div> |
217 | <div class="pull-left" style="margin-left: 15px;"> | 217 | <div class="pull-left" style="margin-left: 15px;"> |
218 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> | 218 | <input type="email" ng-model="data.email" class="form-control" id="Address" placeholder=""> |
219 | </div> | 219 | </div> |
220 | <div class="clearfix"></div> | 220 | <div class="clearfix"></div> |
221 | </div> | 221 | </div> |
222 | </div> | 222 | </div> |
223 | <div class="clearfix"></div><br> | 223 | <div class="clearfix"></div><br> |
224 | <div class="col-xs-12"> | 224 | <div class="col-xs-12"> |
225 | <div class="col-md-6"> | 225 | <div class="col-md-6"> |
226 | <div class="pull-left" style="width: 110px;"> | 226 | <div class="pull-left" style="width: 110px;"> |
227 | <label class="new-input-label"><b>Username</b></label> | 227 | <label class="new-input-label"><b>Username</b></label> |
228 | </div> | 228 | </div> |
229 | <div class="pull-left" style="margin-left: 15px;"> | 229 | <div class="pull-left" style="margin-left: 15px;"> |
230 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> | 230 | <input type="tel" ng-model="data.userName" class="form-control" id="Address" placeholder=""> |
231 | </div> | 231 | </div> |
232 | <div class="clearfix"></div> | 232 | <div class="clearfix"></div> |
233 | </div> | 233 | </div> |
234 | <div class="col-md-6"> | 234 | <div class="col-md-6"> |
235 | 235 | ||
236 | <div class="pull-left" style="width: 110px;"> | 236 | <div class="pull-left" style="width: 110px;"> |
237 | <label class="new-input-label"><b>Password</b></label> | 237 | <label class="new-input-label"><b>Password</b></label> |
238 | </div> | 238 | </div> |
239 | <div class="pull-left" style="margin-left: 15px;"> | 239 | <div class="pull-left" style="margin-left: 15px;"> |
240 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> | 240 | <input type="password" ng-model="data.password" class="form-control" id="Address" placeholder=""> |
241 | </div> | 241 | </div> |
242 | <div class="clearfix"></div> | 242 | <div class="clearfix"></div> |
243 | </div> | 243 | </div> |
244 | </div> | 244 | </div> |
245 | <div class="clearfix"></div><br> | 245 | <div class="clearfix"></div><br> |
246 | <div class="col-xs-12"> | 246 | <div class="col-xs-12"> |
247 | <div class="col-md-6"> | 247 | <div class="col-md-6"> |
248 | <div class="pull-left" style="width: 110px;"> | 248 | <div class="pull-left" style="width: 110px;"> |
249 | <label class="new-input-label"><b>Work Phone</b></label> | 249 | <label class="new-input-label"><b>Work Phone</b></label> |
250 | </div> | 250 | </div> |
251 | <div class="pull-left" style="margin-left: 15px;"> | 251 | <div class="pull-left" style="margin-left: 15px;"> |
252 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> | 252 | <input type="tel" ng-model="data.workPhone" class="form-control" id="Address" placeholder=""> |
253 | </div> | 253 | </div> |
254 | <div class="clearfix"></div> | 254 | <div class="clearfix"></div> |
255 | </div> | 255 | </div> |
256 | <div class="col-md-6"> | 256 | <div class="col-md-6"> |
257 | 257 | ||
258 | <div class="pull-left" style="width: 110px;"> | 258 | <div class="pull-left" style="width: 110px;"> |
259 | <label class="new-input-label"><b>Mobile Phone</b></label> | 259 | <label class="new-input-label"><b>Mobile Phone</b></label> |
260 | </div> | 260 | </div> |
261 | <div class="pull-left" style="margin-left: 15px;"> | 261 | <div class="pull-left" style="margin-left: 15px;"> |
262 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> | 262 | <input type="tel" ng-model="data.mobilePhone" class="form-control" id="Address" placeholder=""> |
263 | </div> | 263 | </div> |
264 | <div class="clearfix"></div> | 264 | <div class="clearfix"></div> |
265 | </div> | 265 | </div> |
266 | </div> | 266 | </div> |
267 | <div class="clearfix"></div><br> | 267 | <div class="clearfix"></div><br> |
268 | <div class="col-xs-12"> | 268 | <div class="col-xs-12"> |
269 | <div class="col-md-12"> | 269 | <div class="col-md-12"> |
270 | <div class="pull-left" style="width: 110px;"> | 270 | <div class="pull-left" style="width: 110px;"> |
271 | <label class="new-input-label"><b>Address</b></label> | 271 | <label class="new-input-label"><b>Address</b></label> |
272 | </div> | 272 | </div> |
273 | <div class="pull-right" style="width: calc(100% - 123px);"> | 273 | <div class="pull-right" style="width: calc(100% - 123px);"> |
274 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> | 274 | <input type="tel" class="form-control" ng-model="data.address" id="Address" placeholder=""> |
275 | </div> | 275 | </div> |
276 | <div class="clearfix"></div> | 276 | <div class="clearfix"></div> |
277 | </div> | 277 | </div> |
278 | </div> | 278 | </div> |
279 | <div class="clearfix"></div><br> | 279 | <div class="clearfix"></div><br> |
280 | <div class="col-xs-12"> | 280 | <div class="col-xs-12"> |
281 | <div class="col-md-12"> | 281 | <div class="col-md-12"> |
282 | <div class="pull-left" style="width: 110px;"> | 282 | <div class="pull-left" style="width: 110px;"> |
283 | <label class="new-input-label"><b>Company</b></label> | 283 | <label class="new-input-label"><b>Company</b></label> |
284 | </div> | 284 | </div> |
285 | <div class="pull-right" style="width: calc(100% - 123px);"> | 285 | <div class="pull-right" style="width: calc(100% - 123px);"> |
286 | <select class="form-control" ng-model="data.companyId"> | 286 | <select class="form-control" ng-model="data.companyId"> |
287 | <option value="{{company.id}}" ng-repeat="company in companies">{{company.companyName}}</option> | 287 | <option value="{{company.id}}" ng-repeat="company in companies">{{company.companyName}}</option> |
288 | </select> | 288 | </select> |
289 | </div> | 289 | </div> |
290 | <div class="clearfix"></div> | 290 | <div class="clearfix"></div> |
291 | </div> | 291 | </div> |
292 | </div> | 292 | </div> |
293 | 293 | ||
294 | 294 | ||
295 | <div class="clearfix"></div> | 295 | <div class="clearfix"></div> |
296 | <br/> | 296 | <br/> |
297 | <div class="col-xs-12"> | 297 | <div class="col-xs-12"> |
298 | <div class="col-md-3"> | 298 | <div class="col-md-3"> |
299 | <div class="pull-left my-toggle-switch"> | 299 | <div class="pull-left my-toggle-switch"> |
300 | <div style="color: #ff9a01;">Price Email     | 300 | <div style="color: #ff9a01;">Price Email     |
301 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> | 301 | <toggle ng-model="data.priceEmail" size="customToogle"></toggle> |
302 | </div> | 302 | </div> |
303 | </div> | 303 | </div> |
304 | <div class="clearfix"></div> | 304 | <div class="clearfix"></div> |
305 | </div> | 305 | </div> |
306 | <div class="col-md-3"> | 306 | <div class="col-md-3"> |
307 | <div class="pull-left my-toggle-switch"> | 307 | <div class="pull-left my-toggle-switch"> |
308 | <div style="color: #ff9a01;">Primary Contact     | 308 | <div style="color: #ff9a01;">Primary Contact     |
309 | <input type="checkbox" ng-model="data.primaryContact"> | 309 | <input type="checkbox" ng-model="data.primaryContact"> |
310 | </div> | 310 | </div> |
311 | </div> | 311 | </div> |
312 | <div class="clearfix"></div> | 312 | <div class="clearfix"></div> |
313 | </div> | 313 | </div> |
314 | <div class="col-md-6"> | 314 | <div class="col-md-6"> |
315 | <div class="pull-left" style="width: 110px;"> | 315 | <div class="pull-left" style="width: 110px;"> |
316 | <label class="new-input-label"><b>Internal Note</b></label> | 316 | <label class="new-input-label"><b>Internal Note</b></label> |
317 | </div> | 317 | </div> |
318 | <div class="pull-left" style="width: calc(100% - 110px);"> | 318 | <div class="pull-left" style="width: calc(100% - 110px);"> |
319 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> | 319 | <textarea name="message" ng-model="data.note" rows="4" cols="34"></textarea> |
320 | </div> | 320 | </div> |
321 | </div> | 321 | </div> |
322 | <div class="clearfix"></div> | 322 | <div class="clearfix"></div> |
323 | </div> | 323 | </div> |
324 | <div class="clearfix"></div><br> | 324 | <div class="clearfix"></div><br> |
325 | </div> | 325 | </div> |
326 | </div> | 326 | </div> |
327 | <div class="clearfix"></div> | 327 | <div class="clearfix"></div> |
328 | </div> | 328 | </div> |
329 | </div> | 329 | </div> |
330 | </div> | 330 | </div> |
331 | </div> | 331 | </div> |
332 | <div class="modal-footer" style="border-top: 0;"> | 332 | <div class="modal-footer" style="border-top: 0;"> |
333 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> | 333 | <button type="button" class="btn btn-default" ng-click="reset()" data-dismiss="modal">Cancel</button> |
334 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> | 334 | <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="addContact()">Save</button> |
335 | </div> | 335 | </div> |
336 | </div> | 336 | </div> |
337 | </div> | 337 | </div> |
338 | </form> | 338 | </form> |
339 | 339 | ||
340 | <div class="customConfirmPopBackdrop" id="toogleMail"> | 340 | <div class="customConfirmPopBackdrop" id="toogleMail"> |
341 | <div class="customModalInner" style="max-width: 400px;"> | 341 | <div class="customModalInner" style="max-width: 400px;"> |
342 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> | 342 | <div class="customModelBody" style="border-radius: 5px 5px 0 0;"> |
343 | <table> | 343 | <table> |
344 | <tr> | 344 | <tr> |
345 | <!-- <td> | 345 | <!-- <td> |
346 | <img src="" style="width: 50px;"> | 346 | <img src="" style="width: 50px;"> |
347 | </td> --> | 347 | </td> --> |
348 | <td> | 348 | <td> |
349 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> | 349 | <p style="padding: 5px 10px; margin-bottom: 0;text-align: center;">{{messageText}}</p> |
350 | </td> | 350 | </td> |
351 | </tr> | 351 | </tr> |
352 | </table> | 352 | </table> |
353 | </div> | 353 | </div> |
354 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> | 354 | <div class="customModelFooter text-right" style="border-radius: 0 0 5px 5px;"> |
355 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> | 355 | <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="cancelToogle()">Cancel</button> |
356 | </div> | 356 | </div> |
357 | </div> | 357 | </div> |
358 | </div> | 358 | </div> |
app/partials/ContactView/ContactView.service.js
1 | (function(){ | 1 | (function(){ |
2 | 'use strict'; | 2 | 'use strict'; |
3 | angular.module('acufuel') | 3 | angular.module('acufuel') |
4 | .service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); | 4 | .service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); |
5 | 5 | ||
6 | function ContactViewService($q, $http, BASE_URL) { | 6 | function ContactViewService($q, $http, BASE_URL) { |
7 | var temp = {}; | 7 | var temp = {}; |
8 | 8 | ||
9 | this.getContacts = function() { | 9 | this.getContacts = function() { |
10 | 10 | ||
11 | var deferred = $q.defer(); | 11 | var deferred = $q.defer(); |
12 | $http({ | 12 | $http({ |
13 | method : 'GET', | 13 | method : 'GET', |
14 | url : BASE_URL.url +'/user/allContacts', | 14 | url : BASE_URL.url +'/user/allContacts', |
15 | headers : {'Content-Type': 'application/json'}, | 15 | headers : {'Content-Type': 'application/json'}, |
16 | }) | 16 | }) |
17 | .then(function (result){ | 17 | .then(function (result){ |
18 | deferred.resolve(result.data); | 18 | deferred.resolve(result.data); |
19 | },function (result){ | 19 | },function (result){ |
20 | deferred.resolve(result.data); | 20 | deferred.resolve(result.data); |
21 | }) | 21 | }) |
22 | return deferred.promise; | 22 | return deferred.promise; |
23 | } | 23 | } |
24 | |||
25 | this.getSearchResults = function(param) { | ||
26 | |||
27 | var deferred = $q.defer(); | ||
28 | $http({ | ||
29 | method : 'GET', | ||
30 | url : BASE_URL.url +'/company/contact/search?param='+param, | ||
31 | headers : {'Content-Type': 'application/json'}, | ||
32 | }) | ||
33 | .then(function (result){ | ||
34 | deferred.resolve(result.data); | ||
35 | },function (result){ | ||
36 | deferred.resolve(result.data); | ||
37 | }) | ||
38 | return deferred.promise; | ||
39 | } | ||
24 | 40 | ||
25 | this.getCompanies = function() { | 41 | this.getCompanies = function() { |
26 | 42 | ||
27 | var deferred = $q.defer(); | 43 | var deferred = $q.defer(); |
28 | $http({ | 44 | $http({ |
29 | method : 'GET', | 45 | method : 'GET', |
30 | url : BASE_URL.url +'/user/allCompanies', | 46 | url : BASE_URL.url +'/user/allCompanies', |
31 | headers : {'Content-Type': 'application/json'}, | 47 | headers : {'Content-Type': 'application/json'}, |
32 | }) | 48 | }) |
33 | .then(function (result){ | 49 | .then(function (result){ |
34 | deferred.resolve(result.data); | 50 | deferred.resolve(result.data); |
35 | },function (result){ | 51 | },function (result){ |
36 | deferred.resolve(result.data); | 52 | deferred.resolve(result.data); |
37 | }) | 53 | }) |
38 | return deferred.promise; | 54 | return deferred.promise; |
39 | } | 55 | } |
40 | } | 56 | } |
41 | 57 | ||
42 | })(); | 58 | })(); |