| 16815 |
stevensc |
1 |
<?php
|
| 1 |
www |
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
//$routeAdd = $this->url('users/add');
|
|
|
9 |
$routeDatatable = $this->url('users');
|
|
|
10 |
$routeDashboard = $this->url('dashboard');
|
| 15460 |
efrain |
11 |
$routeUpload = $this->url('users/upload');
|
| 1 |
www |
12 |
|
|
|
13 |
|
|
|
14 |
$allowChangePassword = $acl->isAllowed($roleName, 'users/change-password') ? 1 : 0;
|
|
|
15 |
$allowUnblock = $acl->isAllowed($roleName, 'users/unblock') ? 1 : 0;
|
| 15460 |
efrain |
16 |
$allowUpload = $acl->isAllowed($roleName, 'users/upload') ? 1 : 0;
|
| 16248 |
efrain |
17 |
$allowChangeType = $acl->isAllowed($roleName, 'users/change-type') ? 1 : 0;
|
| 1 |
www |
18 |
|
| 16822 |
efrain |
19 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
20 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
| 1 |
www |
21 |
|
| 16822 |
efrain |
22 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
| 1 |
www |
23 |
|
|
|
24 |
|
|
|
25 |
|
| 16929 |
efrain |
26 |
|
|
|
27 |
|
|
|
28 |
|
| 16822 |
efrain |
29 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
30 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
| 1 |
www |
31 |
|
| 16822 |
efrain |
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
34 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
| 1 |
www |
36 |
|
|
|
37 |
|
| 16822 |
efrain |
38 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
39 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 1 |
www |
40 |
|
|
|
41 |
|
|
|
42 |
|
| 15460 |
efrain |
43 |
|
| 16822 |
efrain |
44 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
45 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.css'));
|
| 15460 |
efrain |
46 |
|
| 16843 |
efrain |
47 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
48 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
| 16822 |
efrain |
49 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
50 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
51 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fa/theme.js'));
|
|
|
52 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fa/theme.js'));
|
|
|
53 |
|
|
|
54 |
|
| 1 |
www |
55 |
$status_active = \LeadersLinked\Model\User::STATUS_ACTIVE;
|
|
|
56 |
|
|
|
57 |
$blocked = \LeadersLinked\Model\User::BLOCKED_YES;
|
|
|
58 |
|
|
|
59 |
$email_verified = \LeadersLinked\Model\User::EMAIL_VERIFIED_YES;
|
|
|
60 |
|
|
|
61 |
$this->inlineScript()->captureStart();
|
|
|
62 |
echo <<<JS
|
|
|
63 |
jQuery( document ).ready(function( $ ) {
|
|
|
64 |
$.validator.addMethod('passwordStrengthCheck', function(value) {
|
|
|
65 |
return /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$^x%x*-]).{6,16}$/.test(value)
|
|
|
66 |
}, 'ERROR_PASSWORD_STRENGTH');
|
|
|
67 |
|
|
|
68 |
$.validator.setDefaults({
|
|
|
69 |
debug: true,
|
|
|
70 |
highlight: function(element) {
|
|
|
71 |
$(element).closest('.sn-field').addClass('sn-field-has-error');
|
|
|
72 |
},
|
|
|
73 |
unhighlight: function(element) {
|
|
|
74 |
$(element).closest('.sn-field').removeClass('sn-field-has-error');
|
|
|
75 |
},
|
|
|
76 |
errorElement: 'div',
|
|
|
77 |
errorClass: 'sn-field-invalid-feedback',
|
|
|
78 |
errorPlacement: function(error, element) {
|
|
|
79 |
console.log(element);
|
|
|
80 |
|
|
|
81 |
if(element.parent('.sn-field').length) {
|
|
|
82 |
error.insertAfter(element.parent());
|
|
|
83 |
} else if (element.parent('.fgt-sec').length) {
|
|
|
84 |
error.insertAfter(element.parent());
|
|
|
85 |
} else {
|
|
|
86 |
error.insertAfter(element);
|
|
|
87 |
}
|
|
|
88 |
}
|
|
|
89 |
});
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
var allowChangePassword = $allowChangePassword;
|
|
|
94 |
var allowUnblock = $allowUnblock;
|
| 16248 |
efrain |
95 |
var allowChangeType = $allowChangeType;
|
| 1 |
www |
96 |
|
|
|
97 |
|
|
|
98 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
99 |
'processing': true,
|
|
|
100 |
'serverSide': true,
|
|
|
101 |
'searching': true,
|
|
|
102 |
'order': [[ 1, 'asc' ]],
|
|
|
103 |
'ordering': true,
|
|
|
104 |
'ordenable' : true,
|
|
|
105 |
'responsive': true,
|
|
|
106 |
'select' : false,
|
|
|
107 |
'paging': true,
|
|
|
108 |
'pagingType': 'simple_numbers',
|
|
|
109 |
'ajax': {
|
|
|
110 |
'url' : '$routeDatatable',
|
|
|
111 |
'type' : 'get',
|
|
|
112 |
'beforeSend': function (request) {
|
|
|
113 |
NProgress.start();
|
|
|
114 |
},
|
| 16299 |
efrain |
115 |
'data' : function(data) {
|
|
|
116 |
data.network_id = $('#form-filter #network_id').val();
|
|
|
117 |
} ,
|
| 1 |
www |
118 |
'dataFilter': function(response) {
|
|
|
119 |
var response = jQuery.parseJSON( response );
|
|
|
120 |
|
|
|
121 |
var json = {};
|
|
|
122 |
json.recordsTotal = 0;
|
|
|
123 |
json.recordsFiltered = 0;
|
|
|
124 |
json.data = [];
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
if(response.success) {
|
|
|
128 |
json.recordsTotal = response.data.total;
|
|
|
129 |
json.recordsFiltered = response.data.total;
|
|
|
130 |
json.data = response.data.items;
|
|
|
131 |
} else {
|
|
|
132 |
$.fn.showError(response.data)
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
return JSON.stringify( json );
|
|
|
136 |
}
|
|
|
137 |
},
|
|
|
138 |
'language' : {
|
|
|
139 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
140 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
141 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
142 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
143 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
144 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
145 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
146 |
'sInfoPostFix': '',
|
|
|
147 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
148 |
'sUrl': '',
|
|
|
149 |
'sInfoThousands': ',',
|
|
|
150 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
151 |
'oPaginate': {
|
|
|
152 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
153 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
154 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
155 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
156 |
},
|
|
|
157 |
'oAria': {
|
|
|
158 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
159 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
160 |
},
|
|
|
161 |
},
|
|
|
162 |
'drawCallback': function( settings ) {
|
|
|
163 |
NProgress.done();
|
| 16822 |
efrain |
164 |
|
| 1 |
www |
165 |
},
|
|
|
166 |
'aoColumns': [
|
|
|
167 |
{ 'mDataProp': 'first_name' },
|
|
|
168 |
{ 'mDataProp': 'last_name' },
|
|
|
169 |
{ 'mDataProp': 'email' },
|
|
|
170 |
{ 'mDataProp': 'details' },
|
|
|
171 |
{ 'mDataProp': 'actions' },
|
|
|
172 |
],
|
|
|
173 |
'columnDefs': [
|
|
|
174 |
{
|
|
|
175 |
'targets': 0,
|
|
|
176 |
'className' : 'text-vertical-middle',
|
|
|
177 |
'render' : function ( data, type, row ) {
|
| 16299 |
efrain |
178 |
if(row['actions']['link_profile']) {
|
|
|
179 |
var s = data + '<br>';
|
| 16932 |
efrain |
180 |
s = s + '<button class="btn btn-default btn-view-profile" data-href="' +row['actions']['link_profile']+ '"><i class="fa fa-external-link-alt"></button>';
|
| 16299 |
efrain |
181 |
|
|
|
182 |
} else {
|
|
|
183 |
var s = data;
|
|
|
184 |
|
|
|
185 |
}
|
|
|
186 |
|
| 1 |
www |
187 |
return s;
|
|
|
188 |
}
|
|
|
189 |
},
|
|
|
190 |
{
|
|
|
191 |
'targets': 1,
|
|
|
192 |
'className' : 'text-vertical-middle',
|
|
|
193 |
},
|
|
|
194 |
{
|
|
|
195 |
'targets': 2,
|
|
|
196 |
'className' : 'text-vertical-middle',
|
|
|
197 |
},
|
|
|
198 |
{
|
|
|
199 |
'targets': -2,
|
|
|
200 |
'orderable': false,
|
|
|
201 |
'render' : function ( data, type, row ) {
|
|
|
202 |
var s = 'LABEL_STATUS : ' + data['status'] + '<br>';
|
|
|
203 |
s = s + 'LABEL_BLOCKED : ' + data['blocked'] + '<br>';
|
|
|
204 |
s = s + 'LABEL_EMAIL_VERIFIED : ' + data['email_verified'] + '<br>';
|
|
|
205 |
s = s + 'LABEL_LOGIN_ATTEMP : ' + data['login_attempt'] + '<br>';
|
| 16248 |
efrain |
206 |
s = s + 'LABEL_TYPE : ' + data['user_type'] + '<br>';
|
| 1 |
www |
207 |
return s;
|
|
|
208 |
}
|
|
|
209 |
},
|
|
|
210 |
{
|
|
|
211 |
'targets': -1,
|
|
|
212 |
'orderable': false,
|
|
|
213 |
'render' : function ( data, type, row ) {
|
|
|
214 |
s = '';
|
|
|
215 |
|
|
|
216 |
if(allowChangePassword && data['link_change_password']) {
|
|
|
217 |
s = s + '<button class="btn btn-primary btn-change-password" data-href="' + data['link_change_password']+ '" data-toggle="tooltip" title="LABEL_CHANGE_PASSWORD"><i class="fa fa-key"></i> LABEL_PASSWORD </button> ';
|
|
|
218 |
}
|
|
|
219 |
if(allowUnblock && data['link_unblock']) {
|
|
|
220 |
s = s + '<button class="btn btn-info btn-unblock" data-href="' + data['link_unblock']+ '" data-toggle="tooltip" title="LABEL_UNBLOCK"><i class="fa fa-unlock"></i> LABEL_UNBLOCK </button> ';
|
|
|
221 |
}
|
| 16248 |
efrain |
222 |
if(allowChangeType && data['link_change_type']) {
|
| 17179 |
ariadna |
223 |
s = s + '<button class="btn btn-info btn-change-type" data-href="' + data['link_change_type']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-superpowers"></i> LABEL_EDIT </button> ';
|
| 16248 |
efrain |
224 |
}
|
|
|
225 |
|
|
|
226 |
|
| 1 |
www |
227 |
return s;
|
|
|
228 |
}
|
|
|
229 |
}
|
|
|
230 |
|
|
|
231 |
],
|
|
|
232 |
});
|
|
|
233 |
|
|
|
234 |
var validatorChangePassword = $('#form-change-password').validate({
|
|
|
235 |
debug: true,
|
|
|
236 |
onclick: false,
|
|
|
237 |
onkeyup: false,
|
|
|
238 |
ignore: [':hidden'],
|
|
|
239 |
rules: {
|
|
|
240 |
|
|
|
241 |
'password': {
|
|
|
242 |
required: true,
|
|
|
243 |
minlength: 6,
|
|
|
244 |
maxlength: 16,
|
|
|
245 |
passwordStrengthCheck: true,
|
|
|
246 |
},
|
|
|
247 |
'confirmation' : {
|
|
|
248 |
required: true,
|
|
|
249 |
minlength: 6,
|
|
|
250 |
maxlength: 16,
|
|
|
251 |
equalTo: '#form-change-password #password'
|
|
|
252 |
},
|
|
|
253 |
},
|
|
|
254 |
submitHandler: function(form)
|
|
|
255 |
{
|
|
|
256 |
NProgress.start();
|
|
|
257 |
$.ajax({
|
|
|
258 |
'dataType' : 'json',
|
|
|
259 |
'accept' : 'application/json',
|
|
|
260 |
'method' : 'post',
|
|
|
261 |
'url' : $('#form-change-password').attr('action'),
|
|
|
262 |
'data' : $('#form-change-password').serialize()
|
|
|
263 |
}).done(function(response) {
|
|
|
264 |
if(response.success) {
|
|
|
265 |
$.fn.showSuccess(response.data);
|
|
|
266 |
|
|
|
267 |
$('#modalChangePassword').modal('hide');
|
|
|
268 |
gridTable.api().ajax.reload(null, false);
|
|
|
269 |
} else {
|
|
|
270 |
if(jQuery.type(response.data) == 'string') {
|
|
|
271 |
$.fn.showError(response.data)
|
|
|
272 |
} else {
|
|
|
273 |
$.each(response.data, function( fieldname, errors ) {
|
|
|
274 |
$.fn.showFormErrorValidator('#form-change-password #' + fieldname, errors);
|
|
|
275 |
});
|
|
|
276 |
}
|
|
|
277 |
}
|
|
|
278 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
279 |
$.fn.showError(textStatus)
|
|
|
280 |
|
|
|
281 |
}).always(function() {
|
|
|
282 |
NProgress.done();
|
|
|
283 |
})
|
|
|
284 |
},
|
|
|
285 |
invalidHandler: function(form, validator) {
|
|
|
286 |
}
|
|
|
287 |
});
|
|
|
288 |
|
|
|
289 |
$('body').on('click', 'button.btn-change-password', function(e) {
|
|
|
290 |
e.preventDefault();
|
|
|
291 |
|
|
|
292 |
NProgress.start();
|
|
|
293 |
var action = $(this).data('href');
|
|
|
294 |
|
|
|
295 |
$.ajax({
|
|
|
296 |
'dataType' : 'json',
|
|
|
297 |
'accept' : 'application/json',
|
|
|
298 |
'method' : 'get',
|
|
|
299 |
'url' : action,
|
|
|
300 |
}).done(function(response) {
|
|
|
301 |
if(response['success']) {
|
|
|
302 |
|
|
|
303 |
$('#form-change-password').attr('action', action);
|
|
|
304 |
$('#form-change-password #first_name').val(response['data']['first_name']);
|
|
|
305 |
$('#form-change-password #last_name').val(response['data']['last_name']);
|
|
|
306 |
$('#form-change-password #email').val(response['data']['email']);
|
|
|
307 |
$('#form-change-password #password').val('');
|
|
|
308 |
$('#form-change-password #confirmation').val('');
|
|
|
309 |
validatorChangePassword.resetForm();
|
|
|
310 |
|
|
|
311 |
$('#modalChangePassword').modal('show');
|
|
|
312 |
} else {
|
|
|
313 |
$.fn.showError(response['data']);
|
|
|
314 |
}
|
|
|
315 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
316 |
$.fn.showError(textStatus);
|
|
|
317 |
}).always(function() {
|
|
|
318 |
NProgress.done();
|
|
|
319 |
});
|
|
|
320 |
|
|
|
321 |
});
|
| 16248 |
efrain |
322 |
|
|
|
323 |
var validatorChangeType = $('#form-change-type').validate({
|
|
|
324 |
debug: true,
|
|
|
325 |
onclick: false,
|
|
|
326 |
onkeyup: false,
|
|
|
327 |
ignore: [':hidden'],
|
|
|
328 |
rules: {
|
|
|
329 |
'usertype_id': {
|
|
|
330 |
required: true,
|
|
|
331 |
},
|
| 17179 |
ariadna |
332 |
'email_verified': {
|
|
|
333 |
required: true,
|
|
|
334 |
},
|
|
|
335 |
'blocked': {
|
|
|
336 |
required: true,
|
|
|
337 |
},
|
|
|
338 |
'status': {
|
|
|
339 |
required: true,
|
|
|
340 |
},
|
| 16248 |
efrain |
341 |
},
|
|
|
342 |
submitHandler: function(form)
|
|
|
343 |
{
|
|
|
344 |
NProgress.start();
|
|
|
345 |
$.ajax({
|
|
|
346 |
'dataType' : 'json',
|
|
|
347 |
'accept' : 'application/json',
|
|
|
348 |
'method' : 'post',
|
|
|
349 |
'url' : $('#form-change-type').attr('action'),
|
|
|
350 |
'data' : $('#form-change-type').serialize()
|
|
|
351 |
}).done(function(response) {
|
|
|
352 |
if(response.success) {
|
|
|
353 |
$.fn.showSuccess(response.data);
|
|
|
354 |
|
|
|
355 |
$('#modalChangeType').modal('hide');
|
|
|
356 |
gridTable.api().ajax.reload(null, false);
|
|
|
357 |
} else {
|
|
|
358 |
if(jQuery.type(response.data) == 'string') {
|
|
|
359 |
$.fn.showError(response.data)
|
|
|
360 |
} else {
|
|
|
361 |
$.each(response.data, function( fieldname, errors ) {
|
|
|
362 |
$.fn.showFormErrorValidator('#form-change-type #' + fieldname, errors);
|
|
|
363 |
});
|
|
|
364 |
}
|
|
|
365 |
}
|
|
|
366 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
367 |
$.fn.showError(textStatus)
|
|
|
368 |
|
|
|
369 |
}).always(function() {
|
|
|
370 |
NProgress.done();
|
|
|
371 |
})
|
|
|
372 |
},
|
|
|
373 |
invalidHandler: function(form, validator) {
|
|
|
374 |
}
|
|
|
375 |
});
|
|
|
376 |
|
| 17174 |
ariadna |
377 |
$('body').on('click', 'button.btn-change-type', function(e) {
|
| 16248 |
efrain |
378 |
e.preventDefault();
|
|
|
379 |
|
|
|
380 |
NProgress.start();
|
|
|
381 |
var action = $(this).data('href');
|
|
|
382 |
|
|
|
383 |
$.ajax({
|
|
|
384 |
'dataType' : 'json',
|
|
|
385 |
'accept' : 'application/json',
|
|
|
386 |
'method' : 'get',
|
|
|
387 |
'url' : action,
|
|
|
388 |
}).done(function(response) {
|
|
|
389 |
if(response['success']) {
|
|
|
390 |
|
|
|
391 |
$('#form-change-type').attr('action', action);
|
|
|
392 |
$('#form-change-type #usertype_id').val(response['data']['usertype_id']);
|
| 17179 |
ariadna |
393 |
$('#form-change-type #email_verified').val(response['data']['email_verified']);
|
|
|
394 |
$('#form-change-type #blocked').val(response['data']['blocked']);
|
|
|
395 |
$('#form-change-type #status').val(response['data']['status']);
|
| 16248 |
efrain |
396 |
validatorChangeType.resetForm();
|
|
|
397 |
|
|
|
398 |
$('#modalChangeType').modal('show');
|
|
|
399 |
} else {
|
|
|
400 |
$.fn.showError(response['data']);
|
|
|
401 |
}
|
|
|
402 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
403 |
$.fn.showError(textStatus);
|
|
|
404 |
}).always(function() {
|
|
|
405 |
NProgress.done();
|
|
|
406 |
});
|
|
|
407 |
|
|
|
408 |
});
|
| 1 |
www |
409 |
|
|
|
410 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
411 |
e.preventDefault();
|
|
|
412 |
gridTable.api().ajax.reload(null, false);
|
|
|
413 |
});
|
|
|
414 |
|
| 16822 |
efrain |
415 |
$('body').on('click', 'button.btn-unblock', function(e) {
|
|
|
416 |
e.preventDefault();
|
|
|
417 |
var action = $(this).data('href');
|
| 1 |
www |
418 |
|
| 15460 |
efrain |
419 |
|
| 16822 |
efrain |
420 |
swal.fire({
|
|
|
421 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
422 |
icon: 'question',
|
|
|
423 |
cancelButtonText: 'LABEL_NO',
|
|
|
424 |
showCancelButton: true,
|
|
|
425 |
confirmButtonText: 'LABEL_YES'
|
|
|
426 |
}).then((result) => {
|
|
|
427 |
if (result.isConfirmed) {
|
|
|
428 |
|
|
|
429 |
NProgress.start();
|
|
|
430 |
$.ajax({
|
|
|
431 |
'dataType' : 'json',
|
|
|
432 |
'accept' : 'application/json',
|
|
|
433 |
'method' : 'post',
|
|
|
434 |
'url' : action,
|
|
|
435 |
}).done(function(response) {
|
|
|
436 |
if(response['success']) {
|
|
|
437 |
$.fn.showSuccess(response['data']);
|
|
|
438 |
gridTable.api().ajax.reload(null, false);
|
|
|
439 |
} else {
|
|
|
440 |
$.fn.showError(response['data']);
|
|
|
441 |
}
|
|
|
442 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
443 |
$.fn.showError(textStatus);
|
|
|
444 |
}).always(function() {
|
|
|
445 |
NProgress.done();
|
|
|
446 |
});
|
|
|
447 |
}
|
|
|
448 |
});
|
|
|
449 |
});
|
|
|
450 |
|
| 16842 |
efrain |
451 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
| 15460 |
efrain |
452 |
e.preventDefault();
|
|
|
453 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
454 |
$('#modalChangePassword').modal('hide');
|
| 16842 |
efrain |
455 |
$('#modalUploadUsers').modal('hide');
|
|
|
456 |
$('#modalChangeType').modal('hide');
|
| 15460 |
efrain |
457 |
});
|
|
|
458 |
|
| 1 |
www |
459 |
|
|
|
460 |
$('body').on('click', 'button.btn-view-profile', function(e) {
|
|
|
461 |
e.preventDefault();
|
|
|
462 |
var href = $(this).data('href');
|
|
|
463 |
window.open(href, '_blank');
|
|
|
464 |
});
|
|
|
465 |
|
| 16299 |
efrain |
466 |
var validatorUploadUsers = $('#form-upload-users').validate({
|
| 15460 |
efrain |
467 |
debug: true,
|
|
|
468 |
onclick: false,
|
|
|
469 |
onkeyup: false,
|
|
|
470 |
onfocusout: false,
|
|
|
471 |
ignore: [],
|
|
|
472 |
rules: {
|
|
|
473 |
'file' : {
|
|
|
474 |
required: true,
|
|
|
475 |
extension: 'xls|xlsx',
|
|
|
476 |
accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel'
|
|
|
477 |
},
|
|
|
478 |
},
|
|
|
479 |
|
|
|
480 |
submitHandler: function(form)
|
|
|
481 |
{
|
|
|
482 |
NProgress.start();
|
|
|
483 |
var formdata = false;
|
|
|
484 |
if (window.FormData){
|
|
|
485 |
formdata = new FormData(form);
|
|
|
486 |
}
|
|
|
487 |
formdata.append('step','validation');
|
| 1 |
www |
488 |
|
|
|
489 |
|
| 15460 |
efrain |
490 |
$.ajax({
|
|
|
491 |
'dataType' : 'json',
|
|
|
492 |
'accept' : 'application/json',
|
|
|
493 |
'method' : 'post',
|
|
|
494 |
'url' : '$routeUpload',
|
|
|
495 |
'data' : formdata,
|
|
|
496 |
'processData': false,
|
|
|
497 |
'contentType': false,
|
|
|
498 |
}).done(function(response) {
|
|
|
499 |
if(response['success']) {
|
| 1 |
www |
500 |
|
| 15460 |
efrain |
501 |
$('#table-upload-users-key').val(response['data']['key']);
|
|
|
502 |
|
|
|
503 |
$('#gridTableUploadUsers tbody').empty();
|
|
|
504 |
|
|
|
505 |
$.each(response['data']['items'], function(index, item) {
|
|
|
506 |
|
|
|
507 |
|
|
|
508 |
var s = '<tr>';
|
|
|
509 |
s = s + '<td>' + item['first_name'] + '</td>';
|
|
|
510 |
s = s + '<td>' + item['last_name'] + '</td>';
|
|
|
511 |
s = s + '<td>' + item['email'] + '</td>';
|
|
|
512 |
s = s + '<td>' + item['password'] + '</td>';
|
|
|
513 |
s = s + '<td>' + item['is_adult'] + '</td>';
|
|
|
514 |
s = s + '</tr>';
|
|
|
515 |
|
|
|
516 |
$('#gridTableUploadUsers tbody').append(s);
|
|
|
517 |
|
|
|
518 |
|
|
|
519 |
});
|
|
|
520 |
|
|
|
521 |
$('#modalFormUploadUsers').modal('hide');
|
|
|
522 |
$('#modalUploadUsers').modal('show');
|
|
|
523 |
|
|
|
524 |
|
|
|
525 |
|
|
|
526 |
} else {
|
|
|
527 |
validatorUploadUsers.resetForm();
|
|
|
528 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
529 |
$.fn.showError(response['data']);
|
|
|
530 |
} else {
|
|
|
531 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
532 |
$.fn.showFormErrorValidator('#form-upload-users #' + fieldname, errors);
|
|
|
533 |
});
|
|
|
534 |
}
|
|
|
535 |
}
|
|
|
536 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
537 |
$.fn.showError(textStatus);
|
|
|
538 |
}).always(function() {
|
|
|
539 |
|
|
|
540 |
NProgress.done();
|
|
|
541 |
});
|
|
|
542 |
return false;
|
|
|
543 |
},
|
|
|
544 |
invalidHandler: function(form, validator) {
|
|
|
545 |
|
|
|
546 |
}
|
| 1 |
www |
547 |
});
|
| 15460 |
efrain |
548 |
|
|
|
549 |
$('#form-upload-users #file').fileinput({
|
|
|
550 |
theme: 'fa',
|
|
|
551 |
language: 'es',
|
|
|
552 |
showUpload: false,
|
|
|
553 |
dropZoneEnabled: false,
|
|
|
554 |
maxFileCount: 1,
|
|
|
555 |
allowedFileExtensions: ['xls', 'xlsx'],
|
|
|
556 |
});
|
|
|
557 |
|
|
|
558 |
$('body').on('click', 'button.btn-upload', function(e) {
|
|
|
559 |
e.preventDefault();
|
|
|
560 |
|
|
|
561 |
$('#form-upload-users #file').fileinput('reset');
|
|
|
562 |
$('#form-upload-users #file').val('');
|
|
|
563 |
|
|
|
564 |
$('#modalFormUploadUsers').modal('show');
|
|
|
565 |
});
|
|
|
566 |
|
|
|
567 |
$('body').on('click', 'button.btn-upload-users-step2', function(e) {
|
|
|
568 |
e.preventDefault();
|
|
|
569 |
NProgress.start();
|
|
|
570 |
|
|
|
571 |
$.ajax({
|
|
|
572 |
'dataType' : 'json',
|
|
|
573 |
'accept' : 'application/json',
|
|
|
574 |
'method' : 'post',
|
|
|
575 |
'url' : '$routeUpload',
|
|
|
576 |
'data' : {
|
|
|
577 |
'step' : 'process',
|
|
|
578 |
'key' : $('#table-upload-users-key').val(),
|
|
|
579 |
}
|
|
|
580 |
}).done(function(response) {
|
|
|
581 |
if(response['success']) {
|
|
|
582 |
if(response['data']['users_created'] == 1) {
|
|
|
583 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USER_CREATED');
|
|
|
584 |
} else {
|
|
|
585 |
$.fn.showSuccess(response['data']['users_created'] + ' LABEL_USERS_CREATED');
|
|
|
586 |
}
|
|
|
587 |
gridTable.api().ajax.reload(null, false);
|
|
|
588 |
$('#modalUploadUsers').modal('hide');
|
|
|
589 |
} else {
|
|
|
590 |
$.fn.showError(response['data']);
|
|
|
591 |
}
|
|
|
592 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
593 |
$.fn.showError(textStatus);
|
|
|
594 |
}).always(function() {
|
|
|
595 |
NProgress.done();
|
|
|
596 |
});
|
|
|
597 |
return false;
|
|
|
598 |
});
|
|
|
599 |
|
|
|
600 |
|
| 16299 |
efrain |
601 |
$('#form-filter #network_id').change(function(e) {
|
|
|
602 |
e.preventDefault();
|
| 15460 |
efrain |
603 |
|
| 16299 |
efrain |
604 |
gridTable.api().ajax.reload(null, false);
|
| 15460 |
efrain |
605 |
});
|
| 16299 |
efrain |
606 |
|
|
|
607 |
|
|
|
608 |
});
|
| 1 |
www |
609 |
JS;
|
|
|
610 |
$this->inlineScript()->captureEnd();
|
|
|
611 |
?>
|
|
|
612 |
|
| 16815 |
stevensc |
613 |
|
| 16840 |
efrain |
614 |
<div class="container">
|
| 17172 |
ariadna |
615 |
<div class="card">
|
| 16815 |
stevensc |
616 |
|
| 17172 |
ariadna |
617 |
|
|
|
618 |
<div class="card-body">
|
|
|
619 |
<h6 class="card-title">LABEL_USERS</h6>
|
|
|
620 |
|
|
|
621 |
<div class="row">
|
|
|
622 |
<div class="col-12 mt-3">
|
|
|
623 |
<?php
|
|
|
624 |
$form = $this->formFilter;
|
|
|
625 |
$form->setAttributes([
|
|
|
626 |
'method' => 'post',
|
|
|
627 |
'name' => 'form-filter',
|
|
|
628 |
'id' => 'form-filter'
|
|
|
629 |
]);
|
|
|
630 |
|
|
|
631 |
$form->prepare();
|
|
|
632 |
echo $this->form()->openTag($form);
|
|
|
633 |
?>
|
|
|
634 |
<table class="table">
|
|
|
635 |
<thead>
|
|
|
636 |
</thead>
|
| 16840 |
efrain |
637 |
<tbody>
|
| 17172 |
ariadna |
638 |
<tr>
|
|
|
639 |
<th>LABEL_PRIVATE_NETWORKS</th>
|
| 16840 |
efrain |
640 |
<td>
|
| 17172 |
ariadna |
641 |
<?php
|
|
|
642 |
$element = $form->get('network_id');
|
|
|
643 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
644 |
echo $this->formSelect($element);
|
|
|
645 |
?>
|
|
|
646 |
</td>
|
| 16840 |
efrain |
647 |
</tr>
|
| 17172 |
ariadna |
648 |
</tbody>
|
| 1 |
www |
649 |
|
| 17172 |
ariadna |
650 |
</table>
|
|
|
651 |
<?php echo $this->form()->closeTag($form); ?>
|
| 1 |
www |
652 |
|
| 17172 |
ariadna |
653 |
</div>
|
|
|
654 |
</div>
|
|
|
655 |
<div class="row">
|
|
|
656 |
<div class="col-12 mt-3">
|
|
|
657 |
<table id="gridTable" class="table table-bordered">
|
|
|
658 |
<thead>
|
|
|
659 |
<tr>
|
|
|
660 |
<th>LABEL_FIRST_NAME</th>
|
|
|
661 |
<th>LABEL_LAST_NAME</th>
|
|
|
662 |
<th>LABEL_EMAIL</th>
|
|
|
663 |
<th>LABEL_DETAILS</th>
|
|
|
664 |
<th>LABEL_ACTIONS</th>
|
|
|
665 |
</tr>
|
|
|
666 |
</thead>
|
|
|
667 |
<tbody>
|
|
|
668 |
</tbody>
|
|
|
669 |
</table>
|
|
|
670 |
</div>
|
|
|
671 |
</div>
|
| 16840 |
efrain |
672 |
<div class="card-footer text-right">
|
| 17172 |
ariadna |
673 |
<?php if ($allowUpload) : ?>
|
|
|
674 |
<button type="button" class="btn btn-sm btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button>
|
|
|
675 |
<?php endif; ?>
|
|
|
676 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
| 16815 |
stevensc |
677 |
</div>
|
|
|
678 |
</div>
|
|
|
679 |
</div>
|
| 16840 |
efrain |
680 |
</div>
|
| 16815 |
stevensc |
681 |
|
|
|
682 |
|
| 1 |
www |
683 |
<!-- The Modal -->
|
|
|
684 |
<div class="modal" id="modalChangePassword">
|
| 16815 |
stevensc |
685 |
<div class="modal-dialog">
|
|
|
686 |
<div class="modal-content">
|
| 1 |
www |
687 |
|
|
|
688 |
<!-- Modal Header -->
|
| 16815 |
stevensc |
689 |
<div class="modal-header">
|
| 16845 |
efrain |
690 |
<h6 class="modal-title">LABEL_USERS</h6>
|
| 16822 |
efrain |
691 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 16815 |
stevensc |
692 |
</div>
|
| 1 |
www |
693 |
|
| 16840 |
efrain |
694 |
|
| 1 |
www |
695 |
<!-- Modal body -->
|
| 17172 |
ariadna |
696 |
<?php
|
|
|
697 |
$form = $this->formChangePassword;
|
|
|
698 |
$form->setAttributes([
|
|
|
699 |
'method' => 'post',
|
|
|
700 |
'name' => 'form-change-password',
|
|
|
701 |
'id' => 'form-change-password'
|
|
|
702 |
]);
|
| 1 |
www |
703 |
|
| 17172 |
ariadna |
704 |
$form->prepare();
|
|
|
705 |
echo $this->form()->openTag($form);
|
|
|
706 |
?>
|
| 16840 |
efrain |
707 |
<div class="modal-body">
|
|
|
708 |
|
| 17172 |
ariadna |
709 |
<div class="row">
|
|
|
710 |
<div class="col-12 mt-3">
|
|
|
711 |
<?php
|
|
|
712 |
$element = $form->get('first_name');
|
|
|
713 |
$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
|
|
|
714 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 1 |
www |
715 |
|
| 17172 |
ariadna |
716 |
echo $this->formLabel($element);
|
|
|
717 |
echo $this->formText($element);
|
|
|
718 |
?>
|
| 16840 |
efrain |
719 |
</div>
|
| 16815 |
stevensc |
720 |
</div>
|
| 17172 |
ariadna |
721 |
<div class="row">
|
|
|
722 |
<div class="col-12 mt-3">
|
|
|
723 |
<?php
|
|
|
724 |
$element = $form->get('last_name');
|
|
|
725 |
$element->setOptions(['label' => 'LABEL_LAST_NAME']);
|
|
|
726 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 1 |
www |
727 |
|
| 17172 |
ariadna |
728 |
echo $this->formLabel($element);
|
|
|
729 |
echo $this->formText($element);
|
|
|
730 |
?>
|
| 16840 |
efrain |
731 |
</div>
|
| 16815 |
stevensc |
732 |
</div>
|
| 17172 |
ariadna |
733 |
<div class="row">
|
|
|
734 |
<div class="col-12 mt-3">
|
|
|
735 |
<?php
|
|
|
736 |
$element = $form->get('email');
|
|
|
737 |
$element->setOptions(['label' => 'LABEL_EMAIL']);
|
|
|
738 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 16815 |
stevensc |
739 |
|
| 17172 |
ariadna |
740 |
echo $this->formLabel($element);
|
|
|
741 |
echo $this->formText($element);
|
|
|
742 |
?>
|
| 16840 |
efrain |
743 |
</div>
|
| 16815 |
stevensc |
744 |
</div>
|
| 17172 |
ariadna |
745 |
<div class="row">
|
|
|
746 |
<div class="col-12 mt-3">
|
|
|
747 |
<?php
|
|
|
748 |
$element = $form->get('password');
|
|
|
749 |
$element->setOptions(['label' => 'LABEL_PASSWORD']);
|
|
|
750 |
$element->setAttributes(['class' => 'form-control']);
|
| 16815 |
stevensc |
751 |
|
| 17172 |
ariadna |
752 |
echo $this->formLabel($element);
|
|
|
753 |
echo $this->formPassword($element);
|
|
|
754 |
?>
|
| 16840 |
efrain |
755 |
</div>
|
| 16815 |
stevensc |
756 |
</div>
|
| 16840 |
efrain |
757 |
<div class="row">
|
| 17172 |
ariadna |
758 |
<div class="col-12 mt-3">
|
|
|
759 |
<?php
|
|
|
760 |
$element = $form->get('confirmation');
|
|
|
761 |
$element->setOptions(['label' => 'LABEL_CONFIRMATION']);
|
|
|
762 |
$element->setAttributes(['class' => 'form-control']);
|
| 16815 |
stevensc |
763 |
|
| 17172 |
ariadna |
764 |
echo $this->formLabel($element);
|
|
|
765 |
echo $this->formPassword($element);
|
|
|
766 |
?>
|
| 16840 |
efrain |
767 |
</div>
|
| 16815 |
stevensc |
768 |
</div>
|
|
|
769 |
|
| 17172 |
ariadna |
770 |
|
| 16815 |
stevensc |
771 |
</div>
|
|
|
772 |
|
| 1 |
www |
773 |
<!-- Modal footer -->
|
| 16840 |
efrain |
774 |
<div class="modal-footer text-right">
|
| 17172 |
ariadna |
775 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
| 16842 |
efrain |
776 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
| 16815 |
stevensc |
777 |
</div>
|
| 16840 |
efrain |
778 |
<?php echo $this->form()->closeTag($form); ?>
|
| 1 |
www |
779 |
|
| 16815 |
stevensc |
780 |
</div>
|
|
|
781 |
</div>
|
|
|
782 |
</div>
|
| 1 |
www |
783 |
|
|
|
784 |
|
| 15460 |
efrain |
785 |
<!-- The Modal -->
|
|
|
786 |
<div class="modal" id="modalFormUploadUsers">
|
|
|
787 |
<div class="modal-dialog modal-xl">
|
|
|
788 |
<div class="modal-content">
|
| 1 |
www |
789 |
|
| 15460 |
efrain |
790 |
<!-- Modal Header -->
|
|
|
791 |
<div class="modal-header">
|
|
|
792 |
<h3 class="modal-title">LABEL_UPLOAD</h3>
|
|
|
793 |
</div>
|
| 17172 |
ariadna |
794 |
<?php
|
|
|
795 |
$form = $this->formUploadUsers;
|
|
|
796 |
$form->setAttributes([
|
|
|
797 |
'method' => 'post',
|
|
|
798 |
'name' => 'form-upload-users',
|
|
|
799 |
'id' => 'form-upload-users'
|
|
|
800 |
]);
|
| 15460 |
efrain |
801 |
|
| 17172 |
ariadna |
802 |
$form->prepare();
|
|
|
803 |
echo $this->form()->openTag($form);
|
|
|
804 |
?>
|
| 15460 |
efrain |
805 |
|
| 16840 |
efrain |
806 |
<!-- Modal body -->
|
|
|
807 |
<div class="modal-body">
|
| 15460 |
efrain |
808 |
|
| 17172 |
ariadna |
809 |
|
| 16840 |
efrain |
810 |
<div class="row">
|
| 17172 |
ariadna |
811 |
<div class="col-12 mt-3">
|
| 15460 |
efrain |
812 |
|
| 16840 |
efrain |
813 |
|
| 15460 |
efrain |
814 |
<?php
|
| 17172 |
ariadna |
815 |
$element = $form->get('file');
|
|
|
816 |
$element->setOptions(['label' => 'LABEL_EXCEL']);
|
|
|
817 |
echo $this->formLabel($element);
|
| 15460 |
efrain |
818 |
?>
|
| 17172 |
ariadna |
819 |
<div class="file-loading">
|
|
|
820 |
<?php
|
|
|
821 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel']);
|
|
|
822 |
echo $this->formFile($element);
|
|
|
823 |
?>
|
|
|
824 |
</div>
|
| 15460 |
efrain |
825 |
</div>
|
|
|
826 |
</div>
|
|
|
827 |
|
|
|
828 |
|
|
|
829 |
|
| 17172 |
ariadna |
830 |
|
| 16840 |
efrain |
831 |
</div>
|
| 17172 |
ariadna |
832 |
<div class="modal-footer text-right">
|
|
|
833 |
<button type="submit" class="btn btn-sm btn-primary">LABEL_UPLOAD</button>
|
|
|
834 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
|
|
835 |
</div>
|
|
|
836 |
<?php echo $this->form()->closeTag($form); ?>
|
| 15460 |
efrain |
837 |
</div>
|
|
|
838 |
</div>
|
|
|
839 |
</div>
|
|
|
840 |
|
|
|
841 |
|
|
|
842 |
<!-- The Modal -->
|
|
|
843 |
<div class="modal" id="modalUploadUsers">
|
|
|
844 |
<div class="modal-dialog modal-xl">
|
|
|
845 |
<div class="modal-content">
|
|
|
846 |
|
|
|
847 |
<!-- Modal Header -->
|
|
|
848 |
<div class="modal-header">
|
|
|
849 |
<h3 class="modal-title">LABEL_USERS</h3>
|
| 16822 |
efrain |
850 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 15460 |
efrain |
851 |
</div>
|
|
|
852 |
|
|
|
853 |
<!-- Modal body -->
|
|
|
854 |
<div class="modal-body">
|
|
|
855 |
<form>
|
|
|
856 |
<input type="hidden" name="table-upload-users-key" id="table-upload-users-key">
|
|
|
857 |
</form>
|
| 16840 |
efrain |
858 |
<div class="row">
|
| 16841 |
efrain |
859 |
<div class="col-12 mt-3" style="height: 300px;overflow: scroll;">
|
| 16840 |
efrain |
860 |
<table id="gridTableUploadUsers" style="width: 100%" class="table table-bordered">
|
|
|
861 |
<thead>
|
|
|
862 |
<tr>
|
|
|
863 |
<th>LABEL_FIRST_NAME</th>
|
|
|
864 |
<th>LABEL_LAST_NAME</th>
|
|
|
865 |
<th>LABEL_EMAIL</th>
|
|
|
866 |
<th>LABEL_PASSWORD</th>
|
|
|
867 |
<th>LABEL_IS_ADULT</th>
|
|
|
868 |
</tr>
|
|
|
869 |
</thead>
|
|
|
870 |
<tbody>
|
|
|
871 |
</tbody>
|
|
|
872 |
</table>
|
|
|
873 |
</div>
|
| 15460 |
efrain |
874 |
</div>
|
|
|
875 |
|
|
|
876 |
</div>
|
|
|
877 |
|
|
|
878 |
<!-- Modal footer -->
|
| 16840 |
efrain |
879 |
<div class="modal-footer text-right">
|
| 15460 |
efrain |
880 |
<button type="submit" class="btn btn-sm btn-primary btn-upload-users-step2">LABEL_SAVE</button>
|
| 16842 |
efrain |
881 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
| 15460 |
efrain |
882 |
</div>
|
|
|
883 |
|
|
|
884 |
</div>
|
|
|
885 |
</div>
|
|
|
886 |
</div>
|
|
|
887 |
|
|
|
888 |
|
| 16248 |
efrain |
889 |
|
|
|
890 |
<!-- The Modal -->
|
|
|
891 |
<div class="modal" id="modalChangeType">
|
| 16815 |
stevensc |
892 |
<div class="modal-dialog">
|
|
|
893 |
<div class="modal-content">
|
| 16248 |
efrain |
894 |
|
|
|
895 |
<!-- Modal Header -->
|
| 16815 |
stevensc |
896 |
<div class="modal-header">
|
| 16845 |
efrain |
897 |
<h6 class="modal-title">LABEL_USERS</h6>
|
| 16822 |
efrain |
898 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 16815 |
stevensc |
899 |
</div>
|
| 16248 |
efrain |
900 |
|
| 17172 |
ariadna |
901 |
<?php
|
|
|
902 |
$form = $this->formChangeType;
|
|
|
903 |
$form->setAttributes([
|
|
|
904 |
'method' => 'post',
|
|
|
905 |
'name' => 'form-change-type',
|
|
|
906 |
'id' => 'form-change-type'
|
|
|
907 |
]);
|
| 16248 |
efrain |
908 |
|
| 17172 |
ariadna |
909 |
$form->prepare();
|
|
|
910 |
echo $this->form()->openTag($form);
|
|
|
911 |
?>
|
| 16840 |
efrain |
912 |
<!-- Modal body -->
|
|
|
913 |
<div class="modal-body">
|
| 17172 |
ariadna |
914 |
|
| 16840 |
efrain |
915 |
<div class="row">
|
| 17172 |
ariadna |
916 |
<div class="col-12 mt-3">
|
|
|
917 |
<?php
|
|
|
918 |
$element = $form->get('usertype_id');
|
|
|
919 |
$element->setOptions(['label' => 'LABEL_USER_TYPE']);
|
|
|
920 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 16815 |
stevensc |
921 |
|
| 17172 |
ariadna |
922 |
echo $this->formLabel($element);
|
|
|
923 |
echo $this->formSelect($element);
|
|
|
924 |
?>
|
| 16840 |
efrain |
925 |
</div>
|
| 16815 |
stevensc |
926 |
</div>
|
| 17174 |
ariadna |
927 |
<div class="row">
|
|
|
928 |
<div class="col-12 mt-3">
|
|
|
929 |
<?php
|
| 17179 |
ariadna |
930 |
$element = $form->get('email_verified');
|
| 17189 |
ariadna |
931 |
$element->setOptions(['label' => 'LABEL_CHECK_EMAIL']);
|
| 17213 |
ariadna |
932 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 16840 |
efrain |
933 |
|
| 17174 |
ariadna |
934 |
echo $this->formLabel($element);
|
| 17179 |
ariadna |
935 |
echo $this->formSelect($element);
|
| 17174 |
ariadna |
936 |
?>
|
|
|
937 |
</div>
|
|
|
938 |
</div>
|
|
|
939 |
<div class="row">
|
|
|
940 |
<div class="col-12 mt-3">
|
|
|
941 |
<?php
|
| 17179 |
ariadna |
942 |
$element = $form->get('blocked');
|
| 17174 |
ariadna |
943 |
$element->setOptions(['label' => 'LABEL_BLOCKED']);
|
| 17213 |
ariadna |
944 |
$element->setAttributes(['class' => 'form-control', 'readonly' => 'readonly']);
|
| 17172 |
ariadna |
945 |
|
| 17174 |
ariadna |
946 |
echo $this->formLabel($element);
|
| 17179 |
ariadna |
947 |
echo $this->formSelect($element);
|
| 17174 |
ariadna |
948 |
?>
|
|
|
949 |
</div>
|
|
|
950 |
</div>
|
|
|
951 |
<div class="row">
|
|
|
952 |
<div class="col-12 mt-3">
|
|
|
953 |
<?php
|
|
|
954 |
$element = $form->get('status');
|
|
|
955 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
956 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
957 |
|
|
|
958 |
echo $this->formLabel($element);
|
|
|
959 |
echo $this->formSelect($element);
|
|
|
960 |
?>
|
|
|
961 |
</div>
|
|
|
962 |
</div>
|
|
|
963 |
|
|
|
964 |
|
| 16815 |
stevensc |
965 |
</div>
|
|
|
966 |
|
| 16248 |
efrain |
967 |
<!-- Modal footer -->
|
| 16891 |
efrain |
968 |
<div class="modal-footer text-right">
|
| 17172 |
ariadna |
969 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
970 |
<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
|
| 16815 |
stevensc |
971 |
</div>
|
| 16840 |
efrain |
972 |
<?php echo $this->form()->closeTag($form); ?>
|
| 16248 |
efrain |
973 |
|
| 16815 |
stevensc |
974 |
</div>
|
|
|
975 |
</div>
|
|
|
976 |
</div>
|