| 15333 |
stevensc |
1 |
<?php
|
|
|
2 |
|
| 1 |
www |
3 |
use LeadersLinked\Model\CompanyUser;
|
|
|
4 |
|
|
|
5 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
6 |
$currentUser = $this->currentUserHelper();
|
|
|
7 |
|
|
|
8 |
$roleName = $currentUser->getUserTypeId();
|
|
|
9 |
|
|
|
10 |
//$routeAdd = $this->url('users/add');
|
|
|
11 |
$routeDatatable = $this->url('users');
|
|
|
12 |
$routeInvite = $this->url('users/invite');
|
|
|
13 |
$routeUpload = $this->url('users/upload');
|
|
|
14 |
|
|
|
15 |
$allowInvite = $acl->isAllowed($roleName, 'users/invite') ? 1 : 0;
|
|
|
16 |
$allowAccept = $acl->isAllowed($roleName, 'users/accept') ? 1 : 0;
|
|
|
17 |
$allowCancel = $acl->isAllowed($roleName, 'users/cancel') ? 1 : 0;
|
|
|
18 |
$allowReject = $acl->isAllowed($roleName, 'users/reject') ? 1 : 0;
|
|
|
19 |
$allowEdit = $acl->isAllowed($roleName, 'users/edit') ? 1 : 0;
|
|
|
20 |
$allowUpload = $acl->isAllowed($roleName, 'users/upload') ? 1 : 0;
|
|
|
21 |
$allowChangePassword = $acl->isAllowed($roleName, 'users/change-password') ? 1 : 0;
|
|
|
22 |
$allowUnblock = $acl->isAllowed($roleName, 'users/unblock') ? 1 : 0;
|
|
|
23 |
|
|
|
24 |
|
| 17333 |
stevensc |
25 |
// Popper
|
| 16822 |
efrain |
26 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/popper/umd/popper.js'));
|
| 17333 |
stevensc |
27 |
|
|
|
28 |
// NProgress
|
| 16822 |
efrain |
29 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
| 1 |
www |
31 |
|
| 17333 |
stevensc |
32 |
// CKEditor
|
| 16822 |
efrain |
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
| 1 |
www |
34 |
|
| 17333 |
stevensc |
35 |
// Datatables
|
| 16822 |
efrain |
36 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
| 16912 |
efrain |
37 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
| 16822 |
efrain |
38 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
39 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
| 16912 |
efrain |
40 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
| 1 |
www |
42 |
|
| 17333 |
stevensc |
43 |
// Toggle
|
| 16822 |
efrain |
44 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 1 |
www |
46 |
|
| 17333 |
stevensc |
47 |
// Autocomplete
|
|
|
48 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-autocomplete/bootstrap-autocomplete.min.js'));
|
| 1 |
www |
49 |
|
| 17333 |
stevensc |
50 |
// File input
|
| 16822 |
efrain |
51 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
52 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
|
| 16843 |
efrain |
53 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
54 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
| 16822 |
efrain |
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
56 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
57 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
|
|
|
58 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
|
|
|
59 |
|
| 16954 |
efrain |
60 |
|
| 1 |
www |
61 |
$this->headStyle()->captureStart();
|
| 16954 |
efrain |
62 |
echo <<<CSS
|
| 1 |
www |
63 |
|
| 16954 |
efrain |
64 |
|
|
|
65 |
#gridTableUsers {
|
|
|
66 |
display: flex;
|
|
|
67 |
flex-flow: column;
|
|
|
68 |
width: 100%;
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
#gridTableUsers thead {
|
|
|
72 |
flex: 0 0 auto;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
#gridTableUsers tbody {
|
|
|
76 |
flex: 1 1 auto;
|
|
|
77 |
display: block;
|
|
|
78 |
overflow-y: auto;
|
|
|
79 |
overflow-x: hidden;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
#gridTableUsers tr {
|
|
|
83 |
width: 100%;
|
|
|
84 |
display: table;
|
|
|
85 |
table-layout: fixed;
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
CSS;
|
|
|
89 |
$this->headStyle()->captureEnd();
|
|
|
90 |
|
| 1 |
www |
91 |
$this->inlineScript()->captureStart();
|
|
|
92 |
echo <<<JS
|
|
|
93 |
jQuery( document ).ready(function( $ ) {
|
|
|
94 |
$.validator.addMethod('passwordStrengthCheck', function(value) {
|
|
|
95 |
return /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$^x%x*-]).{6,16}$/.test(value)
|
|
|
96 |
}, 'ERROR_PASSWORD_STRENGTH');
|
|
|
97 |
|
|
|
98 |
$.validator.setDefaults({
|
|
|
99 |
debug: true,
|
|
|
100 |
highlight: function(element) {
|
|
|
101 |
$(element).closest('.sn-field').addClass('sn-field-has-error');
|
|
|
102 |
},
|
|
|
103 |
unhighlight: function(element) {
|
|
|
104 |
$(element).closest('.sn-field').removeClass('sn-field-has-error');
|
|
|
105 |
},
|
|
|
106 |
errorElement: 'div',
|
|
|
107 |
errorClass: 'sn-field-invalid-feedback',
|
|
|
108 |
errorPlacement: function(error, element) {
|
|
|
109 |
|
|
|
110 |
if(element.parent('.sn-field').length) {
|
|
|
111 |
error.insertAfter(element.parent());
|
|
|
112 |
} else if (element.parent('.fgt-sec').length) {
|
|
|
113 |
error.insertAfter(element.parent());
|
|
|
114 |
} else {
|
|
|
115 |
error.insertAfter(element);
|
|
|
116 |
}
|
|
|
117 |
}
|
|
|
118 |
});
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
var allowInvite = $allowInvite;
|
|
|
122 |
var allowAccept = $allowAccept;
|
|
|
123 |
var allowCancel = $allowCancel;
|
|
|
124 |
var allowReject = $allowReject;
|
|
|
125 |
var allowEdit = $allowEdit;
|
|
|
126 |
var allowUpload = $allowUpload;
|
|
|
127 |
var allowChangePassword = $allowChangePassword;
|
|
|
128 |
var allowUnblock = $allowUnblock;
|
|
|
129 |
|
|
|
130 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
131 |
'processing': true,
|
|
|
132 |
'serverSide': true,
|
|
|
133 |
'searching': true,
|
|
|
134 |
'order': [[ 0, 'asc' ]],
|
|
|
135 |
'ordering': true,
|
|
|
136 |
'ordenable' : true,
|
|
|
137 |
'responsive': true,
|
|
|
138 |
'select' : false,
|
|
|
139 |
'paging': true,
|
|
|
140 |
'pagingType': 'simple_numbers',
|
|
|
141 |
'ajax': {
|
|
|
142 |
'url' : '$routeDatatable',
|
|
|
143 |
'type' : 'get',
|
|
|
144 |
'data' : function(data) {
|
|
|
145 |
data.status = $('#form-filter #status').val();
|
|
|
146 |
} ,
|
|
|
147 |
'beforeSend': function (request) {
|
|
|
148 |
NProgress.start();
|
|
|
149 |
},
|
|
|
150 |
'dataFilter': function(response) {
|
|
|
151 |
var response = jQuery.parseJSON( response );
|
|
|
152 |
|
|
|
153 |
var json = {};
|
|
|
154 |
json.recordsTotal = 0;
|
|
|
155 |
json.recordsFiltered = 0;
|
|
|
156 |
json.data = [];
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
if(response.success) {
|
|
|
160 |
json.recordsTotal = response.data.total;
|
|
|
161 |
json.recordsFiltered = response.data.total;
|
|
|
162 |
json.data = response.data.items;
|
|
|
163 |
} else {
|
|
|
164 |
$.fn.showError(response.data)
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
return JSON.stringify( json );
|
|
|
168 |
}
|
|
|
169 |
},
|
|
|
170 |
'language' : {
|
|
|
171 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
172 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
173 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
174 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
175 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
176 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
177 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
178 |
'sInfoPostFix': '',
|
|
|
179 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
180 |
'sUrl': '',
|
|
|
181 |
'sInfoThousands': ',',
|
|
|
182 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
183 |
'oPaginate': {
|
|
|
184 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
185 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
186 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
187 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
188 |
},
|
|
|
189 |
'oAria': {
|
|
|
190 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
191 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
192 |
},
|
|
|
193 |
},
|
|
|
194 |
'drawCallback': function( settings ) {
|
|
|
195 |
NProgress.done();
|
| 16822 |
efrain |
196 |
|
| 1 |
www |
197 |
},
|
|
|
198 |
'aoColumns': [
|
|
|
199 |
{ 'mDataProp': 'first_name' },
|
|
|
200 |
{ 'mDataProp': 'last_name' },
|
|
|
201 |
{ 'mDataProp': 'email' },
|
|
|
202 |
{ 'mDataProp': 'details' },
|
|
|
203 |
{ 'mDataProp': 'actions' },
|
|
|
204 |
],
|
|
|
205 |
'columnDefs': [
|
|
|
206 |
{
|
|
|
207 |
'targets': 0,
|
|
|
208 |
'className' : 'text-vertical-middle',
|
|
|
209 |
},
|
|
|
210 |
{
|
|
|
211 |
'targets': 1,
|
|
|
212 |
'className' : 'text-vertical-middle',
|
|
|
213 |
},
|
|
|
214 |
{
|
|
|
215 |
'targets': 2,
|
|
|
216 |
'className' : 'text-vertical-middle',
|
|
|
217 |
},
|
|
|
218 |
{
|
|
|
219 |
'targets': -2,
|
|
|
220 |
'orderable': false,
|
|
|
221 |
'render' : function ( data, type, row ) {
|
|
|
222 |
var s = '';
|
|
|
223 |
s = s + 'LABEL_STATUS : <br>' + data['status'] + '<br>';
|
|
|
224 |
s = s + 'LABEL_ACCESS_BACKEND : ' + data['backend'] + '<br>';
|
|
|
225 |
s = s + 'LABEL_CREATOR : ' + data['creator'] + '<br>';
|
|
|
226 |
|
|
|
227 |
s = s + 'LABEL_EDIT : <br>';
|
|
|
228 |
|
|
|
229 |
$.each(data['roles'], function(i, role) {
|
|
|
230 |
s = s + role + '<br>';
|
|
|
231 |
});
|
|
|
232 |
|
|
|
233 |
s = s + 'LABEL_BLOCKED : ' + data['blocked'] + '<br>';
|
|
|
234 |
s = s + 'LABEL_EMAIL_VERIFIED : ' + data['email_verified'] + '<br>';
|
|
|
235 |
s = s + 'LABEL_LOGIN_ATTEMP : ' + data['login_attempt'] + '<br>';
|
|
|
236 |
return s;
|
|
|
237 |
}
|
|
|
238 |
},
|
|
|
239 |
{
|
|
|
240 |
'targets': -1,
|
|
|
241 |
'orderable': false,
|
|
|
242 |
'render' : function ( data, type, row ) {
|
|
|
243 |
s = '';
|
| 15333 |
stevensc |
244 |
|
|
|
245 |
$('#gridTable_wrapper .row:nth-child(2) .col-sm-12').addClass( "table table-responsive" );
|
| 1 |
www |
246 |
|
|
|
247 |
if(allowAccept && data['link_accept']) {
|
| 16822 |
efrain |
248 |
s = s + '<button class="btn btn-sm btn-accept btn-primary" style="margin-top: 5px" data-href="' + data['link_accept']+ '" data-toggle="tooltip" title="LABEL_ACCEPT"><i class="fa fa-check"></i> LABEL_ACCEPT </button><br>';
|
| 1 |
www |
249 |
}
|
| 15261 |
stevensc |
250 |
if(allowEdit && data['link_edit']) {
|
| 16906 |
efrain |
251 |
s = s + '<button class="btn btn-sm btn-edit btn-primary" style="margin-top: 5px" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button><br>';
|
| 15261 |
stevensc |
252 |
}
|
| 1 |
www |
253 |
if(allowCancel && data['link_cancel']) {
|
| 16822 |
efrain |
254 |
s = s + '<button class="btn btn-sm btn-cancel btn-danger" style="margin-top: 5px" data-href="' + data['link_cancel']+ '" data-toggle="tooltip" data-singleton="true" title="LABEL_CANCEL"><i class="fa fa-times"></i> LABEL_CANCEL </button><br>';
|
| 1 |
www |
255 |
}
|
|
|
256 |
if(allowReject && data['link_reject']) {
|
| 16822 |
efrain |
257 |
s = s + '<button class="btn btn-sm btn-reject btn-danger" style="margin-top: 5px" data-href="' + data['link_reject']+ '" data-toggle="tooltip" title="LABEL_REJECT"><i class="fa fa-times"></i> LABEL_REJECT </button><br>';
|
| 1 |
www |
258 |
}
|
|
|
259 |
|
|
|
260 |
if(allowChangePassword && data['link_change_password']) {
|
| 16822 |
efrain |
261 |
s = s + '<button class="btn btn-sm btn-primary btn-change-password" style="margin-top: 5px" data-href="' + data['link_change_password']+ '" data-toggle="tooltip" title="LABEL_CHANGE_PASSWORD"><i class="fa fa-key"></i> LABEL_PASSWORD </button><br>';
|
| 1 |
www |
262 |
}
|
|
|
263 |
if(allowUnblock && data['link_unblock']) {
|
| 16822 |
efrain |
264 |
s = s + '<button class="btn btn-sm btn-info btn-unblock" style="margin-top: 5px" data-href="' + data['link_unblock']+ '" data-toggle="tooltip" title="LABEL_UNBLOCK"><i class="fa fa-unlock"></i> LABEL_UNBLOCK </button><br>';
|
| 1 |
www |
265 |
}
|
|
|
266 |
|
|
|
267 |
|
|
|
268 |
return s;
|
|
|
269 |
}
|
|
|
270 |
}
|
|
|
271 |
|
|
|
272 |
],
|
|
|
273 |
});
|
|
|
274 |
|
|
|
275 |
|
|
|
276 |
$('#form-filter #status').change(function(e) {
|
|
|
277 |
e.preventDefault();
|
|
|
278 |
gridTable.api().ajax.reload(null, false);
|
|
|
279 |
});
|
|
|
280 |
|
|
|
281 |
|
|
|
282 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
283 |
e.preventDefault();
|
|
|
284 |
gridTable.api().ajax.reload(null, false);
|
|
|
285 |
});
|
|
|
286 |
|
| 16822 |
efrain |
287 |
$('body').on('click', 'button.btn-unblock', function(e) {
|
|
|
288 |
e.preventDefault();
|
|
|
289 |
var action = $(this).data('href');
|
| 1 |
www |
290 |
|
|
|
291 |
|
| 16822 |
efrain |
292 |
swal.fire({
|
|
|
293 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
294 |
icon: 'question',
|
|
|
295 |
cancelButtonText: 'LABEL_NO',
|
|
|
296 |
showCancelButton: true,
|
|
|
297 |
confirmButtonText: 'LABEL_YES'
|
|
|
298 |
}).then((result) => {
|
|
|
299 |
if (result.isConfirmed) {
|
| 1 |
www |
300 |
|
| 16822 |
efrain |
301 |
NProgress.start();
|
|
|
302 |
$.ajax({
|
|
|
303 |
'dataType' : 'json',
|
|
|
304 |
'accept' : 'application/json',
|
|
|
305 |
'method' : 'post',
|
|
|
306 |
'url' : action,
|
|
|
307 |
}).done(function(response) {
|
|
|
308 |
if(response['success']) {
|
|
|
309 |
$.fn.showSuccess(response['data']);
|
|
|
310 |
gridTable.api().ajax.reload(null, false);
|
|
|
311 |
} else {
|
|
|
312 |
$.fn.showError(response['data']);
|
|
|
313 |
}
|
|
|
314 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
315 |
$.fn.showError(textStatus);
|
|
|
316 |
}).always(function() {
|
|
|
317 |
NProgress.done();
|
|
|
318 |
});
|
|
|
319 |
}
|
|
|
320 |
});
|
|
|
321 |
});
|
| 1 |
www |
322 |
|
| 16822 |
efrain |
323 |
$('body').on('click', 'button.btn-reject', function(e) {
|
|
|
324 |
e.preventDefault();
|
|
|
325 |
var action = $(this).data('href');
|
|
|
326 |
|
|
|
327 |
|
|
|
328 |
swal.fire({
|
|
|
329 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
330 |
icon: 'question',
|
|
|
331 |
cancelButtonText: 'LABEL_NO',
|
|
|
332 |
showCancelButton: true,
|
|
|
333 |
confirmButtonText: 'LABEL_YES'
|
|
|
334 |
}).then((result) => {
|
|
|
335 |
if (result.isConfirmed) {
|
|
|
336 |
|
|
|
337 |
NProgress.start();
|
|
|
338 |
$.ajax({
|
|
|
339 |
'dataType' : 'json',
|
|
|
340 |
'accept' : 'application/json',
|
|
|
341 |
'method' : 'post',
|
|
|
342 |
'url' : action,
|
|
|
343 |
}).done(function(response) {
|
|
|
344 |
if(response['success']) {
|
|
|
345 |
$.fn.showSuccess(response['data']);
|
|
|
346 |
gridTable.api().ajax.reload(null, false);
|
|
|
347 |
} else {
|
|
|
348 |
$.fn.showError(response['data']);
|
|
|
349 |
}
|
|
|
350 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
351 |
$.fn.showError(textStatus);
|
|
|
352 |
}).always(function() {
|
|
|
353 |
NProgress.done();
|
|
|
354 |
});
|
|
|
355 |
}
|
|
|
356 |
});
|
|
|
357 |
});
|
|
|
358 |
|
|
|
359 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
360 |
e.preventDefault();
|
|
|
361 |
var action = $(this).data('href');
|
|
|
362 |
|
|
|
363 |
|
|
|
364 |
swal.fire({
|
|
|
365 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
366 |
icon: 'question',
|
|
|
367 |
cancelButtonText: 'LABEL_NO',
|
|
|
368 |
showCancelButton: true,
|
|
|
369 |
confirmButtonText: 'LABEL_YES'
|
|
|
370 |
}).then((result) => {
|
|
|
371 |
if (result.isConfirmed) {
|
|
|
372 |
|
|
|
373 |
NProgress.start();
|
|
|
374 |
$.ajax({
|
|
|
375 |
'dataType' : 'json',
|
|
|
376 |
'accept' : 'application/json',
|
|
|
377 |
'method' : 'post',
|
|
|
378 |
'url' : action,
|
|
|
379 |
}).done(function(response) {
|
|
|
380 |
if(response['success']) {
|
|
|
381 |
$.fn.showSuccess(response['data']);
|
|
|
382 |
gridTable.api().ajax.reload(null, false);
|
|
|
383 |
} else {
|
|
|
384 |
$.fn.showError(response['data']);
|
|
|
385 |
}
|
|
|
386 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
387 |
$.fn.showError(textStatus);
|
|
|
388 |
}).always(function() {
|
|
|
389 |
NProgress.done();
|
|
|
390 |
});
|
|
|
391 |
}
|
|
|
392 |
});
|
|
|
393 |
});
|
|
|
394 |
|
|
|
395 |
|
| 1 |
www |
396 |
$('body').on('click', 'button.btn-invite', function(e) {
|
|
|
397 |
e.preventDefault();
|
| 16926 |
efrain |
398 |
|
| 17330 |
ariadna |
399 |
// Limpiar el campo antes de abrir el modal
|
|
|
400 |
$('#form-invite #user_uuid').val('');
|
| 1 |
www |
401 |
$('#form-invite #user_uuid_selected').val('');
|
| 17330 |
ariadna |
402 |
|
|
|
403 |
// Abrir el modal
|
| 1 |
www |
404 |
$('#modalInvite').modal('show');
|
|
|
405 |
});
|
|
|
406 |
|
|
|
407 |
$('body').on('click', 'button.btn-accept', function(e) {
|
|
|
408 |
e.preventDefault();
|
|
|
409 |
action = $(this).data('href');
|
|
|
410 |
NProgress.start();
|
|
|
411 |
$.ajax({
|
|
|
412 |
'dataType' : 'json',
|
|
|
413 |
'accept' : 'application/json',
|
|
|
414 |
'method' : 'post',
|
|
|
415 |
'url' : action
|
|
|
416 |
}).done(function(response) {
|
|
|
417 |
if(response['success']) {
|
|
|
418 |
$.fn.showSuccess(response['data']);
|
|
|
419 |
gridTable.api().ajax.reload(null, false);
|
|
|
420 |
} else {
|
|
|
421 |
$.fn.showError(response['data']);
|
|
|
422 |
}
|
|
|
423 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
424 |
$.fn.showError(textStatus);
|
|
|
425 |
}).always(function() {
|
|
|
426 |
NProgress.done();
|
|
|
427 |
});
|
|
|
428 |
});
|
|
|
429 |
|
| 17330 |
ariadna |
430 |
// Inicializar autoComplete para el campo de búsqueda de usuarios
|
| 17335 |
stevensc |
431 |
function initializeAutoComplete() {
|
| 17330 |
ariadna |
432 |
if (typeof $.fn.autoComplete === 'undefined') {
|
|
|
433 |
console.error('autoComplete library not loaded!');
|
|
|
434 |
return;
|
|
|
435 |
}
|
|
|
436 |
|
| 17336 |
stevensc |
437 |
// Destruir instancia anterior si existe
|
|
|
438 |
if ($('#form-invite #user_uuid').data('autoComplete')) {
|
|
|
439 |
$('#form-invite #user_uuid').autoComplete('clear');
|
|
|
440 |
}
|
|
|
441 |
|
| 17330 |
ariadna |
442 |
$('#form-invite #user_uuid').autoComplete({
|
|
|
443 |
resolver: 'custom',
|
|
|
444 |
minLength: 3,
|
|
|
445 |
noResultsText: 'LABEL_AUTOCOMPLETE_USERS_NOT_FOUND',
|
|
|
446 |
events: {
|
|
|
447 |
search: function (qry, callback) {
|
|
|
448 |
console.log('Searching for:', qry); // Debug
|
|
|
449 |
NProgress.start();
|
|
|
450 |
$.ajax({
|
|
|
451 |
'url' : '$routeInvite',
|
|
|
452 |
'method': 'get',
|
|
|
453 |
'data': { 'search': qry },
|
|
|
454 |
'dataType': 'json'
|
|
|
455 |
}).done(function (response) {
|
|
|
456 |
console.log('Response:', response); // Debug
|
|
|
457 |
if(response.success) {
|
| 17338 |
stevensc |
458 |
$(".bootstrap-autocomplete.dropdown-menu").toggleClass('show');
|
| 17330 |
ariadna |
459 |
callback(response.data);
|
|
|
460 |
} else {
|
|
|
461 |
console.error('Search error:', response.data); // Debug
|
|
|
462 |
$.fn.showError(response.data);
|
| 17329 |
ariadna |
463 |
callback([]);
|
| 17330 |
ariadna |
464 |
}
|
|
|
465 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
466 |
console.error('AJAX error:', textStatus, errorThrown); // Debug
|
|
|
467 |
$.fn.showError(textStatus);
|
|
|
468 |
callback([]);
|
|
|
469 |
}).always(function() {
|
|
|
470 |
NProgress.done();
|
|
|
471 |
});
|
| 17329 |
ariadna |
472 |
}
|
| 17330 |
ariadna |
473 |
}
|
|
|
474 |
});
|
|
|
475 |
console.log('autoComplete initialized successfully'); // Debug
|
|
|
476 |
}
|
|
|
477 |
|
|
|
478 |
// Inicializar cuando el documento esté listo
|
|
|
479 |
initializeAutoComplete();
|
| 1 |
www |
480 |
|
|
|
481 |
$('#form-invite #user_uuid').on('autocomplete.select', function (evt, item) {
|
| 17330 |
ariadna |
482 |
console.log('Item selected:', item); // Debug
|
|
|
483 |
$('#form-invite #user_uuid_selected').val(item.value);
|
| 17339 |
stevensc |
484 |
$(".bootstrap-autocomplete.dropdown-menu").toggleClass('show');
|
| 17330 |
ariadna |
485 |
console.log('Hidden field value set to:', item.value); // Debug
|
| 1 |
www |
486 |
});
|
|
|
487 |
|
|
|
488 |
var validatorFormInvite = $('#form-invite').validate({
|
|
|
489 |
debug: true,
|
|
|
490 |
onclick: false,
|
|
|
491 |
onkeyup: false,
|
|
|
492 |
ignore: [':hidden'],
|
|
|
493 |
rules: {
|
|
|
494 |
|
|
|
495 |
'user_uuid': {
|
|
|
496 |
required: true,
|
|
|
497 |
},
|
|
|
498 |
},
|
|
|
499 |
submitHandler: function(form)
|
|
|
500 |
{
|
|
|
501 |
NProgress.start();
|
|
|
502 |
$.ajax({
|
|
|
503 |
'dataType' : 'json',
|
|
|
504 |
'accept' : 'application/json',
|
|
|
505 |
'method' : 'post',
|
|
|
506 |
'url' : '$routeInvite',
|
|
|
507 |
'data' : {
|
|
|
508 |
'id' : $('#form-invite #user_uuid_selected').val(),
|
|
|
509 |
}
|
|
|
510 |
}).done(function(response) {
|
|
|
511 |
if(response.success) {
|
|
|
512 |
$.fn.showSuccess(response.data);
|
|
|
513 |
|
|
|
514 |
$('#modalInvite').modal('hide');
|
|
|
515 |
gridTable.api().ajax.reload(null, false);
|
|
|
516 |
} else {
|
|
|
517 |
if(jQuery.type(response.data) == 'string') {
|
|
|
518 |
$.fn.showError(response.data)
|
|
|
519 |
} else {
|
|
|
520 |
$.each(response.data, function( fieldname, errors ) {
|
|
|
521 |
$.fn.showFormErrorValidator('#form-invite #' + fieldname, errors);
|
|
|
522 |
});
|
|
|
523 |
}
|
|
|
524 |
}
|
|
|
525 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
526 |
$.fn.showError(textStatus)
|
|
|
527 |
|
|
|
528 |
}).always(function() {
|
|
|
529 |
NProgress.done();
|
|
|
530 |
})
|
|
|
531 |
},
|
|
|
532 |
invalidHandler: function(form, validator) {
|
|
|
533 |
}
|
|
|
534 |
});
|
|
|
535 |
|
| 15460 |
efrain |
536 |
var validatorUploadUsers = $('#form-upload-users').validate({
|
| 1 |
www |
537 |
debug: true,
|
|
|
538 |
onclick: false,
|
|
|
539 |
onkeyup: false,
|
|
|
540 |
onfocusout: false,
|
|
|
541 |
ignore: [],
|
|
|
542 |
rules: {
|
|
|
543 |
'file' : {
|
|
|
544 |
required: true,
|
|
|
545 |
extension: 'xls|xlsx',
|
|
|
546 |
accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'
|
|
|
547 |
},
|
|
|
548 |
},
|
|
|
549 |
|
|
|
550 |
submitHandler: function(form)
|
|
|
551 |
{
|
|
|
552 |
NProgress.start();
|
|
|
553 |
var formdata = false;
|
|
|
554 |
if (window.FormData){
|
|
|
555 |
formdata = new FormData(form);
|
|
|
556 |
}
|
|
|
557 |
formdata.append('step','validation');
|
|
|
558 |
|
|
|
559 |
|
|
|
560 |
$.ajax({
|
|
|
561 |
'dataType' : 'json',
|
|
|
562 |
'accept' : 'application/json',
|
|
|
563 |
'method' : 'post',
|
|
|
564 |
'url' : '$routeUpload',
|
|
|
565 |
'data' : formdata,
|
|
|
566 |
'processData': false,
|
|
|
567 |
'contentType': false,
|
|
|
568 |
}).done(function(response) {
|
|
|
569 |
if(response['success']) {
|
|
|
570 |
|
|
|
571 |
$('#table-upload-users-key').val(response['data']['key']);
|
|
|
572 |
|
|
|
573 |
$('#gridTableUploadUsers tbody').empty();
|
|
|
574 |
|
|
|
575 |
$.each(response['data']['items'], function(index, item) {
|
|
|
576 |
|
|
|
577 |
|
|
|
578 |
var s = '<tr>';
|
|
|
579 |
s = s + '<td>' + item['first_name'] + '</td>';
|
|
|
580 |
s = s + '<td>' + item['last_name'] + '</td>';
|
|
|
581 |
s = s + '<td>' + item['email'] + '</td>';
|
|
|
582 |
s = s + '<td>' + item['password'] + '</td>';
|
| 15460 |
efrain |
583 |
s = s + '<td>' + item['is_adult'] + '</td>';
|
| 1 |
www |
584 |
s = s + '</tr>';
|
|
|
585 |
|
|
|
586 |
$('#gridTableUploadUsers tbody').append(s);
|
|
|
587 |
|
|
|
588 |
|
|
|
589 |
});
|
|
|
590 |
|
|
|
591 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
592 |
$('#modalUploadUsers').modal('show');
|
|
|
593 |
|
|
|
594 |
|
|
|
595 |
|
|
|
596 |
} else {
|
| 15460 |
efrain |
597 |
validatorUploadUsers.resetForm();
|
| 1 |
www |
598 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
599 |
$.fn.showError(response['data']);
|
|
|
600 |
} else {
|
|
|
601 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
602 |
$.fn.showFormErrorValidator('#form-upload-users #' + fieldname, errors);
|
|
|
603 |
});
|
|
|
604 |
}
|
|
|
605 |
}
|
|
|
606 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
607 |
$.fn.showError(textStatus);
|
|
|
608 |
}).always(function() {
|
|
|
609 |
|
|
|
610 |
NProgress.done();
|
|
|
611 |
});
|
|
|
612 |
return false;
|
|
|
613 |
},
|
|
|
614 |
invalidHandler: function(form, validator) {
|
|
|
615 |
|
|
|
616 |
}
|
|
|
617 |
});
|
|
|
618 |
|
|
|
619 |
|
|
|
620 |
$('#form-upload-users #file').fileinput({
|
| 15460 |
efrain |
621 |
theme: 'fa',
|
| 1 |
www |
622 |
language: 'es',
|
|
|
623 |
showUpload: false,
|
|
|
624 |
dropZoneEnabled: false,
|
|
|
625 |
maxFileCount: 1,
|
|
|
626 |
allowedFileExtensions: ['xls', 'xlsx'],
|
|
|
627 |
});
|
|
|
628 |
|
|
|
629 |
$('body').on('click', 'button.btn-upload', function(e) {
|
|
|
630 |
e.preventDefault();
|
|
|
631 |
|
|
|
632 |
$('#form-upload-users #file').fileinput('reset');
|
|
|
633 |
$('#form-upload-users #file').val('');
|
|
|
634 |
|
|
|
635 |
$('#modalFormUploadUsers').modal('show');
|
|
|
636 |
});
|
|
|
637 |
|
|
|
638 |
$('body').on('click', 'button.btn-upload-users-step2', function(e) {
|
|
|
639 |
e.preventDefault();
|
|
|
640 |
NProgress.start();
|
|
|
641 |
|
|
|
642 |
$.ajax({
|
|
|
643 |
'dataType' : 'json',
|
|
|
644 |
'accept' : 'application/json',
|
|
|
645 |
'method' : 'post',
|
|
|
646 |
'url' : '$routeUpload',
|
|
|
647 |
'data' : {
|
|
|
648 |
'step' : 'process',
|
|
|
649 |
'key' : $('#table-upload-users-key').val(),
|
|
|
650 |
}
|
|
|
651 |
}).done(function(response) {
|
|
|
652 |
if(response['success']) {
|
| 15460 |
efrain |
653 |
if(response['data']['users_created'] == 1) {
|
|
|
654 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USER_CREATED');
|
| 1 |
www |
655 |
} else {
|
| 15460 |
efrain |
656 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USERS_CREATED');
|
| 1 |
www |
657 |
}
|
|
|
658 |
gridTable.api().ajax.reload(null, false);
|
|
|
659 |
$('#modalUploadUsers').modal('hide');
|
|
|
660 |
} else {
|
|
|
661 |
$.fn.showError(response['data']);
|
|
|
662 |
}
|
|
|
663 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
664 |
$.fn.showError(textStatus);
|
|
|
665 |
}).always(function() {
|
|
|
666 |
NProgress.done();
|
|
|
667 |
});
|
|
|
668 |
return false;
|
|
|
669 |
});
|
|
|
670 |
|
|
|
671 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
672 |
e.preventDefault();
|
|
|
673 |
|
|
|
674 |
var href = $(this).data('href');
|
|
|
675 |
$('#form-edit').attr('action', href);
|
|
|
676 |
|
|
|
677 |
NProgress.start();
|
|
|
678 |
$.ajax({
|
|
|
679 |
'dataType' : 'json',
|
|
|
680 |
'accept' : 'application/json',
|
|
|
681 |
'method' : 'get',
|
|
|
682 |
'url' : href,
|
|
|
683 |
}).done(function(response) {
|
|
|
684 |
if(response['success']) {
|
|
|
685 |
$('#form-edit #backend').prop('checked', response['data']['backend'] );
|
|
|
686 |
$('#table-roles tbody').empty();
|
|
|
687 |
|
|
|
688 |
$.each(response['data']['roles'], function(index, role) {
|
|
|
689 |
|
|
|
690 |
var checked = role['checked'] ? ' checked="checked" ' : '';
|
|
|
691 |
var s = '<tr>';
|
|
|
692 |
s = s + '<td>' + role['name'] + '</td>';
|
| 16927 |
efrain |
693 |
s = s + '<td><div class="form-check mb-3">';
|
| 16943 |
efrain |
694 |
s = s + '<input type="checkbox" value="1" class="form-check-input" id="checked' + role['id'] + '" name="checked' + role['id'] + '" ' + checked + '> ';
|
| 16927 |
efrain |
695 |
s = s + '<label class="form-check-label" > </label>';
|
|
|
696 |
s = s + '</div></td>';
|
| 1 |
www |
697 |
s = s + '</tr>';
|
|
|
698 |
|
|
|
699 |
$('#table-roles tbody').append(s);
|
|
|
700 |
|
|
|
701 |
});
|
|
|
702 |
|
|
|
703 |
$('#modalEdit').modal('show');
|
|
|
704 |
|
| 16926 |
efrain |
705 |
|
| 16927 |
efrain |
706 |
|
| 1 |
www |
707 |
} else {
|
|
|
708 |
$.fn.showError(response['data']);
|
|
|
709 |
}
|
|
|
710 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
711 |
$.fn.showError(textStatus);
|
|
|
712 |
}).always(function() {
|
|
|
713 |
NProgress.done();
|
|
|
714 |
});
|
|
|
715 |
|
|
|
716 |
});
|
|
|
717 |
|
|
|
718 |
$('#form-edit').submit(function (e) {
|
|
|
719 |
e.preventDefault();
|
|
|
720 |
NProgress.start();
|
|
|
721 |
$.ajax({
|
|
|
722 |
'dataType' : 'json',
|
|
|
723 |
'accept' : 'application/json',
|
|
|
724 |
'method' : 'post',
|
|
|
725 |
'url' : $('#form-edit').attr('action'),
|
|
|
726 |
'data' : $('#form-edit').serialize(),
|
|
|
727 |
}).done(function(response) {
|
|
|
728 |
if(response['success']) {
|
|
|
729 |
|
|
|
730 |
$.fn.showSuccess(response['data']);
|
|
|
731 |
$('#modalEdit').modal('hide');
|
|
|
732 |
gridTable.api().ajax.reload(null, false);
|
|
|
733 |
|
|
|
734 |
} else {
|
|
|
735 |
$.fn.showError(response['data']);
|
|
|
736 |
}
|
|
|
737 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
738 |
$.fn.showError(textStatus);
|
|
|
739 |
}).always(function() {
|
|
|
740 |
NProgress.done();
|
|
|
741 |
});
|
|
|
742 |
return false;
|
|
|
743 |
|
|
|
744 |
});
|
|
|
745 |
|
|
|
746 |
$('body').on('click', 'button.btn-cancel-modal', function(e) {
|
|
|
747 |
e.preventDefault();
|
|
|
748 |
$('#modalInvite').modal('hide');
|
|
|
749 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
750 |
$('#modalEdit').modal('hide');
|
|
|
751 |
$('#modalChangePassword').modal('hide');
|
|
|
752 |
});
|
|
|
753 |
|
|
|
754 |
var validatorChangePassword = $('#form-change-password').validate({
|
|
|
755 |
debug: true,
|
|
|
756 |
onclick: false,
|
|
|
757 |
onkeyup: false,
|
|
|
758 |
ignore: [':hidden'],
|
|
|
759 |
rules: {
|
|
|
760 |
|
|
|
761 |
'password': {
|
|
|
762 |
required: true,
|
|
|
763 |
minlength: 6,
|
|
|
764 |
maxlength: 16,
|
|
|
765 |
passwordStrengthCheck: true,
|
|
|
766 |
},
|
|
|
767 |
'confirmation' : {
|
|
|
768 |
required: true,
|
|
|
769 |
minlength: 6,
|
|
|
770 |
maxlength: 16,
|
|
|
771 |
equalTo: '#form-change-password #password'
|
|
|
772 |
},
|
|
|
773 |
},
|
|
|
774 |
submitHandler: function(form)
|
|
|
775 |
{
|
|
|
776 |
NProgress.start();
|
|
|
777 |
$.ajax({
|
|
|
778 |
'dataType' : 'json',
|
|
|
779 |
'accept' : 'application/json',
|
|
|
780 |
'method' : 'post',
|
|
|
781 |
'url' : $('#form-change-password').attr('action'),
|
|
|
782 |
'data' : $('#form-change-password').serialize()
|
|
|
783 |
}).done(function(response) {
|
|
|
784 |
if(response.success) {
|
|
|
785 |
$.fn.showSuccess(response.data);
|
|
|
786 |
|
|
|
787 |
$('#modalChangePassword').modal('hide');
|
|
|
788 |
gridTable.api().ajax.reload(null, false);
|
|
|
789 |
} else {
|
|
|
790 |
if(jQuery.type(response.data) == 'string') {
|
|
|
791 |
$.fn.showError(response.data)
|
|
|
792 |
} else {
|
|
|
793 |
$.each(response.data, function( fieldname, errors ) {
|
|
|
794 |
$.fn.showFormErrorValidator('#form-change-password #' + fieldname, errors);
|
|
|
795 |
});
|
|
|
796 |
}
|
|
|
797 |
}
|
|
|
798 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
799 |
$.fn.showError(textStatus)
|
|
|
800 |
|
|
|
801 |
}).always(function() {
|
|
|
802 |
NProgress.done();
|
|
|
803 |
})
|
|
|
804 |
},
|
|
|
805 |
invalidHandler: function(form, validator) {
|
|
|
806 |
}
|
|
|
807 |
});
|
|
|
808 |
|
|
|
809 |
$('body').on('click', 'button.btn-change-password', function(e) {
|
|
|
810 |
e.preventDefault();
|
|
|
811 |
|
|
|
812 |
NProgress.start();
|
|
|
813 |
var action = $(this).data('href');
|
|
|
814 |
|
|
|
815 |
$.ajax({
|
|
|
816 |
'dataType' : 'json',
|
|
|
817 |
'accept' : 'application/json',
|
|
|
818 |
'method' : 'get',
|
|
|
819 |
'url' : action,
|
|
|
820 |
}).done(function(response) {
|
|
|
821 |
if(response['success']) {
|
|
|
822 |
|
|
|
823 |
$('#form-change-password').attr('action', action);
|
|
|
824 |
$('#form-change-password #first_name').val(response['data']['first_name']);
|
|
|
825 |
$('#form-change-password #last_name').val(response['data']['last_name']);
|
|
|
826 |
$('#form-change-password #email').val(response['data']['email']);
|
|
|
827 |
$('#form-change-password #password').val('');
|
|
|
828 |
$('#form-change-password #confirmation').val('');
|
|
|
829 |
validatorChangePassword.resetForm();
|
|
|
830 |
|
|
|
831 |
$('#modalChangePassword').modal('show');
|
|
|
832 |
} else {
|
|
|
833 |
$.fn.showError(response['data']);
|
|
|
834 |
}
|
|
|
835 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
836 |
$.fn.showError(textStatus);
|
|
|
837 |
}).always(function() {
|
|
|
838 |
NProgress.done();
|
|
|
839 |
});
|
|
|
840 |
|
|
|
841 |
});
|
|
|
842 |
|
| 17330 |
ariadna |
843 |
// Re-inicializar autoComplete cuando el modal se muestre
|
|
|
844 |
$('#modalInvite').on('shown.bs.modal', function() {
|
|
|
845 |
console.log('Modal shown, re-initializing autoComplete...'); // Debug
|
|
|
846 |
setTimeout(function() {
|
|
|
847 |
initializeAutoComplete();
|
|
|
848 |
}, 100);
|
|
|
849 |
});
|
| 1 |
www |
850 |
|
|
|
851 |
});
|
|
|
852 |
JS;
|
|
|
853 |
$this->inlineScript()->captureEnd();
|
| 15333 |
stevensc |
854 |
?>
|
|
|
855 |
|
| 1 |
www |
856 |
|
|
|
857 |
|
| 16840 |
efrain |
858 |
<div class="container">
|
| 17328 |
ariadna |
859 |
<div class="card">
|
|
|
860 |
<div class="card-header">
|
|
|
861 |
<h6 class="card-title">LABEL_USERS_FOR_COMPANY</h6>
|
|
|
862 |
</div>
|
|
|
863 |
<div class="card-body">
|
|
|
864 |
|
|
|
865 |
|
|
|
866 |
<form name="form-filter" id="form-filter">
|
|
|
867 |
<div class="row">
|
|
|
868 |
<div class="col-12 mt-3">
|
|
|
869 |
<label for="status">LABEL_STATUS</label>
|
|
|
870 |
<select id="status" name="status" class="form-control">
|
|
|
871 |
<option value="">LABEL_ALL</option>
|
|
|
872 |
<option value="<?php echo CompanyUser::STATUS_PENDING ?>">LABEL_PENDING</option>
|
|
|
873 |
<option value="<?php echo CompanyUser::STATUS_ACCEPTED ?>">LABEL_ACCEPTED</option>
|
|
|
874 |
<option value="<?php echo CompanyUser::STATUS_ADMIN_WILL_ADD ?>">LABEL_ADMIN_WILL_ADD</option>
|
|
|
875 |
<option value="<?php echo CompanyUser::STATUS_SENT ?>">LABEL_INVITED</option>
|
| 16912 |
efrain |
876 |
<option value="<?php echo CompanyUser::STATUS_CANCELLED ?>">LABEL_CANCELLED</option>
|
| 17328 |
ariadna |
877 |
<option value="<?php echo CompanyUser::STATUS_REJECTED ?>">LABEL_REJECTED</option>
|
|
|
878 |
</select>
|
|
|
879 |
</div>
|
|
|
880 |
</div>
|
|
|
881 |
</form>
|
|
|
882 |
<div class="row">
|
|
|
883 |
<div class="col-12 mt-3">
|
|
|
884 |
<table id="gridTable" class="table table-bordered">
|
| 16912 |
efrain |
885 |
<thead>
|
| 17328 |
ariadna |
886 |
<tr>
|
|
|
887 |
<th>LABEL_FIRST_NAME</th>
|
|
|
888 |
<th>LABEL_LAST_NAME</th>
|
|
|
889 |
<th>LABEL_EMAIL</th>
|
|
|
890 |
<th>LABEL_DETAILS</th>
|
|
|
891 |
<th>LABEL_ACTIONS</th>
|
|
|
892 |
</tr>
|
|
|
893 |
</thead>
|
|
|
894 |
<tbody>
|
|
|
895 |
</tbody>
|
|
|
896 |
</table>
|
|
|
897 |
</div>
|
| 16912 |
efrain |
898 |
</div>
|
| 15333 |
stevensc |
899 |
</div>
|
| 17328 |
ariadna |
900 |
<div class="card-footer text-right">
|
|
|
901 |
<button type="button" class="btn btn-sm btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH</button>
|
|
|
902 |
<?php if ($allowUpload) : ?>
|
|
|
903 |
<button type="button" class="btn btn-sm btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button>
|
|
|
904 |
<?php endif; ?>
|
|
|
905 |
<?php if ($allowInvite) : ?>
|
|
|
906 |
<button type="button" class="btn btn-sm btn-primary btn-invite"><i class="fa fa-plus"></i> LABEL_INVITE </button>
|
|
|
907 |
<?php endif; ?>
|
|
|
908 |
</div>
|
|
|
909 |
</div>
|
| 16840 |
efrain |
910 |
</div>
|
| 15333 |
stevensc |
911 |
|
|
|
912 |
|
| 1 |
www |
913 |
<!-- The Modal -->
|
|
|
914 |
<div class="modal" id="modalInvite">
|
| 15333 |
stevensc |
915 |
<div class="modal-dialog modal-xl">
|
|
|
916 |
<div class="modal-content">
|
| 1 |
www |
917 |
|
|
|
918 |
<!-- Modal Header -->
|
| 15333 |
stevensc |
919 |
<div class="modal-header">
|
| 16935 |
efrain |
920 |
<h6 class="modal-title">LABEL_INVITE</h6>
|
| 15333 |
stevensc |
921 |
</div>
|
| 1 |
www |
922 |
|
|
|
923 |
<!-- Modal body -->
|
| 16840 |
efrain |
924 |
<form name="form-invite" id="form-invite">
|
| 17328 |
ariadna |
925 |
<div class="modal-body">
|
|
|
926 |
|
| 15333 |
stevensc |
927 |
<input type="hidden" name="user_uuid_selected" id="user_uuid_selected" />
|
| 16840 |
efrain |
928 |
<div class="row">
|
| 17328 |
ariadna |
929 |
<div class="col-12 mt-3">
|
|
|
930 |
<label for="user_uuid">LABEL_USER (LABEL_MIN_LENGTH_3)</label>
|
|
|
931 |
<br />
|
| 17337 |
stevensc |
932 |
<input class="form-control" name="user_uuid" id="user_uuid" autocomplete="off" data-noresults-text="LABEL_AUTOCOMPLETE_USERS_NOT_FOUND">
|
| 17328 |
ariadna |
933 |
</div>
|
|
|
934 |
</div>
|
| 1 |
www |
935 |
|
|
|
936 |
|
| 17328 |
ariadna |
937 |
|
|
|
938 |
|
|
|
939 |
</div>
|
|
|
940 |
<div class="modal-footer text-right">
|
|
|
941 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_INVITE</button>
|
|
|
942 |
<button type="button" class="btn btn-sm btn-light btn-cancel-modal">LABEL_CANCEL</button>
|
|
|
943 |
</div>
|
| 16840 |
efrain |
944 |
</form>
|
| 15333 |
stevensc |
945 |
</div>
|
|
|
946 |
</div>
|
|
|
947 |
</div>
|
| 1 |
www |
948 |
|
|
|
949 |
|
| 15333 |
stevensc |
950 |
|
| 1 |
www |
951 |
<!-- The Modal -->
|
|
|
952 |
<div class="modal" id="modalFormUploadUsers">
|
| 15333 |
stevensc |
953 |
<div class="modal-dialog modal-xl">
|
|
|
954 |
<div class="modal-content">
|
| 1 |
www |
955 |
|
|
|
956 |
<!-- Modal Header -->
|
| 15333 |
stevensc |
957 |
<div class="modal-header">
|
| 16935 |
efrain |
958 |
<h6 class="modal-title">LABEL_UPLOAD</h6>
|
| 15333 |
stevensc |
959 |
</div>
|
| 1 |
www |
960 |
|
| 17328 |
ariadna |
961 |
<?php
|
|
|
962 |
$form = $this->formUploadUsers;
|
|
|
963 |
$form->setAttributes([
|
|
|
964 |
'method' => 'post',
|
|
|
965 |
'name' => 'form-upload-users',
|
|
|
966 |
'id' => 'form-upload-users'
|
|
|
967 |
]);
|
| 1 |
www |
968 |
|
| 17328 |
ariadna |
969 |
$form->prepare();
|
|
|
970 |
echo $this->form()->openTag($form);
|
|
|
971 |
?>
|
| 16840 |
efrain |
972 |
<!-- Modal body -->
|
|
|
973 |
<div class="modal-body">
|
| 15333 |
stevensc |
974 |
|
| 17328 |
ariadna |
975 |
|
| 16840 |
efrain |
976 |
<div class="row">
|
| 17328 |
ariadna |
977 |
<div class="col-12 mt-3">
|
| 15333 |
stevensc |
978 |
|
|
|
979 |
|
|
|
980 |
<?php
|
| 17328 |
ariadna |
981 |
$element = $form->get('file');
|
|
|
982 |
$element->setOptions(['label' => 'LABEL_EXCEL']);
|
|
|
983 |
echo $this->formLabel($element);
|
|
|
984 |
?>
|
|
|
985 |
<div class="file-loading">
|
|
|
986 |
<?php
|
| 16816 |
stevensc |
987 |
|
| 17328 |
ariadna |
988 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel']);
|
|
|
989 |
echo $this->formFile($element);
|
|
|
990 |
?>
|
| 16840 |
efrain |
991 |
</div>
|
| 15333 |
stevensc |
992 |
</div>
|
|
|
993 |
</div>
|
| 1 |
www |
994 |
|
|
|
995 |
|
|
|
996 |
|
| 17328 |
ariadna |
997 |
|
| 16840 |
efrain |
998 |
</div>
|
| 17328 |
ariadna |
999 |
<div class="modal-footer text-right">
|
|
|
1000 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_UPLOAD</button>
|
|
|
1001 |
<button type="button" class="btn btn-sm btn-light btn-cancel-modal">LABEL_CANCEL</button>
|
|
|
1002 |
</div>
|
|
|
1003 |
<?php echo $this->form()->closeTag($form); ?>
|
| 15333 |
stevensc |
1004 |
</div>
|
|
|
1005 |
</div>
|
|
|
1006 |
</div>
|
| 1 |
www |
1007 |
|
|
|
1008 |
|
| 15333 |
stevensc |
1009 |
|
| 1 |
www |
1010 |
<!-- The Modal -->
|
|
|
1011 |
<div class="modal" id="modalUploadUsers">
|
| 15333 |
stevensc |
1012 |
<div class="modal-dialog modal-xl">
|
|
|
1013 |
<div class="modal-content">
|
| 1 |
www |
1014 |
|
|
|
1015 |
<!-- Modal Header -->
|
| 15333 |
stevensc |
1016 |
<div class="modal-header">
|
| 16935 |
efrain |
1017 |
<h6 class="modal-title">LABEL_USERS_FOR_COMPANY</h6>
|
| 16822 |
efrain |
1018 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15333 |
stevensc |
1019 |
</div>
|
| 1 |
www |
1020 |
|
|
|
1021 |
<!-- Modal body -->
|
| 15333 |
stevensc |
1022 |
<div class="modal-body">
|
|
|
1023 |
<form>
|
|
|
1024 |
<input type="hidden" name="table-upload-users-key" id="table-upload-users-key">
|
|
|
1025 |
</form>
|
| 16840 |
efrain |
1026 |
<div class="row">
|
| 17328 |
ariadna |
1027 |
<div class="col-12 mt-3" style="height: 300px;overflow: scroll;">
|
|
|
1028 |
<table id="gridTableUploadUsers" style="width: 100%" class="table table-bordered">
|
| 16840 |
efrain |
1029 |
<thead>
|
|
|
1030 |
<tr>
|
|
|
1031 |
<th>LABEL_FIRST_NAME</th>
|
|
|
1032 |
<th>LABEL_LAST_NAME</th>
|
|
|
1033 |
<th>LABEL_EMAIL</th>
|
|
|
1034 |
<th>LABEL_PASSWORD</th>
|
|
|
1035 |
<th>LABEL_IS_ADULT</th>
|
|
|
1036 |
</tr>
|
|
|
1037 |
</thead>
|
|
|
1038 |
<tbody>
|
|
|
1039 |
</tbody>
|
|
|
1040 |
</table>
|
| 17328 |
ariadna |
1041 |
|
|
|
1042 |
</div>
|
| 15333 |
stevensc |
1043 |
</div>
|
| 1 |
www |
1044 |
|
| 16840 |
efrain |
1045 |
|
| 15333 |
stevensc |
1046 |
</div>
|
|
|
1047 |
|
| 1 |
www |
1048 |
<!-- Modal footer -->
|
| 16891 |
efrain |
1049 |
<div class="modal-footer text-right">
|
| 15333 |
stevensc |
1050 |
<button type="submit" class="btn btn-sm btn-primary btn-upload-users-step2">LABEL_SAVE</button>
|
|
|
1051 |
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
|
|
|
1052 |
</div>
|
| 1 |
www |
1053 |
|
| 15333 |
stevensc |
1054 |
</div>
|
|
|
1055 |
</div>
|
|
|
1056 |
</div>
|
| 1 |
www |
1057 |
|
|
|
1058 |
|
|
|
1059 |
<!-- The Modal -->
|
|
|
1060 |
<div class="modal" id="modalEdit">
|
| 15333 |
stevensc |
1061 |
<div class="modal-dialog modal-xl">
|
|
|
1062 |
<div class="modal-content">
|
| 1 |
www |
1063 |
|
|
|
1064 |
<!-- Modal Header -->
|
| 15333 |
stevensc |
1065 |
<div class="modal-header">
|
| 16935 |
efrain |
1066 |
<h6 class="modal-title">LABEL_USER_FOR_COMPANY - LABEL_EDIT</h6>
|
| 15333 |
stevensc |
1067 |
</div>
|
| 1 |
www |
1068 |
|
| 17328 |
ariadna |
1069 |
<form name="form-edit" id="form-edit">
|
|
|
1070 |
<!-- Modal body -->
|
|
|
1071 |
<div class="modal-body">
|
|
|
1072 |
|
| 15333 |
stevensc |
1073 |
<div class="row">
|
| 16841 |
efrain |
1074 |
<div class="col-md-12 col-sm-12 mt-3">
|
| 17328 |
ariadna |
1075 |
<div class="form-check mb-3">
|
|
|
1076 |
<input type="checkbox" name="backend" id="backend" value="y" class="form-check-input" style="width: 20px; height: 20px"> <label for="backend" class="form-check-label">LABEL_ACCESS_BACKEND</label>
|
|
|
1077 |
|
| 15333 |
stevensc |
1078 |
</div>
|
|
|
1079 |
</div>
|
|
|
1080 |
</div>
|
|
|
1081 |
<div class="row">
|
| 16841 |
efrain |
1082 |
<div class="col-md-12 col-sm-12 mt-3">
|
| 16822 |
efrain |
1083 |
<table id="table-roles" class="table table-bordered">
|
| 15333 |
stevensc |
1084 |
<thead>
|
|
|
1085 |
<tr>
|
|
|
1086 |
<th>LABEL_NAME</th>
|
|
|
1087 |
<th>LABEL_ACTIVE</th>
|
|
|
1088 |
</tr>
|
|
|
1089 |
</thead>
|
|
|
1090 |
<tbody>
|
|
|
1091 |
</tbody>
|
|
|
1092 |
</table>
|
| 1 |
www |
1093 |
|
| 15333 |
stevensc |
1094 |
</div>
|
|
|
1095 |
</div>
|
|
|
1096 |
|
| 17328 |
ariadna |
1097 |
|
|
|
1098 |
</div>
|
|
|
1099 |
<div class="modal-footer text-right">
|
|
|
1100 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_SAVE</button>
|
|
|
1101 |
<button type="button" class="btn btn-sm btn-light btn-cancel-modal">LABEL_CANCEL</button>
|
|
|
1102 |
</div>
|
|
|
1103 |
</form>
|
| 15333 |
stevensc |
1104 |
</div>
|
|
|
1105 |
</div>
|
| 1 |
www |
1106 |
</div>
|
|
|
1107 |
|
|
|
1108 |
|
|
|
1109 |
|
|
|
1110 |
<!-- The Modal -->
|
|
|
1111 |
<div class="modal" id="modalChangePassword">
|
| 15333 |
stevensc |
1112 |
<div class="modal-dialog">
|
|
|
1113 |
<div class="modal-content">
|
| 1 |
www |
1114 |
|
|
|
1115 |
<!-- Modal Header -->
|
| 15333 |
stevensc |
1116 |
<div class="modal-header">
|
| 16935 |
efrain |
1117 |
<h6 class="modal-title">LABEL_USERS</h6>
|
| 15333 |
stevensc |
1118 |
</div>
|
| 1 |
www |
1119 |
|
| 17328 |
ariadna |
1120 |
<?php
|
|
|
1121 |
$form = $this->formChangePassword;
|
|
|
1122 |
$form->setAttributes([
|
|
|
1123 |
'method' => 'post',
|
|
|
1124 |
'name' => 'form-change-password',
|
|
|
1125 |
'id' => 'form-change-password'
|
|
|
1126 |
]);
|
| 1 |
www |
1127 |
|
| 17328 |
ariadna |
1128 |
$form->prepare();
|
|
|
1129 |
echo $this->form()->openTag($form);
|
|
|
1130 |
?>
|
| 16929 |
efrain |
1131 |
<div class="modal-body">
|
| 1 |
www |
1132 |
|
| 17328 |
ariadna |
1133 |
<div class="row">
|
|
|
1134 |
<div class="col-12 mt-3">
|
|
|
1135 |
<?php
|
|
|
1136 |
$element = $form->get('first_name');
|
|
|
1137 |
$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
|
|
|
1138 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
|
|
1139 |
|
|
|
1140 |
echo $this->formLabel($element);
|
|
|
1141 |
echo $this->formText($element);
|
|
|
1142 |
?>
|
| 16929 |
efrain |
1143 |
</div>
|
| 15333 |
stevensc |
1144 |
</div>
|
| 17328 |
ariadna |
1145 |
<div class="row">
|
|
|
1146 |
<div class="col-12 mt-3">
|
|
|
1147 |
<?php
|
|
|
1148 |
$element = $form->get('last_name');
|
|
|
1149 |
$element->setOptions(['label' => 'LABEL_LAST_NAME']);
|
|
|
1150 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 1 |
www |
1151 |
|
| 17328 |
ariadna |
1152 |
echo $this->formLabel($element);
|
|
|
1153 |
echo $this->formText($element);
|
|
|
1154 |
?>
|
| 16929 |
efrain |
1155 |
</div>
|
| 15333 |
stevensc |
1156 |
</div>
|
| 17328 |
ariadna |
1157 |
<div class="row">
|
|
|
1158 |
<div class="col-12 mt-3">
|
|
|
1159 |
<?php
|
|
|
1160 |
$element = $form->get('email');
|
|
|
1161 |
$element->setOptions(['label' => 'LABEL_EMAIL']);
|
|
|
1162 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 1 |
www |
1163 |
|
| 17328 |
ariadna |
1164 |
echo $this->formLabel($element);
|
|
|
1165 |
echo $this->formText($element);
|
|
|
1166 |
?>
|
| 16929 |
efrain |
1167 |
</div>
|
| 15333 |
stevensc |
1168 |
</div>
|
| 17328 |
ariadna |
1169 |
<div class="row">
|
|
|
1170 |
<div class="col-12 mt-3">
|
|
|
1171 |
<?php
|
|
|
1172 |
$element = $form->get('password');
|
|
|
1173 |
$element->setOptions(['label' => 'LABEL_PASSWORD']);
|
|
|
1174 |
$element->setAttributes(['class' => 'form-control']);
|
| 1 |
www |
1175 |
|
| 17328 |
ariadna |
1176 |
echo $this->formLabel($element);
|
|
|
1177 |
echo $this->formPassword($element);
|
|
|
1178 |
?>
|
| 16929 |
efrain |
1179 |
</div>
|
| 15333 |
stevensc |
1180 |
</div>
|
| 17328 |
ariadna |
1181 |
<div class="row">
|
|
|
1182 |
<div class="col-12 mt-3">
|
|
|
1183 |
<?php
|
|
|
1184 |
$element = $form->get('confirmation');
|
|
|
1185 |
$element->setOptions(['label' => 'LABEL_CONFIRMATION']);
|
|
|
1186 |
$element->setAttributes(['class' => 'form-control']);
|
| 1 |
www |
1187 |
|
| 17328 |
ariadna |
1188 |
echo $this->formLabel($element);
|
|
|
1189 |
echo $this->formPassword($element);
|
|
|
1190 |
?>
|
| 16929 |
efrain |
1191 |
</div>
|
| 15333 |
stevensc |
1192 |
</div>
|
|
|
1193 |
|
|
|
1194 |
|
| 17328 |
ariadna |
1195 |
|
| 16929 |
efrain |
1196 |
</div>
|
|
|
1197 |
<div class="modal-footer text-right">
|
| 17328 |
ariadna |
1198 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_SAVE</button>
|
|
|
1199 |
<button type="button" class="btn btn-sm btn-light btn-cancel-modal">LABEL_CANCEL</button>
|
|
|
1200 |
</div>
|
|
|
1201 |
<?php echo $this->form()->closeTag($form); ?>
|
| 15333 |
stevensc |
1202 |
|
|
|
1203 |
</div>
|
|
|
1204 |
</div>
|
|
|
1205 |
</div>
|