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