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