| 15399 |
efrain |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
$routeAdd = $this->url('discovery-contacts/add');
|
|
|
9 |
$routeDatatable = $this->url('discovery-contacts');
|
| 15546 |
efrain |
10 |
$routeUpload = $this->url('discovery-contacts/upload');
|
| 15399 |
efrain |
11 |
|
|
|
12 |
|
|
|
13 |
$allowInteractionAdd = $acl->isAllowed($roleName, 'discovery-contacts/interactions/add') ? 1 : 0;
|
|
|
14 |
|
| 15546 |
efrain |
15 |
$allowAdd = $acl->isAllowed($roleName, 'discovery-contacts/add') ? 1 : 0;
|
|
|
16 |
$allowEdit = $acl->isAllowed($roleName, 'discovery-contacts/edit') ? 1 : 0;
|
|
|
17 |
$allowDelete = $acl->isAllowed($roleName, 'discovery-contacts/delete',) ? 1 : 0;
|
|
|
18 |
$allowView = $acl->isAllowed($roleName, 'discovery-contacts/view',) ? 1 : 0;
|
|
|
19 |
$allowUpload = $acl->isAllowed($roleName, 'discovery-contacts/upload') ? 1 : 0;
|
| 15399 |
efrain |
20 |
|
|
|
21 |
|
| 16822 |
efrain |
22 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
23 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
| 15399 |
efrain |
24 |
|
|
|
25 |
|
| 16864 |
efrain |
26 |
|
| 16929 |
efrain |
27 |
|
|
|
28 |
|
|
|
29 |
|
| 16822 |
efrain |
30 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
| 16864 |
efrain |
31 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
| 15399 |
efrain |
32 |
|
| 16822 |
efrain |
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
34 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
| 16864 |
efrain |
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
36 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
| 15399 |
efrain |
37 |
|
|
|
38 |
|
| 16864 |
efrain |
39 |
|
| 16822 |
efrain |
40 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 15399 |
efrain |
42 |
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
| 16822 |
efrain |
46 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/intl-tel-input/build/css/intlTelInput.css'));
|
|
|
47 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/intl-tel-input/build/js/intlTelInput-jquery.js'));
|
|
|
48 |
$utilsScript = $this->basePath('assets/vendors/intl-tel-input/build/js/utils.js');
|
| 15546 |
efrain |
49 |
|
| 16822 |
efrain |
50 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
|
| 15546 |
efrain |
51 |
|
| 16822 |
efrain |
52 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
53 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
| 15546 |
efrain |
54 |
|
| 16843 |
efrain |
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
56 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
| 16822 |
efrain |
57 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
58 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
59 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
|
|
|
60 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
|
|
|
61 |
|
|
|
62 |
|
| 15546 |
efrain |
63 |
$this->headStyle()->captureStart();
|
|
|
64 |
echo <<<CSS
|
|
|
65 |
|
|
|
66 |
#table-wrapper {
|
|
|
67 |
width: 100%;
|
|
|
68 |
height: 300px;
|
|
|
69 |
overflow: auto;
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
#table-wrapper table {
|
|
|
73 |
border-collapse: separate;
|
|
|
74 |
border-spacing: 0;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
#table-wrapper table thead {
|
|
|
78 |
flex: 0 0 auto;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
#table-wrapper table thead th,
|
|
|
82 |
#table-wrapper table tbody td {
|
|
|
83 |
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
/*
|
|
|
87 |
style=""
|
|
|
88 |
#gridTableUploadContacts {
|
|
|
89 |
display: flex;
|
|
|
90 |
flex-flow: column;
|
|
|
91 |
width: 100%;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
#gridTableUploadContacts thead {
|
|
|
95 |
flex: 0 0 auto;
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
#gridTableUploadContacts tbody {
|
|
|
99 |
flex: 1 1 auto;
|
|
|
100 |
display: block;
|
|
|
101 |
overflow-y: auto;
|
|
|
102 |
overflow-x: auto;
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
#gridTableUploadContacts tr {
|
|
|
106 |
width: 100%;
|
|
|
107 |
display: table;
|
|
|
108 |
table-layout: fixed;
|
|
|
109 |
*/
|
|
|
110 |
}
|
|
|
111 |
CSS;
|
|
|
112 |
$this->headStyle()->captureEnd();
|
|
|
113 |
|
| 15399 |
efrain |
114 |
$this->inlineScript()->captureStart();
|
|
|
115 |
echo <<<JS
|
|
|
116 |
jQuery( document ).ready(function( $ ) {
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
$.validator.addMethod("isIntlPhoneNumber", function(value, element) {
|
|
|
120 |
if(!value || value.length == '') {
|
|
|
121 |
return true;
|
|
|
122 |
} else {
|
|
|
123 |
return $(element).intlTelInput('isValidNumber');
|
|
|
124 |
}
|
|
|
125 |
}, 'ERROR_INTERNATIONAL_PHONE_FORMAT_IS_INVALID');
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
|
131 |
var allowEdit = $allowEdit;
|
|
|
132 |
var allowDelete = $allowDelete;
|
|
|
133 |
var allowView = $allowView;
|
|
|
134 |
|
|
|
135 |
var linkInteractions = '';
|
|
|
136 |
var linkInteractionsAdd = '';
|
|
|
137 |
var linkLogs = '';
|
|
|
138 |
|
|
|
139 |
var pageInteractions = 0;
|
|
|
140 |
var pageLogs = 0;
|
|
|
141 |
|
|
|
142 |
|
|
|
143 |
$.fn.loadLogs = function() {
|
|
|
144 |
NProgress.start();
|
|
|
145 |
var action = $(this).data('href');
|
|
|
146 |
|
|
|
147 |
$.ajax({
|
|
|
148 |
'dataType' : 'json',
|
|
|
149 |
'method' : 'get',
|
|
|
150 |
'url' : linkLogs,
|
|
|
151 |
'data' : {
|
|
|
152 |
'page' : pageLogs
|
|
|
153 |
}
|
|
|
154 |
}).done(function(response) {
|
|
|
155 |
if(response['success']) {
|
|
|
156 |
|
|
|
157 |
pagination = {
|
|
|
158 |
has_previous_page : response['data']['current']['page'] > 1,
|
|
|
159 |
has_next_page : response['data']['current']['page'] < response['data']['total']['page'],
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
if(pageLogs > response['data']['total']['page']) {
|
|
|
164 |
pageLogs = response['data']['total']['page'];
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
$('#discovery-contacts-pagination-logs').empty();
|
|
|
168 |
$('#discovery-contacts-pagination-logs').append($('#logPaginationTemplate').render(pagination));
|
|
|
169 |
|
|
|
170 |
|
|
|
171 |
$('#grid-discovery-contacts-tabs-logs').empty();
|
|
|
172 |
$('#grid-discovery-contacts-tabs-logs').append(
|
|
|
173 |
$('#logTemplate').render(response['data']['current'])
|
|
|
174 |
);
|
|
|
175 |
|
|
|
176 |
|
|
|
177 |
|
|
|
178 |
} else {
|
|
|
179 |
$.fn.showError(response['data']);
|
|
|
180 |
}
|
|
|
181 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
182 |
$.fn.showError(textStatus);
|
|
|
183 |
}).always(function() {
|
|
|
184 |
NProgress.done();
|
|
|
185 |
});
|
|
|
186 |
|
|
|
187 |
};
|
|
|
188 |
|
|
|
189 |
$.fn.loadInteractions = function() {
|
|
|
190 |
NProgress.start();
|
|
|
191 |
|
|
|
192 |
$.ajax({
|
|
|
193 |
'dataType' : 'json',
|
|
|
194 |
'method' : 'get',
|
|
|
195 |
'url' : linkInteractions,
|
|
|
196 |
'data' : {
|
|
|
197 |
'page' : pageInteractions
|
|
|
198 |
}
|
|
|
199 |
}).done(function(response) {
|
|
|
200 |
if(response['success']) {
|
|
|
201 |
|
|
|
202 |
pagination = {
|
|
|
203 |
has_previous_page : response['data']['current']['page'] > 1,
|
|
|
204 |
has_next_page : response['data']['current']['page'] < response['data']['total']['page'],
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
if(pageInteractions > response['data']['total']['page']) {
|
|
|
208 |
pageInteractions = response['data']['total']['page'];
|
|
|
209 |
}
|
|
|
210 |
|
|
|
211 |
$('#discovery-contacts-pagination-interactions').empty();
|
|
|
212 |
$('#discovery-contacts-pagination-interactions').append($('#interactionPaginationTemplate').render(pagination));
|
|
|
213 |
|
|
|
214 |
|
|
|
215 |
$('#grid-discovery-contacts-tabs-interactions').empty();
|
|
|
216 |
$('#grid-discovery-contacts-tabs-interactions').append(
|
|
|
217 |
$('#interactionTemplate').render(response['data']['current'])
|
|
|
218 |
);
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
} else {
|
|
|
225 |
$.fn.showError(response['data']);
|
|
|
226 |
}
|
|
|
227 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
228 |
$.fn.showError(textStatus);
|
|
|
229 |
}).always(function() {
|
|
|
230 |
NProgress.done();
|
|
|
231 |
});
|
|
|
232 |
|
|
|
233 |
};
|
|
|
234 |
|
|
|
235 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
236 |
'processing': true,
|
|
|
237 |
'serverSide': true,
|
|
|
238 |
'searching': true,
|
|
|
239 |
'order': [[ 0, 'asc' ]],
|
|
|
240 |
'ordering': true,
|
|
|
241 |
'ordenable' : true,
|
|
|
242 |
'responsive': true,
|
|
|
243 |
'select' : false,
|
|
|
244 |
'paging': true,
|
|
|
245 |
'pagingType': 'simple_numbers',
|
|
|
246 |
'ajax': {
|
|
|
247 |
'url' : '$routeDatatable',
|
|
|
248 |
'type' : 'get',
|
|
|
249 |
'beforeSend': function (request) {
|
|
|
250 |
NProgress.start();
|
|
|
251 |
},
|
|
|
252 |
'dataFilter': function(response) {
|
|
|
253 |
var response = jQuery.parseJSON( response );
|
|
|
254 |
|
|
|
255 |
var json = {};
|
|
|
256 |
json.recordsTotal = 0;
|
|
|
257 |
json.recordsFiltered = 0;
|
|
|
258 |
json.data = [];
|
|
|
259 |
|
| 16477 |
anderson |
260 |
|
| 15399 |
efrain |
261 |
if(response.success) {
|
|
|
262 |
json.recordsTotal = response.data.total;
|
|
|
263 |
json.recordsFiltered = response.data.total;
|
|
|
264 |
json.data = response.data.items;
|
|
|
265 |
} else {
|
|
|
266 |
$.fn.showError(response.data)
|
|
|
267 |
}
|
|
|
268 |
|
|
|
269 |
return JSON.stringify( json );
|
|
|
270 |
}
|
|
|
271 |
},
|
|
|
272 |
'language' : {
|
|
|
273 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
274 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
275 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
276 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
277 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
278 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
279 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
280 |
'sInfoPostFix': '',
|
|
|
281 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
282 |
'sUrl': '',
|
|
|
283 |
'sInfoThousands': ',',
|
|
|
284 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
285 |
'oPaginate': {
|
|
|
286 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
287 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
288 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
289 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
290 |
},
|
|
|
291 |
'oAria': {
|
|
|
292 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
293 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
294 |
},
|
|
|
295 |
},
|
|
|
296 |
'drawCallback': function( settings ) {
|
|
|
297 |
NProgress.done();
|
| 16822 |
efrain |
298 |
|
| 15399 |
efrain |
299 |
},
|
|
|
300 |
'aoColumns': [
|
|
|
301 |
{ 'mDataProp': 'corporate_email' },
|
| 15624 |
anderson |
302 |
{ 'mDataProp': 'company' },
|
| 15626 |
anderson |
303 |
{ 'mDataProp': 'country' },
|
| 15627 |
anderson |
304 |
{ 'mDataProp': 'sector' },
|
| 16766 |
efrain |
305 |
{ 'mDataProp': 'scholarship' },
|
| 15399 |
efrain |
306 |
{ 'mDataProp': 'actions' },
|
|
|
307 |
],
|
|
|
308 |
'columnDefs': [
|
|
|
309 |
{
|
|
|
310 |
'targets': -1,
|
|
|
311 |
'orderable': false,
|
|
|
312 |
'render' : function ( data, type, row ) {
|
|
|
313 |
s = '';
|
|
|
314 |
|
|
|
315 |
if(allowEdit && data['link_edit']) {
|
| 16906 |
efrain |
316 |
s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button> ';
|
| 15399 |
efrain |
317 |
}
|
|
|
318 |
if(allowDelete && data['link_delete']) {
|
|
|
319 |
s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';
|
|
|
320 |
}
|
|
|
321 |
if(allowView && data['link_view']) {
|
| 16932 |
efrain |
322 |
s = s + '<button class="btn btn-secondary btn-view" data-href="' + data['link_view']+ '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link-alt"></i> LABEL_VIEW </button> ';
|
| 15399 |
efrain |
323 |
}
|
|
|
324 |
return s;
|
|
|
325 |
}
|
|
|
326 |
}
|
|
|
327 |
],
|
|
|
328 |
});
|
|
|
329 |
|
|
|
330 |
|
|
|
331 |
|
|
|
332 |
|
|
|
333 |
var validator = $('#form').validate({
|
|
|
334 |
debug: true,
|
|
|
335 |
onclick: false,
|
|
|
336 |
onkeyup: false,
|
|
|
337 |
ignore: [],
|
|
|
338 |
rules: {
|
|
|
339 |
'first_name': {
|
| 16766 |
efrain |
340 |
required: false,
|
| 15399 |
efrain |
341 |
maxlength: 128,
|
|
|
342 |
},
|
|
|
343 |
'last_name': {
|
| 16766 |
efrain |
344 |
required: false,
|
| 15399 |
efrain |
345 |
maxlength: 128,
|
|
|
346 |
},
|
|
|
347 |
'corporate_email': {
|
|
|
348 |
required: true,
|
|
|
349 |
maxlength: 250,
|
|
|
350 |
email: true,
|
|
|
351 |
|
|
|
352 |
},
|
|
|
353 |
'company': {
|
|
|
354 |
required: true,
|
|
|
355 |
maxlength: 128,
|
|
|
356 |
},
|
|
|
357 |
'position': {
|
|
|
358 |
required: true,
|
|
|
359 |
maxlength: 128,
|
|
|
360 |
},
|
|
|
361 |
'country': {
|
|
|
362 |
required: true,
|
|
|
363 |
maxlength: 128,
|
|
|
364 |
},
|
|
|
365 |
'state': {
|
|
|
366 |
required: false,
|
|
|
367 |
maxlength: 128,
|
|
|
368 |
},
|
|
|
369 |
'city': {
|
|
|
370 |
required: false,
|
|
|
371 |
maxlength: 128,
|
|
|
372 |
},
|
|
|
373 |
'personal_email': {
|
|
|
374 |
required: false,
|
|
|
375 |
maxlength: 128,
|
|
|
376 |
email: true,
|
|
|
377 |
},
|
|
|
378 |
'phone': {
|
|
|
379 |
required: false,
|
|
|
380 |
maxlength: 25,
|
|
|
381 |
isIntlPhoneNumber: true,
|
|
|
382 |
},
|
|
|
383 |
'phone_extension': {
|
|
|
384 |
required: false,
|
|
|
385 |
maxlength: 5,
|
|
|
386 |
},
|
|
|
387 |
'celular': {
|
|
|
388 |
required: false,
|
|
|
389 |
maxlength: 25,
|
|
|
390 |
isIntlPhoneNumber: true,
|
|
|
391 |
},
|
|
|
392 |
'whatsapp': {
|
|
|
393 |
required: false,
|
|
|
394 |
maxlength: 25,
|
|
|
395 |
isIntlPhoneNumber: true,
|
|
|
396 |
},
|
|
|
397 |
'linkedin': {
|
|
|
398 |
required: false,
|
| 15831 |
efrain |
399 |
maxlength: 250,
|
| 15399 |
efrain |
400 |
url: true,
|
|
|
401 |
},
|
| 15831 |
efrain |
402 |
'sector': {
|
|
|
403 |
required: false,
|
|
|
404 |
maxlength: 250,
|
|
|
405 |
},
|
| 16766 |
efrain |
406 |
'scholarship': {
|
|
|
407 |
required: false,
|
|
|
408 |
},
|
| 15399 |
efrain |
409 |
},
|
|
|
410 |
submitHandler: function(form)
|
|
|
411 |
{
|
|
|
412 |
data = {
|
|
|
413 |
first_name : $('#form #first_name').val(),
|
|
|
414 |
last_name : $('#form #last_name').val(),
|
|
|
415 |
corporate_email : $('#form #corporate_email').val(),
|
|
|
416 |
company : $('#form #company').val(),
|
|
|
417 |
position : $('#form #position').val(),
|
|
|
418 |
country : $('#form #country').val(),
|
|
|
419 |
state : $('#form #state').val(),
|
|
|
420 |
city : $('#form #city').val(),
|
|
|
421 |
personal_email : $('#form #personal_email').val(),
|
|
|
422 |
phone : $('#form #phone').intlTelInput('getNumber'),
|
|
|
423 |
phone_extension : $('#form #phone_extension').val(),
|
|
|
424 |
celular : $('#form #celular').intlTelInput('getNumber'),
|
|
|
425 |
whatsapp : $('#form #whatsapp').intlTelInput('getNumber'),
|
|
|
426 |
linkedin : $('#form #linkedin').val(),
|
| 15831 |
efrain |
427 |
sector : $('#form #sector').val(),
|
| 16766 |
efrain |
428 |
scholarship: $('#form #scholarship').val(),
|
| 15399 |
efrain |
429 |
};
|
|
|
430 |
|
|
|
431 |
$('#modal .btn-primary').attr('disabled', true)
|
|
|
432 |
$.ajax({
|
|
|
433 |
'dataType' : 'json',
|
|
|
434 |
'accept' : 'application/json',
|
|
|
435 |
'method' : 'post',
|
|
|
436 |
'url' : $('#form').attr('action'),
|
|
|
437 |
'data' : data
|
|
|
438 |
}).done(function(response) {
|
|
|
439 |
NProgress.start();
|
|
|
440 |
if(response['success']) {
|
|
|
441 |
$.fn.showSuccess(response['data']);
|
|
|
442 |
|
|
|
443 |
$('#form-row').hide();
|
|
|
444 |
$('#listing-row').show();
|
|
|
445 |
|
|
|
446 |
|
|
|
447 |
|
|
|
448 |
gridTable.api().ajax.reload(null, false);
|
|
|
449 |
} else {
|
|
|
450 |
validator.resetForm();
|
|
|
451 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
452 |
$.fn.showError(response['data']);
|
|
|
453 |
} else {
|
|
|
454 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
455 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
456 |
});
|
|
|
457 |
}
|
|
|
458 |
}
|
|
|
459 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
460 |
$.fn.showError(textStatus);
|
|
|
461 |
}).always(function() {
|
|
|
462 |
NProgress.done();
|
|
|
463 |
$('#modal .btn-primary').removeAttr('disabled')
|
|
|
464 |
});
|
|
|
465 |
return false;
|
|
|
466 |
},
|
|
|
467 |
invalidHandler: function(form, validator) {
|
|
|
468 |
|
|
|
469 |
}
|
|
|
470 |
});
|
|
|
471 |
|
|
|
472 |
var validatorInteraction = $('#form-interaction').validate({
|
|
|
473 |
debug: true,
|
|
|
474 |
onclick: false,
|
|
|
475 |
onkeyup: false,
|
|
|
476 |
ignore: [],
|
|
|
477 |
rules: {
|
|
|
478 |
'notes': {
|
|
|
479 |
required: true,
|
|
|
480 |
},
|
|
|
481 |
'interaction_type_id': {
|
|
|
482 |
required: true,
|
|
|
483 |
|
|
|
484 |
},
|
|
|
485 |
},
|
|
|
486 |
submitHandler: function(form)
|
|
|
487 |
{
|
|
|
488 |
|
|
|
489 |
$.ajax({
|
|
|
490 |
'dataType' : 'json',
|
|
|
491 |
'accept' : 'application/json',
|
|
|
492 |
'method' : 'post',
|
|
|
493 |
'url' : $('#form-interaction').attr('action'),
|
|
|
494 |
'data' : $('#form-interaction').serialize()
|
|
|
495 |
}).done(function(response) {
|
|
|
496 |
NProgress.start();
|
|
|
497 |
if(response['success']) {
|
|
|
498 |
$.fn.showSuccess(response['data']);
|
|
|
499 |
|
|
|
500 |
$('#modal-interaction').modal('hide');
|
|
|
501 |
|
|
|
502 |
|
|
|
503 |
$.fn.loadInteractions();
|
|
|
504 |
$.fn.loadLogs();
|
|
|
505 |
} else {
|
|
|
506 |
validator.resetForm();
|
|
|
507 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
508 |
$.fn.showError(response['data']);
|
|
|
509 |
} else {
|
|
|
510 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
511 |
$.fn.showFormErrorValidator('#form-interaction #' + fieldname, errors);
|
|
|
512 |
});
|
|
|
513 |
}
|
|
|
514 |
}
|
|
|
515 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
516 |
$.fn.showError(textStatus);
|
|
|
517 |
}).always(function() {
|
|
|
518 |
NProgress.done();
|
|
|
519 |
|
|
|
520 |
});
|
|
|
521 |
return false;
|
|
|
522 |
},
|
|
|
523 |
invalidHandler: function(form, validator) {
|
|
|
524 |
|
|
|
525 |
}
|
|
|
526 |
});
|
|
|
527 |
|
|
|
528 |
$('body').on('click', 'button.btn-add-interaction', function(e) {
|
|
|
529 |
e.preventDefault();
|
|
|
530 |
|
|
|
531 |
$('#form-interaction').attr('action', linkInteractionsAdd);
|
|
|
532 |
$('#form-interaction #notes').val('');
|
|
|
533 |
$('#form-interaction #status').val('');
|
|
|
534 |
|
|
|
535 |
validator.resetForm();
|
|
|
536 |
$('#modal-interaction').modal('show');
|
|
|
537 |
});
|
|
|
538 |
|
|
|
539 |
|
| 16972 |
efrain |
540 |
$('body').on('click', 'button.btn-cancel-upload', function(e) {
|
|
|
541 |
e.preventDefault();
|
|
|
542 |
$('#modal-upload').modal('hide');
|
|
|
543 |
$('#modal-upload-table').modal('hide');
|
|
|
544 |
});
|
|
|
545 |
|
| 15399 |
efrain |
546 |
$('body').on('click', 'button.btn-cancel-interaction', function(e) {
|
|
|
547 |
e.preventDefault();
|
|
|
548 |
$('#modal-interaction').modal('hide');
|
|
|
549 |
});
|
|
|
550 |
|
|
|
551 |
$('body').on('click', 'button.btn-delete-interaction', function(e) {
|
|
|
552 |
e.preventDefault();
|
|
|
553 |
var action = $(this).data('href');
|
|
|
554 |
NProgress.start();
|
|
|
555 |
$.ajax({
|
|
|
556 |
'dataType' : 'json',
|
|
|
557 |
'accept' : 'application/json',
|
|
|
558 |
'method' : 'post',
|
|
|
559 |
'url' : action,
|
|
|
560 |
}).done(function(response) {
|
|
|
561 |
if(response['success']) {
|
|
|
562 |
$.fn.showSuccess(response['data']);
|
|
|
563 |
|
|
|
564 |
$.fn.loadLogs();
|
|
|
565 |
$.fn.loadInteractions();
|
|
|
566 |
} else {
|
|
|
567 |
$.fn.showError(response['data']);
|
|
|
568 |
}
|
|
|
569 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
570 |
$.fn.showError(textStatus);
|
|
|
571 |
}).always(function() {
|
|
|
572 |
NProgress.done();
|
|
|
573 |
});
|
|
|
574 |
|
|
|
575 |
});
|
|
|
576 |
|
|
|
577 |
|
|
|
578 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
579 |
e.preventDefault();
|
|
|
580 |
|
| 16840 |
efrain |
581 |
|
| 15399 |
efrain |
582 |
$('#form').attr('action', '$routeAdd');
|
|
|
583 |
$('#form #first_name').val('');
|
|
|
584 |
$('#form #last_name').val('');
|
|
|
585 |
$('#form #corporate_email').val('');
|
|
|
586 |
$('#form #company').val('');
|
|
|
587 |
$('#form #position').val('');
|
|
|
588 |
$('#form #country').val('');
|
|
|
589 |
$('#form #state').val('');
|
|
|
590 |
$('#form #city').val('');
|
|
|
591 |
$('#form #personal_email').val('');
|
|
|
592 |
$('#form #phone').intlTelInput('setNumber', '');
|
|
|
593 |
$('#form #phone_extension').val('');
|
|
|
594 |
$('#form #celular').intlTelInput('setNumber', '');
|
|
|
595 |
$('#form #whatsapp').intlTelInput('setNumber', '');
|
|
|
596 |
$('#form #linkedin').val('');
|
| 15831 |
efrain |
597 |
$('#form #sector').val('');
|
| 16766 |
efrain |
598 |
$('#form #scholarship').val('');
|
| 15399 |
efrain |
599 |
|
|
|
600 |
validator.resetForm();
|
|
|
601 |
|
|
|
602 |
|
|
|
603 |
$('#listing-row').hide();
|
|
|
604 |
$('#form-row').show();
|
|
|
605 |
|
|
|
606 |
});
|
|
|
607 |
|
|
|
608 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
609 |
e.preventDefault();
|
|
|
610 |
NProgress.start();
|
|
|
611 |
var action = $(this).data('href');
|
|
|
612 |
|
|
|
613 |
$.ajax({
|
|
|
614 |
'dataType' : 'json',
|
|
|
615 |
'method' : 'get',
|
|
|
616 |
'url' : action,
|
|
|
617 |
}).done(function(response) {
|
|
|
618 |
if(response['success']) {
|
|
|
619 |
|
| 16840 |
efrain |
620 |
|
| 15399 |
efrain |
621 |
$('#form').attr('action', action);
|
|
|
622 |
$('#form #first_name').val(response['data']['first_name']);
|
|
|
623 |
$('#form #last_name').val(response['data']['last_name']);
|
|
|
624 |
$('#form #corporate_email').val(response['data']['corporate_email']);
|
|
|
625 |
$('#form #company').val(response['data']['company']);
|
|
|
626 |
$('#form #position').val(response['data']['position']);
|
|
|
627 |
$('#form #country').val(response['data']['country']);
|
|
|
628 |
$('#form #state').val(response['data']['state']);
|
|
|
629 |
$('#form #city').val(response['data']['city']);
|
|
|
630 |
$('#form #personal_email').val(response['data']['personal_email']);
|
|
|
631 |
$('#form #phone').intlTelInput('setNumber', response['data']['phone']);
|
|
|
632 |
$('#form #phone_extension').val(response['data']['phone_extension']);
|
|
|
633 |
$('#form #celular').intlTelInput('setNumber', response['data']['celular']);
|
|
|
634 |
$('#form #whatsapp').intlTelInput('setNumber', response['data']['whatsapp']);
|
|
|
635 |
$('#form #linkedin').val(response['data']['linkedin']);
|
| 15831 |
efrain |
636 |
$('#form #sector').val(response['data']['sector']);
|
| 16766 |
efrain |
637 |
$('#form #scholarship').val(response['data']['scholarship']);
|
| 15399 |
efrain |
638 |
|
| 16766 |
efrain |
639 |
|
| 15399 |
efrain |
640 |
validator.resetForm();
|
|
|
641 |
|
|
|
642 |
|
|
|
643 |
$('#listing-row').hide();
|
|
|
644 |
$('#form-row').show();
|
|
|
645 |
} else {
|
|
|
646 |
$.fn.showError(response['data']);
|
|
|
647 |
}
|
|
|
648 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
649 |
$.fn.showError(textStatus);
|
|
|
650 |
}).always(function() {
|
|
|
651 |
NProgress.done();
|
|
|
652 |
});
|
|
|
653 |
});
|
|
|
654 |
|
|
|
655 |
|
|
|
656 |
$('body').on('click', 'a.class-btn-log-previous', function(e) {
|
|
|
657 |
e.preventDefault();
|
|
|
658 |
|
|
|
659 |
if( pageLogs > 1) {
|
|
|
660 |
pageLogs = pageLogs - 1;
|
|
|
661 |
$.fn.loadLogs();
|
|
|
662 |
|
|
|
663 |
}
|
|
|
664 |
});
|
|
|
665 |
|
|
|
666 |
$('body').on('click', 'a.class-btn-log-next', function(e) {
|
|
|
667 |
e.preventDefault();
|
|
|
668 |
pageLogs = pageLogs + 1;
|
|
|
669 |
$.fn.loadLogs();
|
|
|
670 |
});
|
|
|
671 |
|
|
|
672 |
$('body').on('click', 'a.class-btn-interaction-previous', function(e) {
|
|
|
673 |
e.preventDefault();
|
|
|
674 |
|
|
|
675 |
if( pageInteractions > 1) {
|
|
|
676 |
pageInteractions = v - 1;
|
|
|
677 |
$.fn.loadInteractions();
|
|
|
678 |
|
|
|
679 |
}
|
|
|
680 |
});
|
|
|
681 |
|
|
|
682 |
$('body').on('click', 'a.class-btn-interaction-next', function(e) {
|
|
|
683 |
e.preventDefault();
|
|
|
684 |
pageInteractions = pageInteractions + 1;
|
|
|
685 |
$.fn.loadInteractions();
|
|
|
686 |
});
|
|
|
687 |
|
|
|
688 |
$('body').on('click', 'button.btn-view', function(e) {
|
|
|
689 |
e.preventDefault();
|
|
|
690 |
NProgress.start();
|
|
|
691 |
var action = $(this).data('href');
|
|
|
692 |
|
|
|
693 |
$.ajax({
|
|
|
694 |
'dataType' : 'json',
|
|
|
695 |
'method' : 'get',
|
|
|
696 |
'url' : action,
|
|
|
697 |
}).done(function(response) {
|
|
|
698 |
if(response['success']) {
|
|
|
699 |
|
|
|
700 |
|
|
|
701 |
$('#interactions-first_name').val(response['data']['first_name']);
|
|
|
702 |
$('#interactions-last_name').val(response['data']['last_name']);
|
|
|
703 |
$('#interactions-corporate_email').val(response['data']['corporate_email']);
|
|
|
704 |
$('#interactions-company').val(response['data']['company']);
|
|
|
705 |
$('#interactions-position').val(response['data']['position']);
|
|
|
706 |
$('#interactions-country').val(response['data']['country']);
|
|
|
707 |
$('#interactions-state').val(response['data']['state']);
|
|
|
708 |
$('#interactions-city').val(response['data']['city']);
|
|
|
709 |
$('#interactions-personal_email').val(response['data']['personal_email']);
|
|
|
710 |
$('#interactions-phone').val(response['data']['phone']);
|
|
|
711 |
$('#interactions-phone_extension').val(response['data']['phone_extension']);
|
|
|
712 |
$('#interactions-celular').val(response['data']['celular']);
|
|
|
713 |
$('#interactions-whatsapp').val(response['data']['whatsapp']);
|
|
|
714 |
$('#interactions-linkedin').val(response['data']['linkedin']);
|
| 15831 |
efrain |
715 |
$('#interactions-sector').val(response['data']['sector']);
|
| 16766 |
efrain |
716 |
$('#interactions-scholarship').val(response['data']['scholarship']);
|
| 15399 |
efrain |
717 |
|
| 16766 |
efrain |
718 |
|
|
|
719 |
|
| 15399 |
efrain |
720 |
linkInteractions = response['data']['link_interactions'];
|
|
|
721 |
linkInteractionsAdd = response['data']['link_interactions_add'];
|
|
|
722 |
linkLogs = response['data']['link_logs'];
|
|
|
723 |
|
|
|
724 |
pageInteractions = 0;
|
|
|
725 |
pageLogs = 0;
|
|
|
726 |
|
|
|
727 |
|
|
|
728 |
|
|
|
729 |
|
|
|
730 |
$.fn.loadLogs();
|
|
|
731 |
$.fn.loadInteractions();
|
|
|
732 |
|
|
|
733 |
|
|
|
734 |
|
|
|
735 |
$('#listing-row').hide();
|
|
|
736 |
$('#interactions-row').show();
|
|
|
737 |
} else {
|
|
|
738 |
$.fn.showError(response['data']);
|
|
|
739 |
}
|
|
|
740 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
741 |
$.fn.showError(textStatus);
|
|
|
742 |
}).always(function() {
|
|
|
743 |
NProgress.done();
|
|
|
744 |
});
|
|
|
745 |
});
|
|
|
746 |
|
|
|
747 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
748 |
e.preventDefault();
|
|
|
749 |
gridTable.api().ajax.reload(null, false);
|
|
|
750 |
});
|
|
|
751 |
|
|
|
752 |
|
|
|
753 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
754 |
|
|
|
755 |
|
|
|
756 |
e.preventDefault();
|
|
|
757 |
$('#form-row').hide();
|
|
|
758 |
$('#listing-row').show();
|
|
|
759 |
});
|
|
|
760 |
|
|
|
761 |
$('body').on('click', 'button.btn-close-view', function(e) {
|
|
|
762 |
|
|
|
763 |
|
|
|
764 |
e.preventDefault();
|
|
|
765 |
$('#interactions-row').hide();
|
|
|
766 |
$('#listing-row').show();
|
|
|
767 |
});
|
|
|
768 |
|
| 16822 |
efrain |
769 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
770 |
e.preventDefault();
|
|
|
771 |
var action = $(this).data('href');
|
| 15399 |
efrain |
772 |
|
| 16822 |
efrain |
773 |
|
|
|
774 |
swal.fire({
|
|
|
775 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
776 |
icon: 'question',
|
|
|
777 |
cancelButtonText: 'LABEL_NO',
|
|
|
778 |
showCancelButton: true,
|
|
|
779 |
confirmButtonText: 'LABEL_YES'
|
|
|
780 |
}).then((result) => {
|
|
|
781 |
if (result.isConfirmed) {
|
|
|
782 |
|
|
|
783 |
NProgress.start();
|
|
|
784 |
$.ajax({
|
|
|
785 |
'dataType' : 'json',
|
|
|
786 |
'accept' : 'application/json',
|
|
|
787 |
'method' : 'post',
|
|
|
788 |
'url' : action,
|
|
|
789 |
}).done(function(response) {
|
|
|
790 |
if(response['success']) {
|
|
|
791 |
$.fn.showSuccess(response['data']);
|
|
|
792 |
gridTable.api().ajax.reload(null, false);
|
|
|
793 |
} else {
|
|
|
794 |
$.fn.showError(response['data']);
|
|
|
795 |
}
|
|
|
796 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
797 |
$.fn.showError(textStatus);
|
|
|
798 |
}).always(function() {
|
|
|
799 |
NProgress.done();
|
|
|
800 |
});
|
|
|
801 |
}
|
|
|
802 |
});
|
|
|
803 |
});
|
|
|
804 |
|
| 15399 |
efrain |
805 |
|
|
|
806 |
$('#form #phone').intlTelInput({
|
|
|
807 |
utilsScript: "$utilsScript",
|
|
|
808 |
formatOnDisplay: true,
|
|
|
809 |
separateDialCode: false,
|
|
|
810 |
});
|
|
|
811 |
|
|
|
812 |
|
|
|
813 |
|
|
|
814 |
$('#form #celular').intlTelInput({
|
|
|
815 |
utilsScript: "$utilsScript",
|
|
|
816 |
formatOnDisplay: true,
|
|
|
817 |
separateDialCode: false,
|
|
|
818 |
});
|
|
|
819 |
|
|
|
820 |
$('#form #whatsapp').intlTelInput({
|
|
|
821 |
utilsScript: "$utilsScript",
|
|
|
822 |
formatOnDisplay: true,
|
|
|
823 |
separateDialCode: false,
|
|
|
824 |
});
|
|
|
825 |
|
| 15546 |
efrain |
826 |
var validatorContactUpload = $('#form-contact-upload').validate({
|
|
|
827 |
debug: true,
|
|
|
828 |
onclick: false,
|
|
|
829 |
onkeyup: false,
|
|
|
830 |
onfocusout: false,
|
|
|
831 |
ignore: [],
|
|
|
832 |
rules: {
|
|
|
833 |
'file' : {
|
|
|
834 |
required: true,
|
|
|
835 |
extension: 'xls|xlsx',
|
|
|
836 |
accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'
|
|
|
837 |
},
|
|
|
838 |
},
|
|
|
839 |
|
|
|
840 |
submitHandler: function(form)
|
|
|
841 |
{
|
|
|
842 |
NProgress.start();
|
|
|
843 |
var formdata = false;
|
|
|
844 |
if (window.FormData){
|
|
|
845 |
formdata = new FormData(form);
|
|
|
846 |
}
|
|
|
847 |
formdata.append('step','validation');
|
|
|
848 |
|
|
|
849 |
|
|
|
850 |
$.ajax({
|
|
|
851 |
'dataType' : 'json',
|
|
|
852 |
'accept' : 'application/json',
|
|
|
853 |
'method' : 'post',
|
|
|
854 |
'url' : '$routeUpload',
|
|
|
855 |
'data' : formdata,
|
|
|
856 |
'processData': false,
|
|
|
857 |
'contentType': false,
|
|
|
858 |
}).done(function(response) {
|
|
|
859 |
if(response['success']) {
|
|
|
860 |
|
|
|
861 |
$('#table-upload-contacts-key').val(response['data']['key']);
|
|
|
862 |
$('#table-upload-contacts-topic').val(response['data']['topic']);
|
|
|
863 |
$('#table-upload-contacts-capsule').val(response['data']['capsule']);
|
|
|
864 |
|
|
|
865 |
$('#gridTableUploadContacts tbody').html($('#uploadContactTemplate').render(response['data']))
|
|
|
866 |
|
| 16972 |
efrain |
867 |
$('#modal-upload').modal('hide');
|
|
|
868 |
$('#modal-upload-table').modal('show');
|
| 15546 |
efrain |
869 |
|
|
|
870 |
|
|
|
871 |
|
|
|
872 |
} else {
|
|
|
873 |
validatorContactUpload.resetForm();
|
|
|
874 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
875 |
$.fn.showError(response['data']);
|
|
|
876 |
} else {
|
|
|
877 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
878 |
$.fn.showFormErrorValidator('#form-contact-upload #' + fieldname, errors);
|
|
|
879 |
});
|
|
|
880 |
}
|
|
|
881 |
}
|
|
|
882 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
883 |
$.fn.showError(textStatus);
|
|
|
884 |
}).always(function() {
|
|
|
885 |
|
|
|
886 |
NProgress.done();
|
|
|
887 |
});
|
|
|
888 |
return false;
|
|
|
889 |
},
|
|
|
890 |
invalidHandler: function(form, validator) {
|
|
|
891 |
|
|
|
892 |
}
|
| 15399 |
efrain |
893 |
});
|
| 15546 |
efrain |
894 |
|
|
|
895 |
|
|
|
896 |
$('body').on('click', 'button.btn-upload', function(e) {
|
|
|
897 |
e.preventDefault();
|
|
|
898 |
|
|
|
899 |
$('#form-contact-upload #file').fileinput('reset');
|
|
|
900 |
$('#form-contact-upload #file').val('');
|
|
|
901 |
|
| 16972 |
efrain |
902 |
$('#modal-upload').modal('show');
|
| 15546 |
efrain |
903 |
});
|
|
|
904 |
|
|
|
905 |
|
|
|
906 |
$('#form-contact-upload #file').fileinput({
|
|
|
907 |
theme: 'fa',
|
|
|
908 |
language: 'es',
|
|
|
909 |
showUpload: false,
|
|
|
910 |
dropZoneEnabled: false,
|
|
|
911 |
maxFileCount: 1,
|
|
|
912 |
allowedFileExtensions: ['xls', 'xlsx'],
|
|
|
913 |
});
|
|
|
914 |
|
|
|
915 |
$('body').on('click', 'button.btn-upload', function(e) {
|
|
|
916 |
e.preventDefault();
|
|
|
917 |
|
|
|
918 |
$('#form-contact-upload #file').fileinput('reset');
|
|
|
919 |
$('#form-contact-upload #file').val('');
|
|
|
920 |
|
| 16972 |
efrain |
921 |
$('#modal-upload').modal('show');
|
| 15546 |
efrain |
922 |
});
|
|
|
923 |
|
|
|
924 |
$('body').on('click', 'button.btn-upload-contacts-step2', function(e) {
|
|
|
925 |
e.preventDefault();
|
|
|
926 |
NProgress.start();
|
|
|
927 |
|
|
|
928 |
$.ajax({
|
|
|
929 |
'dataType' : 'json',
|
|
|
930 |
'accept' : 'application/json',
|
|
|
931 |
'method' : 'post',
|
|
|
932 |
'url' : '$routeUpload',
|
|
|
933 |
'data' : {
|
|
|
934 |
'step' : 'process',
|
|
|
935 |
'key' : $('#table-upload-contacts-key').val(),
|
|
|
936 |
}
|
|
|
937 |
}).done(function(response) {
|
|
|
938 |
if(response['success']) {
|
|
|
939 |
|
|
|
940 |
var s = response['data']['new_contacts'] + ' LABEL_NEW_CONTACTS <br>' +
|
|
|
941 |
response['data']['error_contacts'] + ' LABEL_ERROR_CONTACTS <br>' +
|
|
|
942 |
response['data']['duplicate_contacts'] + ' LABEL_DUPLICATE_CONTACTS <br>';
|
|
|
943 |
|
|
|
944 |
|
| 16971 |
efrain |
945 |
var anchor = window.document.createElement("a");
|
|
|
946 |
anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['csv_base64_content'] ;
|
|
|
947 |
anchor.download = response['data']['csv_filename'];
|
|
|
948 |
document.body.appendChild(anchor);
|
|
|
949 |
anchor.click(); // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
|
|
|
950 |
document.body.removeChild(anchor);
|
| 15546 |
efrain |
951 |
|
| 16971 |
efrain |
952 |
|
| 15546 |
efrain |
953 |
$.fn.showSuccess(s);
|
|
|
954 |
|
|
|
955 |
gridTable.api().ajax.reload(null, false);
|
| 16972 |
efrain |
956 |
$('#modal-upload-table').modal('hide');
|
| 15546 |
efrain |
957 |
} else {
|
|
|
958 |
$.fn.showError(response['data']);
|
|
|
959 |
}
|
|
|
960 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
961 |
$.fn.showError(textStatus);
|
|
|
962 |
}).always(function() {
|
|
|
963 |
NProgress.done();
|
|
|
964 |
});
|
|
|
965 |
return false;
|
|
|
966 |
});
|
|
|
967 |
|
|
|
968 |
|
|
|
969 |
});
|
| 15399 |
efrain |
970 |
JS;
|
|
|
971 |
$this->inlineScript()->captureEnd();
|
|
|
972 |
?>
|
|
|
973 |
|
| 16864 |
efrain |
974 |
<div class="container">
|
|
|
975 |
<div class="card" id="listing-row">
|
|
|
976 |
<div class="card-header">
|
|
|
977 |
<h6 class="card-title">LABEL_CONTACTS</h6>
|
|
|
978 |
</div>
|
|
|
979 |
<div class="card-body">
|
|
|
980 |
<div class="row">
|
|
|
981 |
<div class="col-12 mt-3">
|
|
|
982 |
|
| 16912 |
efrain |
983 |
<table id="gridTable" class="table table-bordered">
|
| 15399 |
efrain |
984 |
<thead>
|
|
|
985 |
<tr>
|
|
|
986 |
<th>LABEL_CORPORATE_EMAIL</th>
|
| 15625 |
anderson |
987 |
<th>LABEL_COMPANY</th>
|
| 15626 |
anderson |
988 |
<th>LABEL_COUNTRY</th>
|
| 15627 |
anderson |
989 |
<th>LABEL_SECTOR</th>
|
| 16766 |
efrain |
990 |
<th>LABEL_SCHOLARSHIP</th>
|
| 15399 |
efrain |
991 |
<th>LABEL_ACTIONS</th>
|
|
|
992 |
</tr>
|
|
|
993 |
</thead>
|
|
|
994 |
<tbody>
|
|
|
995 |
</tbody>
|
|
|
996 |
</table>
|
| 16864 |
efrain |
997 |
|
|
|
998 |
</div>
|
|
|
999 |
</div>
|
|
|
1000 |
</div>
|
|
|
1001 |
<div class="card-footer text-right">
|
| 16992 |
efrain |
1002 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
| 16864 |
efrain |
1003 |
<?php if ($allowUpload) : ?>
|
|
|
1004 |
<button type="button" class="btn btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button>
|
|
|
1005 |
<?php endif; ?>
|
|
|
1006 |
<?php if ($allowAdd) : ?>
|
|
|
1007 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
1008 |
<?php endif; ?>
|
|
|
1009 |
</div>
|
|
|
1010 |
</div>
|
|
|
1011 |
|
|
|
1012 |
<div class="card" id="form-row" style="display: none">
|
|
|
1013 |
<div class="card-header">
|
|
|
1014 |
<h6 class="card-title">LABEL_CONTACT</h6>
|
|
|
1015 |
</div>
|
|
|
1016 |
|
|
|
1017 |
<?php
|
|
|
1018 |
$form = $this->form;
|
|
|
1019 |
$form->setAttributes([
|
|
|
1020 |
'method' => 'post',
|
|
|
1021 |
'action' => $routeAdd,
|
|
|
1022 |
'name' => 'form',
|
|
|
1023 |
'id' => 'form',
|
|
|
1024 |
]);
|
|
|
1025 |
$form->prepare();
|
|
|
1026 |
echo $this->form()->openTag($form);
|
|
|
1027 |
?>
|
|
|
1028 |
<div class="card-body">
|
|
|
1029 |
<div class="row">
|
|
|
1030 |
<div class="col-6 mt-3">
|
|
|
1031 |
<?php
|
|
|
1032 |
$label = 'LABEL_FIRST_NAME';
|
|
|
1033 |
$field = 'first_name';
|
| 15399 |
efrain |
1034 |
|
| 16864 |
efrain |
1035 |
$element = $form->get($field);
|
|
|
1036 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1037 |
$element->setOptions(['label' => $label]);
|
|
|
1038 |
echo $this->formLabel($element);
|
|
|
1039 |
echo $this->formText($element);
|
|
|
1040 |
?>
|
|
|
1041 |
</div>
|
|
|
1042 |
<div class="col-6 mt-3">
|
|
|
1043 |
<?php
|
|
|
1044 |
$label = 'LABEL_LAST_NAME';
|
|
|
1045 |
$field = 'last_name';
|
| 15399 |
efrain |
1046 |
|
| 16864 |
efrain |
1047 |
$element = $form->get($field);
|
|
|
1048 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1049 |
$element->setOptions(['label' => $label]);
|
|
|
1050 |
echo $this->formLabel($element);
|
|
|
1051 |
echo $this->formText($element);
|
|
|
1052 |
?>
|
|
|
1053 |
</div>
|
|
|
1054 |
</div>
|
|
|
1055 |
<div class="row">
|
|
|
1056 |
<div class="col-6 mt-3">
|
|
|
1057 |
<?php
|
|
|
1058 |
$label = 'LABEL_CORPORATE_EMAIL';
|
|
|
1059 |
$field = 'corporate_email';
|
| 15532 |
stevensc |
1060 |
|
| 16864 |
efrain |
1061 |
$element = $form->get($field);
|
|
|
1062 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1063 |
$element->setOptions(['label' => $label]);
|
|
|
1064 |
echo $this->formLabel($element);
|
|
|
1065 |
echo $this->formText($element);
|
|
|
1066 |
?>
|
|
|
1067 |
</div>
|
|
|
1068 |
<div class="col-6 mt-3">
|
|
|
1069 |
<?php
|
|
|
1070 |
$label = 'LABEL_COMPANY';
|
|
|
1071 |
$field = 'company';
|
| 15532 |
stevensc |
1072 |
|
| 16864 |
efrain |
1073 |
$element = $form->get($field);
|
|
|
1074 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1075 |
$element->setOptions(['label' => $label]);
|
|
|
1076 |
echo $this->formLabel($element);
|
|
|
1077 |
echo $this->formText($element);
|
|
|
1078 |
?>
|
|
|
1079 |
</div>
|
|
|
1080 |
</div>
|
|
|
1081 |
<div class="row">
|
|
|
1082 |
<div class="col-6 mt-3">
|
|
|
1083 |
<?php
|
|
|
1084 |
$label = 'LABEL_POSITION';
|
|
|
1085 |
$field = 'position';
|
| 15532 |
stevensc |
1086 |
|
|
|
1087 |
|
| 16864 |
efrain |
1088 |
$element = $form->get($field);
|
|
|
1089 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1090 |
$element->setOptions(['label' => $label]);
|
|
|
1091 |
echo $this->formLabel($element);
|
|
|
1092 |
echo $this->formText($element);
|
|
|
1093 |
?>
|
|
|
1094 |
</div>
|
|
|
1095 |
<div class="col-6 mt-3">
|
|
|
1096 |
<?php
|
|
|
1097 |
$label = 'LABEL_SECTOR';
|
|
|
1098 |
$field = 'sector';
|
| 15532 |
stevensc |
1099 |
|
| 16864 |
efrain |
1100 |
$element = $form->get($field);
|
|
|
1101 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1102 |
$element->setOptions(['label' => $label]);
|
|
|
1103 |
echo $this->formLabel($element);
|
|
|
1104 |
echo '<br>';
|
|
|
1105 |
echo $this->formText($element);
|
|
|
1106 |
?>
|
|
|
1107 |
</div>
|
|
|
1108 |
</div>
|
|
|
1109 |
<div class="row">
|
| 16930 |
efrain |
1110 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1111 |
<?php
|
|
|
1112 |
$label = 'LABEL_COUNTRY';
|
|
|
1113 |
$field = 'country';
|
|
|
1114 |
$element = $form->get($field);
|
|
|
1115 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1116 |
$element->setOptions(['label' => $label]);
|
|
|
1117 |
echo $this->formLabel($element);
|
|
|
1118 |
echo $this->formText($element);
|
|
|
1119 |
?>
|
|
|
1120 |
</div>
|
| 16930 |
efrain |
1121 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1122 |
<?php
|
|
|
1123 |
$label = 'LABEL_STATE';
|
|
|
1124 |
$field = 'state';
|
| 15532 |
stevensc |
1125 |
|
|
|
1126 |
|
| 16864 |
efrain |
1127 |
$element = $form->get($field);
|
|
|
1128 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1129 |
$element->setOptions(['label' => $label]);
|
|
|
1130 |
echo $this->formLabel($element);
|
|
|
1131 |
echo $this->formText($element);
|
|
|
1132 |
?>
|
|
|
1133 |
</div>
|
|
|
1134 |
</div>
|
|
|
1135 |
<div class="row">
|
| 16930 |
efrain |
1136 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1137 |
<?php
|
|
|
1138 |
$label = 'LABEL_CITY';
|
|
|
1139 |
$field = 'city';
|
| 15831 |
efrain |
1140 |
|
| 16864 |
efrain |
1141 |
$element = $form->get($field);
|
|
|
1142 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1143 |
$element->setOptions(['label' => $label]);
|
|
|
1144 |
echo $this->formLabel($element);
|
|
|
1145 |
echo $this->formText($element);
|
|
|
1146 |
?>
|
|
|
1147 |
</div>
|
| 16930 |
efrain |
1148 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1149 |
<?php
|
|
|
1150 |
$label = 'LABEL_PHONE';
|
|
|
1151 |
$field = 'phone';
|
| 15399 |
efrain |
1152 |
|
| 16864 |
efrain |
1153 |
$element = $form->get($field);
|
|
|
1154 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1155 |
$element->setOptions(['label' => $label]);
|
|
|
1156 |
echo $this->formLabel($element);
|
|
|
1157 |
echo '<br>';
|
|
|
1158 |
echo $this->formText($element);
|
|
|
1159 |
?>
|
|
|
1160 |
</div>
|
|
|
1161 |
</div>
|
|
|
1162 |
<div class="row">
|
| 16930 |
efrain |
1163 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1164 |
<?php
|
|
|
1165 |
$label = 'LABEL_PHONE_EXTENSION';
|
|
|
1166 |
$field = 'phone_extension';
|
| 15532 |
stevensc |
1167 |
|
|
|
1168 |
|
| 16864 |
efrain |
1169 |
$element = $form->get($field);
|
|
|
1170 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1171 |
$element->setOptions(['label' => $label]);
|
| 15532 |
stevensc |
1172 |
|
| 16864 |
efrain |
1173 |
echo $this->formLabel($element);
|
|
|
1174 |
echo $this->formText($element);
|
|
|
1175 |
?>
|
|
|
1176 |
</div>
|
|
|
1177 |
|
| 16930 |
efrain |
1178 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1179 |
<?php
|
|
|
1180 |
$label = 'LABEL_PERSONAL_EMAIL';
|
|
|
1181 |
$field = 'personal_email';
|
| 15532 |
stevensc |
1182 |
|
|
|
1183 |
|
| 16864 |
efrain |
1184 |
$element = $form->get($field);
|
|
|
1185 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1186 |
$element->setOptions(['label' => $label]);
|
|
|
1187 |
echo $this->formLabel($element);
|
|
|
1188 |
echo $this->formText($element);
|
|
|
1189 |
?>
|
|
|
1190 |
</div>
|
|
|
1191 |
</div>
|
|
|
1192 |
<div class="row">
|
|
|
1193 |
<div class="col-sm-6">
|
|
|
1194 |
<?php
|
|
|
1195 |
$label = 'LABEL_CELULAR';
|
|
|
1196 |
$field = 'celular';
|
| 15532 |
stevensc |
1197 |
|
| 16864 |
efrain |
1198 |
$element = $form->get($field);
|
|
|
1199 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1200 |
$element->setOptions(['label' => $label]);
|
|
|
1201 |
echo $this->formLabel($element);
|
|
|
1202 |
echo '<br/>';
|
|
|
1203 |
echo $this->formText($element);
|
|
|
1204 |
?>
|
|
|
1205 |
</div>
|
| 16930 |
efrain |
1206 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1207 |
<?php
|
|
|
1208 |
$label = 'LABEL_WHATSAPP';
|
|
|
1209 |
$field = 'whatsapp';
|
| 15532 |
stevensc |
1210 |
|
| 16864 |
efrain |
1211 |
$element = $form->get($field);
|
|
|
1212 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1213 |
$element->setOptions(['label' => $label]);
|
|
|
1214 |
echo $this->formLabel($element);
|
|
|
1215 |
echo '<br/>';
|
|
|
1216 |
echo $this->formText($element);
|
|
|
1217 |
?>
|
|
|
1218 |
</div>
|
|
|
1219 |
</div>
|
|
|
1220 |
<div class="row">
|
| 16930 |
efrain |
1221 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1222 |
<?php
|
|
|
1223 |
$label = 'LABEL_LINKEDIN';
|
|
|
1224 |
$field = 'linkedin';
|
| 15532 |
stevensc |
1225 |
|
| 16864 |
efrain |
1226 |
$element = $form->get($field);
|
|
|
1227 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1228 |
$element->setOptions(['label' => $label]);
|
|
|
1229 |
echo $this->formLabel($element);
|
|
|
1230 |
echo $this->formText($element);
|
|
|
1231 |
?>
|
|
|
1232 |
</div>
|
| 16930 |
efrain |
1233 |
<div class="col-6 mt-3">
|
| 16864 |
efrain |
1234 |
<?php
|
|
|
1235 |
$label = 'LABEL_SCHOLARSHIP';
|
|
|
1236 |
$field = 'scholarship';
|
| 15532 |
stevensc |
1237 |
|
| 16864 |
efrain |
1238 |
$element = $form->get($field);
|
|
|
1239 |
$element->setAttributes(['id' => $field, 'class' => 'form-control']);
|
|
|
1240 |
$element->setOptions(['label' => $label]);
|
|
|
1241 |
echo $this->formLabel($element);
|
|
|
1242 |
echo $this->formSelect($element);
|
|
|
1243 |
?>
|
|
|
1244 |
</div>
|
|
|
1245 |
</div>
|
| 15532 |
stevensc |
1246 |
|
| 16864 |
efrain |
1247 |
</div>
|
|
|
1248 |
<div class="card-footer text-right">
|
|
|
1249 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
1250 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
|
|
1251 |
</div>
|
|
|
1252 |
|
|
|
1253 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
1254 |
</div>
|
|
|
1255 |
|
|
|
1256 |
|
|
|
1257 |
|
|
|
1258 |
|
|
|
1259 |
<div class="card" id="interactions-row" style="display: none">
|
|
|
1260 |
<div class="card-header">
|
|
|
1261 |
<h6 class="card-title">LABEL_CONTACT</h6>
|
|
|
1262 |
</div>
|
|
|
1263 |
<div class="card-body">
|
|
|
1264 |
<?php
|
|
|
1265 |
$col = 0;
|
| 15532 |
stevensc |
1266 |
$fields = [
|
|
|
1267 |
'LABEL_FIRST_NAME' => 'interactions-first_name',
|
|
|
1268 |
'LABEL_LAST_NAME' => 'interactions-last_name',
|
|
|
1269 |
'LABEL_CORPORATE_EMAIL' => 'interactions-corporate_email',
|
|
|
1270 |
'LABEL_COMPANY' => 'interactions-company',
|
|
|
1271 |
'LABEL_POSITION' => 'interactions-position',
|
|
|
1272 |
'LABEL_COUNTRY' => 'interactions-country',
|
|
|
1273 |
'LABEL_STATE' => 'interactions-state',
|
|
|
1274 |
'LABEL_CITY' => 'interactions-city',
|
|
|
1275 |
'LABEL_PHONE' => 'interactions-phone',
|
|
|
1276 |
'LABEL_PHONE_EXTENSION' => 'interactions-phone_extension',
|
|
|
1277 |
'LABEL_PERSONAL_EMAIL' => 'interactions-personal_email',
|
|
|
1278 |
'LABEL_CELULAR' => 'interactions-celular',
|
|
|
1279 |
'LABEL_WHATSAPP' => 'interactions-whatsapp',
|
|
|
1280 |
'LABEL_LINKEDIN' => 'interactions-linkedin',
|
| 16766 |
efrain |
1281 |
'LABEL_SCHOLARSHIP' => 'interactions-scholarship',
|
| 15532 |
stevensc |
1282 |
|
|
|
1283 |
|
|
|
1284 |
];
|
|
|
1285 |
foreach ($fields as $label => $field) :
|
|
|
1286 |
|
| 16864 |
efrain |
1287 |
if(0 == $col):
|
| 15532 |
stevensc |
1288 |
?>
|
| 16864 |
efrain |
1289 |
<div class="row">
|
|
|
1290 |
<?php endif; $col++; ?>
|
| 15532 |
stevensc |
1291 |
|
| 16930 |
efrain |
1292 |
<div class="col-6 mt-3">
|
|
|
1293 |
|
| 15532 |
stevensc |
1294 |
<label for="<?php echo $field ?>"><?php echo $label ?></label>
|
|
|
1295 |
<input type="text" id="<?php echo $field ?>" class="form-control" value="" readonly="readonly" />
|
| 16930 |
efrain |
1296 |
|
| 15532 |
stevensc |
1297 |
</div>
|
|
|
1298 |
|
| 16864 |
efrain |
1299 |
<?php if($col == 2) : ?>
|
|
|
1300 |
|
|
|
1301 |
</div>
|
|
|
1302 |
<?php $col = 0; endif; ?>
|
|
|
1303 |
<?php endforeach; ?>
|
|
|
1304 |
|
|
|
1305 |
<div class="row">
|
|
|
1306 |
<div class="col-12 mt-3">
|
|
|
1307 |
|
|
|
1308 |
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
|
1309 |
<li class="nav-item">
|
|
|
1310 |
<a class="nav-link active" id="discovery-contacts-tabs-interactions-tab" data-bs-toggle="tab" href="#discovery-contacts-tabs-interactions" role="tab" aria-controls="discovery-contacts-tabs-interactions" aria-selected="true">LABEL_INTERACTIONS</a>
|
|
|
1311 |
</li>
|
|
|
1312 |
<li class="nav-item">
|
|
|
1313 |
<a class="nav-link" id="discovery-contacts-tabs-logs-tab" data-bs-toggle="tab" href="#discovery-contacts-tabs-logs" role="tab" aria-controls="discovery-contacts-tabs-logs" aria-selected="false">LABEL_LOGS</a>
|
|
|
1314 |
</li>
|
| 15399 |
efrain |
1315 |
|
| 16864 |
efrain |
1316 |
</ul>
|
|
|
1317 |
<div class="tab-content border border-top-0 p-3" id="myTabContent">
|
|
|
1318 |
<div class="tab-pane fade show active" id="discovery-contacts-tabs-interactions" role="tabpanel" aria-labelledby="discovery-contacts-tabs-interactions-tab">
|
|
|
1319 |
<div class="row">
|
|
|
1320 |
<div class="col-12 mt-3">
|
| 16912 |
efrain |
1321 |
<table class="table table-bordered">
|
| 15532 |
stevensc |
1322 |
<thead>
|
| 15399 |
efrain |
1323 |
<tr>
|
|
|
1324 |
<th>LABEL_FIRST_NAME</th>
|
|
|
1325 |
<th>LABEL_LAST_NAME</th>
|
|
|
1326 |
<th>LABEL_EMAIL</th>
|
|
|
1327 |
<th>LABEL_DATE</th>
|
|
|
1328 |
<th>LABEL_ACTIONS</th>
|
|
|
1329 |
</tr>
|
|
|
1330 |
</thead>
|
|
|
1331 |
<tbody id="grid-discovery-contacts-tabs-interactions">
|
|
|
1332 |
</tbody>
|
| 15532 |
stevensc |
1333 |
</table>
|
| 17003 |
efrain |
1334 |
<?php if ($allowInteractionAdd) : ?>
|
|
|
1335 |
<button type="button" class="btn btn-primary btn-add-interaction"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
1336 |
<?php endif; ?>
|
| 16864 |
efrain |
1337 |
|
|
|
1338 |
</div>
|
|
|
1339 |
</div>
|
|
|
1340 |
<div class="row">
|
|
|
1341 |
<div class="col-12 mt-3">
|
|
|
1342 |
<ul id="discovery-contacts-pagination-interactions" class="pagination pagination-sm m-0 float-right">
|
| 15532 |
stevensc |
1343 |
|
|
|
1344 |
</ul>
|
| 16864 |
efrain |
1345 |
</div>
|
|
|
1346 |
</div>
|
|
|
1347 |
</div>
|
|
|
1348 |
|
|
|
1349 |
<div class="tab-pane fade" id="discovery-contacts-tabs-logs" role="tabpanel" aria-labelledby="discovery-contacts-tabs-logs-tab">
|
|
|
1350 |
<div class="row">
|
|
|
1351 |
<div class="col-12 mt-3">
|
| 16912 |
efrain |
1352 |
<table class="table table-bordered">
|
| 15532 |
stevensc |
1353 |
<thead>
|
| 15399 |
efrain |
1354 |
<tr>
|
|
|
1355 |
<th>LABEL_FIRST_NAME</th>
|
|
|
1356 |
<th>LABEL_LAST_NAME</th>
|
|
|
1357 |
<th>LABEL_EMAIL</th>
|
|
|
1358 |
<th>LABEL_ACTIVITY</th>
|
|
|
1359 |
</tr>
|
|
|
1360 |
</thead>
|
|
|
1361 |
<tbody id="grid-discovery-contacts-tabs-logs">
|
|
|
1362 |
</tbody>
|
| 15532 |
stevensc |
1363 |
</table>
|
| 16864 |
efrain |
1364 |
</div>
|
|
|
1365 |
</div>
|
|
|
1366 |
<div class="row">
|
|
|
1367 |
<div class="col-12 mt-3">
|
| 15532 |
stevensc |
1368 |
<ul id="discovery-contacts-pagination-logs" class="pagination pagination-sm m-0 float-right">
|
| 15399 |
efrain |
1369 |
|
| 15532 |
stevensc |
1370 |
</ul>
|
| 16864 |
efrain |
1371 |
</div>
|
|
|
1372 |
</div>
|
|
|
1373 |
</div>
|
|
|
1374 |
|
| 15532 |
stevensc |
1375 |
</div>
|
| 16864 |
efrain |
1376 |
|
|
|
1377 |
</div>
|
|
|
1378 |
</div>
|
|
|
1379 |
</div>
|
|
|
1380 |
<div class="card-footer text-right">
|
|
|
1381 |
|
|
|
1382 |
</div>
|
|
|
1383 |
</div>
|
|
|
1384 |
</div>
|
| 15532 |
stevensc |
1385 |
|
|
|
1386 |
|
|
|
1387 |
|
| 15399 |
efrain |
1388 |
|
| 16864 |
efrain |
1389 |
|
|
|
1390 |
|
|
|
1391 |
|
|
|
1392 |
|
| 15399 |
efrain |
1393 |
<!-- The Modal -->
|
|
|
1394 |
<div class="modal" id="modal-interaction">
|
|
|
1395 |
<div class="modal-dialog modal-xl">
|
|
|
1396 |
<div class="modal-content">
|
|
|
1397 |
|
|
|
1398 |
<!-- Modal Header -->
|
|
|
1399 |
<div class="modal-header">
|
| 16845 |
efrain |
1400 |
<h6 class="modal-title">LABEL_INTERACTION</h6>
|
| 16822 |
efrain |
1401 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15399 |
efrain |
1402 |
</div>
|
|
|
1403 |
|
| 16864 |
efrain |
1404 |
<?php
|
| 15399 |
efrain |
1405 |
$form = $this->formInteraction;
|
|
|
1406 |
$form->setAttributes([
|
|
|
1407 |
'method' => 'post',
|
|
|
1408 |
'name' => 'form-interaction',
|
|
|
1409 |
'id' => 'form-interaction'
|
|
|
1410 |
]);
|
|
|
1411 |
|
|
|
1412 |
$form->prepare();
|
|
|
1413 |
echo $this->form()->openTag($form);
|
|
|
1414 |
?>
|
| 16864 |
efrain |
1415 |
<div class="modal-body">
|
|
|
1416 |
|
|
|
1417 |
<div class="row">
|
|
|
1418 |
<div class="col-12 mt-3">
|
| 15399 |
efrain |
1419 |
<?php
|
|
|
1420 |
$element = $form->get('interaction_type_id');
|
|
|
1421 |
$element->setOptions(['label' => 'LABEL_INTERACTION_TYPE']);
|
|
|
1422 |
$element->setAttributes(['class' => 'form-control']);
|
| 15532 |
stevensc |
1423 |
|
| 15399 |
efrain |
1424 |
echo $this->formLabel($element);
|
|
|
1425 |
echo $this->formSelect($element);
|
|
|
1426 |
?>
|
| 16864 |
efrain |
1427 |
</div>
|
| 15399 |
efrain |
1428 |
</div>
|
| 15532 |
stevensc |
1429 |
|
| 16864 |
efrain |
1430 |
<div class="row">
|
|
|
1431 |
<div class="col-12 mt-3">
|
| 15399 |
efrain |
1432 |
<?php
|
|
|
1433 |
$element = $form->get('notes');
|
|
|
1434 |
$element->setOptions(['label' => 'LABEL_NOTES']);
|
|
|
1435 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1436 |
|
|
|
1437 |
echo $this->formLabel($element);
|
|
|
1438 |
echo $this->formTextArea($element);
|
|
|
1439 |
?>
|
| 16864 |
efrain |
1440 |
</div>
|
| 15399 |
efrain |
1441 |
</div>
|
| 15532 |
stevensc |
1442 |
|
| 16864 |
efrain |
1443 |
|
|
|
1444 |
</div>
|
|
|
1445 |
|
|
|
1446 |
<div class="modal-footer text-right">
|
| 15399 |
efrain |
1447 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
1448 |
<button type="button" class="btn btn-light btn-cancel-interaction">LABEL_CANCEL</button>
|
|
|
1449 |
</div>
|
|
|
1450 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
1451 |
</div>
|
|
|
1452 |
</div>
|
|
|
1453 |
</div>
|
|
|
1454 |
|
|
|
1455 |
|
| 15546 |
efrain |
1456 |
<!-- The Modal -->
|
| 16972 |
efrain |
1457 |
<div class="modal" id="modal-upload">
|
| 15624 |
anderson |
1458 |
<div class="modal-dialog modal-xl">
|
|
|
1459 |
<div class="modal-content">
|
| 15399 |
efrain |
1460 |
|
| 15546 |
efrain |
1461 |
<!-- Modal Header -->
|
| 15624 |
anderson |
1462 |
<div class="modal-header">
|
| 16845 |
efrain |
1463 |
<h6 class="modal-title">LABEL_UPLOAD</h6>
|
| 16822 |
efrain |
1464 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15624 |
anderson |
1465 |
</div>
|
| 15546 |
efrain |
1466 |
|
| 16864 |
efrain |
1467 |
<?php
|
| 15624 |
anderson |
1468 |
$form = $this->contactUploadForm;
|
|
|
1469 |
$form->setAttributes([
|
|
|
1470 |
'method' => 'post',
|
|
|
1471 |
'name' => 'form-contact-upload',
|
|
|
1472 |
'id' => 'form-contact-upload'
|
|
|
1473 |
]);
|
| 15546 |
efrain |
1474 |
|
| 15624 |
anderson |
1475 |
$form->prepare();
|
|
|
1476 |
echo $this->form()->openTag($form);
|
|
|
1477 |
?>
|
| 16864 |
efrain |
1478 |
|
|
|
1479 |
<div class="modal-body">
|
|
|
1480 |
|
| 15624 |
anderson |
1481 |
|
| 16864 |
efrain |
1482 |
<div class="row">
|
|
|
1483 |
<div class="col-12 mt-3">
|
| 15624 |
anderson |
1484 |
|
| 16864 |
efrain |
1485 |
|
| 15624 |
anderson |
1486 |
<?php
|
| 16864 |
efrain |
1487 |
$element = $form->get('file');
|
|
|
1488 |
$element->setOptions(['label' => 'LABEL_EXCEL']);
|
|
|
1489 |
echo $this->formLabel($element);
|
| 15546 |
efrain |
1490 |
?>
|
| 16864 |
efrain |
1491 |
<div class="file-loading">
|
|
|
1492 |
<?php
|
|
|
1493 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel']);
|
|
|
1494 |
echo $this->formFile($element);
|
|
|
1495 |
?>
|
|
|
1496 |
</div>
|
| 15624 |
anderson |
1497 |
</div>
|
| 16864 |
efrain |
1498 |
</div>
|
| 15546 |
efrain |
1499 |
|
|
|
1500 |
|
| 15624 |
anderson |
1501 |
</div>
|
|
|
1502 |
|
| 15546 |
efrain |
1503 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1504 |
<div class="modal-footer text-right">
|
| 16864 |
efrain |
1505 |
<button type="submit" class="btn btn-primary">LABEL_UPLOAD</button>
|
|
|
1506 |
|
| 16972 |
efrain |
1507 |
<button type="button" class="btn btn-light btn-cancel-upload">LABEL_CANCEL</button>
|
| 15624 |
anderson |
1508 |
</div>
|
| 16864 |
efrain |
1509 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
1510 |
|
| 15546 |
efrain |
1511 |
|
| 15624 |
anderson |
1512 |
</div>
|
|
|
1513 |
</div>
|
|
|
1514 |
</div>
|
| 15546 |
efrain |
1515 |
|
|
|
1516 |
|
|
|
1517 |
|
|
|
1518 |
<!-- The Modal -->
|
| 16972 |
efrain |
1519 |
<div class="modal" id="modal-upload-table">
|
| 15624 |
anderson |
1520 |
<div class="modal-dialog modal-xl">
|
|
|
1521 |
<div class="modal-content">
|
| 15546 |
efrain |
1522 |
|
|
|
1523 |
<!-- Modal Header -->
|
| 15624 |
anderson |
1524 |
<div class="modal-header">
|
| 16845 |
efrain |
1525 |
<h6 class="modal-title">LABEL_CONTACTS</h6>
|
| 16822 |
efrain |
1526 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15624 |
anderson |
1527 |
</div>
|
| 15546 |
efrain |
1528 |
|
|
|
1529 |
<!-- Modal body -->
|
| 16454 |
anderson |
1530 |
<div class="modal-body">
|
|
|
1531 |
<form>
|
|
|
1532 |
<input type="hidden" name="table-upload-contacts-key" id="table-upload-contacts-key">
|
|
|
1533 |
</form>
|
| 16864 |
efrain |
1534 |
|
|
|
1535 |
<div class="row">
|
|
|
1536 |
<div class="col-12 mt-3">
|
|
|
1537 |
|
|
|
1538 |
|
|
|
1539 |
<div id="table-wrapper">
|
|
|
1540 |
<table id="gridTableUploadContacts" class="table table-bordered">
|
|
|
1541 |
<thead>
|
|
|
1542 |
<tr>
|
|
|
1543 |
<th>LABEL_FIRST_NAME</th>
|
|
|
1544 |
<th>LABEL_LAST_NAME</th>
|
|
|
1545 |
<th>LABEL_PERSONAL_EMAIL</th>
|
|
|
1546 |
<th>LABEL_CORPORATE_EMAIL</th>
|
|
|
1547 |
<th>LABEL_COMPANY</th>
|
|
|
1548 |
<th>LABEL_POSITION</th>
|
|
|
1549 |
<th>LABEL_SECTOR</th>
|
|
|
1550 |
<th>LABEL_COUNTRY</th>
|
|
|
1551 |
<th>LABEL_STATE</th>
|
|
|
1552 |
<th>LABEL_CITY</th>
|
|
|
1553 |
<th>LABEL_PHONE</th>
|
|
|
1554 |
<th>LABEL_PHONE_EXTENSION</th>
|
|
|
1555 |
<th>LABEL_CELULAR</th>
|
|
|
1556 |
<th>LABEL_WHATSAPP</th>
|
|
|
1557 |
<th>LABEL_LINKEDIN</th>
|
|
|
1558 |
<th>LABEL_SECTOR</th>
|
|
|
1559 |
<th>LABEL_SCHOLARSHIP</th>
|
|
|
1560 |
</tr>
|
|
|
1561 |
</thead>
|
|
|
1562 |
<tbody>
|
|
|
1563 |
</tbody>
|
|
|
1564 |
</table>
|
|
|
1565 |
</div>
|
|
|
1566 |
|
|
|
1567 |
</div>
|
|
|
1568 |
|
|
|
1569 |
</div>
|
| 16454 |
anderson |
1570 |
|
|
|
1571 |
|
|
|
1572 |
|
| 15546 |
efrain |
1573 |
|
| 15624 |
anderson |
1574 |
</div>
|
|
|
1575 |
|
| 15546 |
efrain |
1576 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1577 |
<div class="modal-footer text-right">
|
| 15624 |
anderson |
1578 |
<button type="submit" class="btn btn-primary btn-upload-contacts-step2">LABEL_SAVE</button>
|
| 16972 |
efrain |
1579 |
<button type="button" class="btn btn-light btn-cancel-upload">LABEL_CANCEL</button>
|
| 15624 |
anderson |
1580 |
</div>
|
| 15546 |
efrain |
1581 |
|
| 15624 |
anderson |
1582 |
</div>
|
|
|
1583 |
</div>
|
|
|
1584 |
</div>
|
| 15546 |
efrain |
1585 |
|
|
|
1586 |
|
| 15399 |
efrain |
1587 |
<script id="interactionTemplate" type="text/x-jsrender">
|
|
|
1588 |
{{for items}}
|
| 15532 |
stevensc |
1589 |
<tr>
|
|
|
1590 |
<td>{{>first_name}}</td>
|
|
|
1591 |
<td>{{>last_name}}</td>
|
|
|
1592 |
<td>{{>email}}</td>
|
|
|
1593 |
<td> {{>added_on}}</td>
|
|
|
1594 |
<td>
|
|
|
1595 |
<button class="btn btn-danger btn-delete-interaction" data-href="{{>link_delete}}" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>
|
|
|
1596 |
</td>
|
|
|
1597 |
</tr>
|
|
|
1598 |
<tr>
|
|
|
1599 |
<td colspan="2">
|
|
|
1600 |
{{>name}}
|
|
|
1601 |
</td>
|
|
|
1602 |
<td colspan="3">
|
|
|
1603 |
{{>notes}}
|
|
|
1604 |
</td>
|
|
|
1605 |
</tr>
|
| 15399 |
efrain |
1606 |
{{/for}}
|
|
|
1607 |
</script>
|
|
|
1608 |
|
|
|
1609 |
|
|
|
1610 |
<script id="logTemplate" type="text/x-jsrender">
|
|
|
1611 |
{{for items}}
|
| 15532 |
stevensc |
1612 |
<tr>
|
|
|
1613 |
<td>{{>first_name}}</td>
|
|
|
1614 |
<td>{{>last_name}}</td>
|
|
|
1615 |
<td>{{>email}}</td>
|
| 15533 |
stevensc |
1616 |
<td>
|
| 15534 |
stevensc |
1617 |
{{>activity}} -
|
|
|
1618 |
{{>added_on}}
|
| 15532 |
stevensc |
1619 |
</td>
|
| 15533 |
stevensc |
1620 |
</tr>
|
| 15532 |
stevensc |
1621 |
|
| 15533 |
stevensc |
1622 |
<tr>
|
|
|
1623 |
<td>
|
|
|
1624 |
</td>
|
|
|
1625 |
<td>
|
|
|
1626 |
</td>
|
|
|
1627 |
<td>
|
|
|
1628 |
</td>
|
|
|
1629 |
|
|
|
1630 |
<td>
|
| 15532 |
stevensc |
1631 |
{{>details}}
|
|
|
1632 |
</td>
|
| 15533 |
stevensc |
1633 |
</tr>
|
| 15532 |
stevensc |
1634 |
|
| 15399 |
efrain |
1635 |
{{/for}}
|
|
|
1636 |
</script>
|
|
|
1637 |
|
| 15546 |
efrain |
1638 |
|
|
|
1639 |
<script id="uploadContactTemplate" type="text/x-jsrender">
|
|
|
1640 |
{{for items}}
|
|
|
1641 |
<tr>
|
|
|
1642 |
<td>{{>first_name}}</td>
|
|
|
1643 |
<td>{{>last_name}}</td>
|
|
|
1644 |
<td>{{>email_personal}}</td>
|
|
|
1645 |
<td>{{>email_company}}</td>
|
|
|
1646 |
<td>{{>company}}</td>
|
|
|
1647 |
<td>{{>position}}</td>
|
| 15831 |
efrain |
1648 |
<td>{{>sector}}</td>
|
| 15546 |
efrain |
1649 |
<td>{{>country}}</td>
|
|
|
1650 |
<td>{{>state}}</td>
|
|
|
1651 |
<td>{{>city}}</td>
|
|
|
1652 |
<td>{{>phone}}</td>
|
|
|
1653 |
<td>{{>extension}}</td>
|
|
|
1654 |
<td>{{>movil}}</td>
|
|
|
1655 |
<td>{{>whatsapp}}</td>
|
|
|
1656 |
<td>{{>linkedin}}</td>
|
| 16766 |
efrain |
1657 |
<td>{{>sector}}</td>
|
|
|
1658 |
<td>{{>scholarship}}</td>
|
| 15546 |
efrain |
1659 |
</tr>
|
|
|
1660 |
|
|
|
1661 |
|
|
|
1662 |
{{/for}}
|
|
|
1663 |
</script>
|
|
|
1664 |
|
| 15399 |
efrain |
1665 |
<script id="logPaginationTemplate" type="text/x-jsrender">
|
|
|
1666 |
{{if has_previous_page}}
|
| 15532 |
stevensc |
1667 |
<li class="page-item"><a class="page-link class-btn-log-previous" href="#"> <i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_PREVIOUS </a></li>
|
| 15399 |
efrain |
1668 |
{{/if}}
|
|
|
1669 |
|
|
|
1670 |
{{if has_next_page}}
|
| 15532 |
stevensc |
1671 |
<li class="page-item"><a class="page-link class-btn-log-next" href="#"> LABEL_NEXT <i class="fa fa-chevron-right" aria-hidden="true"></i> </a></li>
|
| 15399 |
efrain |
1672 |
{{/if}}
|
|
|
1673 |
</script>
|
|
|
1674 |
|
|
|
1675 |
<script id="interactionPaginationTemplate" type="text/x-jsrender">
|
|
|
1676 |
{{if has_previous_page}}
|
| 15532 |
stevensc |
1677 |
<li class="page-item"><a class="page-link class-btn-interaction-previous" href="#"> <i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_PREVIOUS </a></li>
|
| 15399 |
efrain |
1678 |
{{/if}}
|
|
|
1679 |
|
|
|
1680 |
{{if has_next_page}}
|
| 15532 |
stevensc |
1681 |
<li class="page-item"><a class="page-link class-btn-interaction-next" href="#"> LABEL_NEXT <i class="fa fa-chevron-right" aria-hidden="true"></i> </a></li>
|
| 15399 |
efrain |
1682 |
{{/if}}
|
|
|
1683 |
</script>
|