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