| 16248 |
efrain |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
$routeDatatable = $this->url('knowledge-area/categories/users');
|
|
|
9 |
|
| 16797 |
efrain |
10 |
$allowAdd = $acl->isAllowed($roleName, 'knowledge-area/categories/users/add') ? 1 : 0;
|
|
|
11 |
$allowEdit = $acl->isAllowed($roleName, 'knowledge-area/categories/users/edit') ? 1 : 0;
|
|
|
12 |
$allowDelete = $acl->isAllowed($roleName, 'knowledge-area/categories/users/delete') ? 1 : 0;
|
|
|
13 |
$allowUpload = $acl->isAllowed($roleName, 'knowledge-area/categories/users/upload') ? 1 : 0;
|
|
|
14 |
$allowJobDescription = $acl->isAllowed($roleName, 'knowledge-area/categories/users/jobs-description') ? 1 : 0;
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
| 16326 |
efrain |
18 |
$allowUpload = false;
|
| 16248 |
efrain |
19 |
|
|
|
20 |
|
| 16822 |
efrain |
21 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
22 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
| 16248 |
efrain |
23 |
|
|
|
24 |
|
|
|
25 |
|
| 16929 |
efrain |
26 |
|
|
|
27 |
|
|
|
28 |
|
| 16822 |
efrain |
29 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
| 16248 |
efrain |
30 |
|
| 16822 |
efrain |
31 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
| 16248 |
efrain |
33 |
|
|
|
34 |
|
| 16822 |
efrain |
35 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
36 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 16248 |
efrain |
37 |
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
| 16822 |
efrain |
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
|
|
|
43 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
|
| 16248 |
efrain |
44 |
|
| 16927 |
efrain |
45 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
|
| 16797 |
efrain |
46 |
|
|
|
47 |
|
| 16822 |
efrain |
48 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/treeflex/treeflex.css'));
|
|
|
49 |
|
|
|
50 |
|
| 16248 |
efrain |
51 |
$this->inlineScript()->captureStart();
|
|
|
52 |
echo <<<JS
|
|
|
53 |
jQuery( document ).ready(function( $ ) {
|
|
|
54 |
var routeAdd = '';
|
|
|
55 |
var routeUpload = '';
|
|
|
56 |
var allowEdit = $allowEdit;
|
|
|
57 |
var allowDelete = $allowDelete;
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
61 |
'processing': true,
|
|
|
62 |
'serverSide': true,
|
|
|
63 |
'searching': true,
|
|
|
64 |
'order': [[ 0, 'asc' ]],
|
|
|
65 |
'ordering': true,
|
|
|
66 |
'ordenable' : true,
|
|
|
67 |
'responsive': true,
|
|
|
68 |
'select' : false,
|
|
|
69 |
'paging': true,
|
|
|
70 |
'pagingType': 'simple_numbers',
|
|
|
71 |
'ajax': {
|
|
|
72 |
'url' : '$routeDatatable',
|
|
|
73 |
'type' : 'get',
|
|
|
74 |
'beforeSend': function (request) {
|
|
|
75 |
NProgress.start();
|
|
|
76 |
},
|
|
|
77 |
'data': function ( d ) {
|
|
|
78 |
d.category_id = $('#form-filter #category_id').val();
|
|
|
79 |
|
|
|
80 |
},
|
|
|
81 |
'dataFilter': function(response) {
|
|
|
82 |
var response = jQuery.parseJSON( response );
|
|
|
83 |
|
|
|
84 |
var json = {};
|
|
|
85 |
json.recordsTotal = 0;
|
|
|
86 |
json.recordsFiltered = 0;
|
|
|
87 |
json.data = [];
|
|
|
88 |
|
|
|
89 |
|
|
|
90 |
if(response.success) {
|
|
|
91 |
$('#form #role').empty();
|
| 16940 |
efrain |
92 |
|
|
|
93 |
if(typeof response.data.roles === 'object') {
|
|
|
94 |
|
|
|
95 |
var rolesArray = $.map(response.data.roles, function(text, value) {
|
|
|
96 |
return [{value : value, text: text}];
|
| 16797 |
efrain |
97 |
});
|
| 16940 |
efrain |
98 |
|
|
|
99 |
if(rolesArray.length > 0) {
|
|
|
100 |
$.each(rolesArray, function(index, item) {
|
|
|
101 |
$('#form #role').append(new Option(item.text, item.value));
|
|
|
102 |
});
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
} else {
|
|
|
107 |
console.log('is_array');
|
|
|
108 |
if(response.data.roles.length > 0) {
|
|
|
109 |
$.each(response.data.roles, function(value, text) {
|
|
|
110 |
$('#form #role').append(new Option(text, value));
|
|
|
111 |
});
|
|
|
112 |
}
|
| 16797 |
efrain |
113 |
}
|
| 16940 |
efrain |
114 |
|
| 16248 |
efrain |
115 |
$('#form #role').trigger('change');
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
if(response.data.link_add) {
|
|
|
119 |
$('button.btn-add').data('href', response.data.link_add);
|
|
|
120 |
$('button.btn-add').show();
|
|
|
121 |
} else {
|
|
|
122 |
$('button.btn-add').hide();
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
if(response.data.link_upload) {
|
|
|
126 |
$('button.btn-upload').data('href', response.data.link_upload);
|
|
|
127 |
$('button.btn-upload').show();
|
|
|
128 |
} else {
|
|
|
129 |
$('button.btn-upload').hide();
|
|
|
130 |
}
|
|
|
131 |
|
| 16797 |
efrain |
132 |
if(response.data.link_jobs_description) {
|
|
|
133 |
$('#form-jobs-description').attr('action', response.data.link_jobs_description);
|
|
|
134 |
$('#form-jobs-description input[type="checkbox"]').each(function(i, item) {
|
|
|
135 |
$(item).removeAttr('disabled');
|
|
|
136 |
|
|
|
137 |
});
|
|
|
138 |
|
|
|
139 |
} else {
|
|
|
140 |
$('#form-jobs-description').attr('action', '');
|
|
|
141 |
$('#form-jobs-description input[type="checkbox"]').each(function(i, item) {
|
|
|
142 |
$(item).attr('disabled','disabled');
|
|
|
143 |
|
|
|
144 |
});
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
|
|
|
148 |
$('#form-jobs-description input[type="checkbox"]').prop('checked', false);
|
|
|
149 |
if(response.data.jobs_description.length > 0) {
|
|
|
150 |
$.each(response.data.jobs_description, function(i, uuid) {
|
|
|
151 |
$('#form-jobs-description #job_description_id' + uuid).prop('checked', true);
|
|
|
152 |
});
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
| 16248 |
efrain |
158 |
json.recordsTotal = response.data.total;
|
|
|
159 |
json.recordsFiltered = response.data.total;
|
|
|
160 |
json.data = response.data.items;
|
|
|
161 |
} else {
|
|
|
162 |
$.fn.showError(response.data)
|
|
|
163 |
}
|
|
|
164 |
|
|
|
165 |
return JSON.stringify( json );
|
|
|
166 |
}
|
|
|
167 |
},
|
|
|
168 |
'language' : {
|
|
|
169 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
170 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
171 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
172 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
173 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
174 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
175 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
176 |
'sInfoPostFix': '',
|
|
|
177 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
178 |
'sUrl': '',
|
|
|
179 |
'sInfoThousands': ',',
|
|
|
180 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
181 |
'oPaginate': {
|
|
|
182 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
183 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
184 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
185 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
186 |
},
|
|
|
187 |
'oAria': {
|
|
|
188 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
189 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
190 |
},
|
|
|
191 |
},
|
|
|
192 |
'drawCallback': function( settings ) {
|
|
|
193 |
NProgress.done();
|
| 16822 |
efrain |
194 |
|
| 16248 |
efrain |
195 |
},
|
|
|
196 |
'aoColumns': [
|
|
|
197 |
{ 'mDataProp': 'first_name' },
|
|
|
198 |
{ 'mDataProp': 'last_name' },
|
|
|
199 |
{ 'mDataProp': 'email' },
|
|
|
200 |
{ 'mDataProp': 'role' },
|
|
|
201 |
{ 'mDataProp': 'actions' },
|
|
|
202 |
],
|
|
|
203 |
'columnDefs': [
|
|
|
204 |
{
|
|
|
205 |
'targets': 0,
|
|
|
206 |
'className' : 'text-vertical-middle',
|
|
|
207 |
},
|
|
|
208 |
{
|
|
|
209 |
'targets': 1,
|
|
|
210 |
'orderable': false,
|
|
|
211 |
'className' : 'text-vertical-middle',
|
|
|
212 |
|
|
|
213 |
},
|
|
|
214 |
{
|
|
|
215 |
'targets': 2,
|
|
|
216 |
'orderable': false,
|
|
|
217 |
'className' : 'text-vertical-middle',
|
|
|
218 |
|
|
|
219 |
},
|
|
|
220 |
{
|
|
|
221 |
'targets': 3,
|
|
|
222 |
'orderable': false,
|
|
|
223 |
'className' : 'text-vertical-middle',
|
|
|
224 |
|
|
|
225 |
},
|
|
|
226 |
{
|
|
|
227 |
'targets': -1,
|
|
|
228 |
'orderable': false,
|
|
|
229 |
'render' : function ( data, type, row ) {
|
|
|
230 |
s = '';
|
|
|
231 |
|
|
|
232 |
if(allowEdit) {
|
| 16906 |
efrain |
233 |
s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button> ';
|
| 16248 |
efrain |
234 |
}
|
|
|
235 |
if(allowDelete) {
|
|
|
236 |
s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';
|
|
|
237 |
}
|
|
|
238 |
return s;
|
|
|
239 |
}
|
|
|
240 |
}
|
|
|
241 |
],
|
|
|
242 |
});
|
|
|
243 |
|
|
|
244 |
var validator = $('#form').validate({
|
|
|
245 |
debug: true,
|
|
|
246 |
onclick: false,
|
|
|
247 |
onkeyup: false,
|
|
|
248 |
ignore: [],
|
|
|
249 |
rules: {
|
|
|
250 |
'user_id': {
|
|
|
251 |
required: true,
|
|
|
252 |
},
|
|
|
253 |
|
|
|
254 |
'role': {
|
|
|
255 |
required: false,
|
|
|
256 |
},
|
|
|
257 |
},
|
|
|
258 |
submitHandler: function(form)
|
|
|
259 |
{
|
| 16797 |
efrain |
260 |
NProgress.start();
|
| 16248 |
efrain |
261 |
$('#submitBtn').prop('disabled', true);
|
|
|
262 |
$.ajax({
|
|
|
263 |
'dataType' : 'json',
|
|
|
264 |
'accept' : 'application/json',
|
|
|
265 |
'method' : 'post',
|
|
|
266 |
'url' : $('#form').attr('action'),
|
|
|
267 |
'data' : {
|
|
|
268 |
'role' : $('#form #role').val(),
|
|
|
269 |
'user_id' : $('#form #user_id').val(),
|
|
|
270 |
}
|
|
|
271 |
}).done(function(response) {
|
|
|
272 |
if(response['success']) {
|
|
|
273 |
$.fn.showSuccess(response['data']);
|
|
|
274 |
|
|
|
275 |
$('#modal').modal('hide');
|
|
|
276 |
|
|
|
277 |
|
|
|
278 |
gridTable.api().ajax.reload(null, false);
|
|
|
279 |
} else {
|
|
|
280 |
validator.resetForm();
|
|
|
281 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
282 |
$.fn.showError(response['data']);
|
|
|
283 |
} else {
|
|
|
284 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
285 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
286 |
});
|
|
|
287 |
}
|
|
|
288 |
}
|
|
|
289 |
$('#submitBtn').prop('disabled', false);
|
|
|
290 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
291 |
$.fn.showError(textStatus);
|
|
|
292 |
}).always(function() {
|
|
|
293 |
$('#submitBtn').prop('disabled', false);
|
|
|
294 |
NProgress.done();
|
|
|
295 |
});
|
|
|
296 |
return false;
|
|
|
297 |
},
|
|
|
298 |
invalidHandler: function(form, validator) {
|
|
|
299 |
|
|
|
300 |
}
|
|
|
301 |
});
|
|
|
302 |
|
|
|
303 |
|
|
|
304 |
$('#form-filter #category_id').change(function(e) {
|
|
|
305 |
e.preventDefault();
|
|
|
306 |
|
|
|
307 |
gridTable.api().ajax.reload(null, false);
|
|
|
308 |
});
|
|
|
309 |
|
|
|
310 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
311 |
e.preventDefault();
|
|
|
312 |
var action = $(this).data('href');
|
|
|
313 |
|
| 16840 |
efrain |
314 |
|
| 16248 |
efrain |
315 |
$('#form').attr('action', action);
|
|
|
316 |
$('#form #user_id').val('');
|
|
|
317 |
$('#form #user_id').trigger('change');
|
|
|
318 |
$('#form #user_id').prop('disabled', false);
|
|
|
319 |
|
|
|
320 |
$('#form #role').val('');
|
|
|
321 |
$('#form #role').trigger('change');
|
|
|
322 |
|
|
|
323 |
|
|
|
324 |
|
|
|
325 |
validator.resetForm();
|
|
|
326 |
$('#modal').modal('show');
|
|
|
327 |
|
|
|
328 |
return false;
|
|
|
329 |
});
|
|
|
330 |
|
|
|
331 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
332 |
e.preventDefault();
|
|
|
333 |
NProgress.start();
|
|
|
334 |
var action = $(this).data('href');
|
|
|
335 |
$('#submitBtn').prop('disabled', true);
|
|
|
336 |
$.ajax({
|
|
|
337 |
'dataType' : 'json',
|
|
|
338 |
'method' : 'get',
|
|
|
339 |
'url' : action,
|
|
|
340 |
}).done(function(response) {
|
|
|
341 |
|
|
|
342 |
|
|
|
343 |
|
|
|
344 |
if(response['success']) {
|
| 16840 |
efrain |
345 |
|
| 16248 |
efrain |
346 |
$('#form').attr('action', action);
|
|
|
347 |
$('#form #user_id').val( response['data']['user_id'] );
|
|
|
348 |
$('#form #user_id').trigger('change');
|
|
|
349 |
$('#form #user_id').prop('disabled', true);
|
| 16940 |
efrain |
350 |
|
|
|
351 |
|
|
|
352 |
|
|
|
353 |
|
| 16248 |
efrain |
354 |
|
|
|
355 |
$('#form #role').val(response['data']['role']);
|
|
|
356 |
$('#form #role').trigger('change');
|
|
|
357 |
validator.resetForm();
|
|
|
358 |
|
|
|
359 |
$('#modal').modal('show');
|
|
|
360 |
|
|
|
361 |
} else {
|
|
|
362 |
$.fn.showError(response['data']);
|
|
|
363 |
}
|
|
|
364 |
$('#submitBtn').prop('disabled', false);
|
|
|
365 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
366 |
$.fn.showError(textStatus);
|
|
|
367 |
}).always(function() {
|
|
|
368 |
NProgress.done();
|
|
|
369 |
$('#submitBtn').prop('disabled', false);
|
|
|
370 |
});
|
|
|
371 |
|
|
|
372 |
return false;
|
|
|
373 |
});
|
|
|
374 |
|
|
|
375 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
376 |
e.preventDefault();
|
|
|
377 |
gridTable.api().ajax.reload(null, false);
|
|
|
378 |
|
|
|
379 |
return false;
|
|
|
380 |
});
|
|
|
381 |
|
|
|
382 |
|
|
|
383 |
|
|
|
384 |
|
|
|
385 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
386 |
e.preventDefault();
|
|
|
387 |
$('#modal').modal('hide');
|
|
|
388 |
});
|
|
|
389 |
|
| 16822 |
efrain |
390 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
391 |
e.preventDefault();
|
|
|
392 |
var action = $(this).data('href');
|
|
|
393 |
|
|
|
394 |
|
|
|
395 |
swal.fire({
|
|
|
396 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
397 |
icon: 'question',
|
|
|
398 |
cancelButtonText: 'LABEL_NO',
|
|
|
399 |
showCancelButton: true,
|
|
|
400 |
confirmButtonText: 'LABEL_YES'
|
|
|
401 |
}).then((result) => {
|
|
|
402 |
if (result.isConfirmed) {
|
|
|
403 |
|
|
|
404 |
NProgress.start();
|
|
|
405 |
$.ajax({
|
|
|
406 |
'dataType' : 'json',
|
|
|
407 |
'accept' : 'application/json',
|
|
|
408 |
'method' : 'post',
|
|
|
409 |
'url' : action,
|
|
|
410 |
}).done(function(response) {
|
|
|
411 |
if(response['success']) {
|
|
|
412 |
$.fn.showSuccess(response['data']);
|
|
|
413 |
gridTable.api().ajax.reload(null, false);
|
|
|
414 |
} else {
|
|
|
415 |
$.fn.showError(response['data']);
|
|
|
416 |
}
|
|
|
417 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
418 |
$.fn.showError(textStatus);
|
|
|
419 |
}).always(function() {
|
|
|
420 |
NProgress.done();
|
|
|
421 |
});
|
|
|
422 |
}
|
|
|
423 |
});
|
|
|
424 |
});
|
|
|
425 |
|
| 16797 |
efrain |
426 |
$('body').on('click', 'button.btn-save-job-description', function(e) {
|
|
|
427 |
e.preventDefault();
|
| 16248 |
efrain |
428 |
|
| 16797 |
efrain |
429 |
NProgress.start();
|
|
|
430 |
$.ajax({
|
|
|
431 |
'dataType' : 'json',
|
|
|
432 |
'accept' : 'application/json',
|
|
|
433 |
'method' : 'post',
|
|
|
434 |
'url' : $('#form-jobs-description').attr('action'),
|
|
|
435 |
'data' : $('#form-jobs-description').serialize()
|
|
|
436 |
}).done(function(response) {
|
|
|
437 |
if(response['success']) {
|
|
|
438 |
$.fn.showSuccess(response['data']);
|
|
|
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 |
|
| 16248 |
efrain |
450 |
$('#form #user_id').select2({
|
| 16918 |
efrain |
451 |
theme: 'bootstrap-5',
|
| 16248 |
efrain |
452 |
width: '100%',
|
| 16940 |
efrain |
453 |
dropdownParent: $('#modal'),
|
| 16248 |
efrain |
454 |
});
|
|
|
455 |
|
|
|
456 |
$('#form #role').select2({
|
| 16918 |
efrain |
457 |
theme: 'bootstrap-5',
|
| 16248 |
efrain |
458 |
width: '100%',
|
| 16940 |
efrain |
459 |
dropdownParent: $('#modal'),
|
| 16248 |
efrain |
460 |
});
|
|
|
461 |
|
|
|
462 |
|
| 16940 |
efrain |
463 |
|
| 16248 |
efrain |
464 |
});
|
|
|
465 |
JS;
|
|
|
466 |
$this->inlineScript()->captureEnd();
|
|
|
467 |
?>
|
|
|
468 |
|
|
|
469 |
|
| 16864 |
efrain |
470 |
<div class="container">
|
| 16942 |
stevensc |
471 |
<div class="card" id="">
|
|
|
472 |
<div class="card-header">
|
|
|
473 |
<h6 class="card-title">LABEL_KNOWLEDGE_AREA_CATEGORY_USERS</h6>
|
|
|
474 |
</div>
|
|
|
475 |
<div class="card-body">
|
|
|
476 |
<div class="row">
|
|
|
477 |
<div class="col-12 mt-3">
|
|
|
478 |
<?php
|
|
|
479 |
$form = $this->formFilter;
|
|
|
480 |
$form->setAttributes([
|
|
|
481 |
'name' => 'form-filter',
|
|
|
482 |
'id' => 'form-filter',
|
|
|
483 |
]);
|
| 16248 |
efrain |
484 |
|
| 16942 |
stevensc |
485 |
$form->prepare();
|
|
|
486 |
echo $this->form()->openTag($form);
|
|
|
487 |
?>
|
| 16248 |
efrain |
488 |
|
| 16942 |
stevensc |
489 |
<?php
|
|
|
490 |
$element = $form->get('category_id');
|
| 16864 |
efrain |
491 |
|
| 16942 |
stevensc |
492 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
493 |
$element->setLabel('LABEL_CATEGORY');
|
|
|
494 |
echo $this->formLabel($element);
|
|
|
495 |
echo $this->formSelect($element);
|
|
|
496 |
?>
|
| 16797 |
efrain |
497 |
|
| 16942 |
stevensc |
498 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
499 |
</div>
|
|
|
500 |
</div>
|
|
|
501 |
<div class="row">
|
|
|
502 |
<div class="col-12 mt-3">
|
| 16797 |
efrain |
503 |
|
| 16942 |
stevensc |
504 |
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
|
505 |
<li class="nav-item">
|
|
|
506 |
<a class="nav-link active" id="custom-content-user-tab" data-bs-toggle="tab" href="#custom-content-user" role="tab" aria-controls="custom-content-user" aria-selected="true">LABEL_USERS</a>
|
|
|
507 |
</li>
|
|
|
508 |
<li class="nav-item">
|
|
|
509 |
<a class="nav-link" id="custom-content-job-description-tab" data-bs-toggle="tab" href="#custom-content-job-description" role="tab" aria-controls="custom-content-job-description" aria-selected="false">LABEL_JOBS_DESCRIPTION</a>
|
|
|
510 |
</li>
|
|
|
511 |
|
|
|
512 |
</ul>
|
|
|
513 |
<div class="tab-content border border-top-0 p-3" id="myTabContent">
|
|
|
514 |
<div class="tab-pane fade show active" id="custom-content-user" role="tabpanel" aria-labelledby="custom-content-user-tab">
|
|
|
515 |
<div class="card" id="">
|
|
|
516 |
<div class="card-header">
|
|
|
517 |
<h6 class="card-title"></h6>
|
|
|
518 |
</div>
|
|
|
519 |
<div class="card-body">
|
|
|
520 |
<div class="row">
|
|
|
521 |
<div class="col-12 mt-3">
|
|
|
522 |
<table id="gridTable" class="table table-bordered">
|
|
|
523 |
<thead>
|
|
|
524 |
<tr>
|
|
|
525 |
<th>LABEL_FIRST_NAME</th>
|
|
|
526 |
<th>LABEL_LAST_NAME</th>
|
|
|
527 |
<th>LABEL_EMAIL</th>
|
|
|
528 |
<th>LABEL_ROLE</th>
|
|
|
529 |
<th>LABEL_ACTIONS</th>
|
|
|
530 |
</tr>
|
|
|
531 |
</thead>
|
|
|
532 |
<tbody>
|
|
|
533 |
</tbody>
|
|
|
534 |
</table>
|
|
|
535 |
</div>
|
|
|
536 |
</div>
|
|
|
537 |
</div>
|
|
|
538 |
<div class="card-footer text-right">
|
|
|
539 |
<?php if ($allowAdd) : ?>
|
|
|
540 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
541 |
<?php endif; ?>
|
|
|
542 |
<?php if ($allowUpload) : ?>
|
|
|
543 |
<button type="button" class="btn btn-primary btn-upload"><i class="fa fa-upload"></i> LABEL_UPLOAD </button>
|
|
|
544 |
<?php endif; ?>
|
| 16992 |
efrain |
545 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
| 16942 |
stevensc |
546 |
</div>
|
|
|
547 |
</div>
|
|
|
548 |
|
|
|
549 |
|
|
|
550 |
</div>
|
|
|
551 |
|
|
|
552 |
|
|
|
553 |
<div class="tab-pane fade" id="custom-content-job-description" role="tabpanel" aria-labelledby="custom-content-job-description-tab">
|
|
|
554 |
<div class="card" id="">
|
|
|
555 |
<div class="card-header">
|
|
|
556 |
<h6 class="card-title"></h6>
|
|
|
557 |
</div>
|
|
|
558 |
<div class="card-body">
|
|
|
559 |
<div class="row">
|
|
|
560 |
<div class="col-12 mt-3">
|
|
|
561 |
|
|
|
562 |
<div class="tf-tree">
|
|
|
563 |
<form name="form-jobs-description" id="form-jobs-description">
|
|
|
564 |
<ul>
|
|
|
565 |
<li> <span class="tf-nc"><?php echo $companyName ?></span>
|
|
|
566 |
<ul>
|
|
|
567 |
|
|
|
568 |
<?php
|
|
|
569 |
function render_recursive($nodes)
|
|
|
570 |
{
|
|
|
571 |
$s = '';
|
|
|
572 |
foreach ($nodes as $node) {
|
|
|
573 |
$s .= '<li> <span class="tf-nc">';
|
|
|
574 |
$s .= '<input type="checkbox" class="job-description-checkbox" name="job_description_id[]" id="job_description_id' . $node['uuid'] . '" value="' . $node['uuid'] . '">';
|
|
|
575 |
$s .= ' ' . $node['name'] . '</span>';
|
|
|
576 |
|
|
|
577 |
if (!empty($node['children'])) {
|
|
|
578 |
$s .= '<ul>';
|
|
|
579 |
$s .= render_recursive($node['children']);
|
|
|
580 |
$s .= '</ul>';
|
|
|
581 |
}
|
|
|
582 |
|
|
|
583 |
$s .= '</li>';
|
|
|
584 |
}
|
|
|
585 |
return $s;
|
|
|
586 |
}
|
|
|
587 |
|
|
|
588 |
echo render_recursive($jobsDescription)
|
|
|
589 |
?>
|
|
|
590 |
</ul>
|
|
|
591 |
</li>
|
|
|
592 |
</ul>
|
|
|
593 |
</form>
|
|
|
594 |
</div>
|
|
|
595 |
|
|
|
596 |
|
|
|
597 |
</div>
|
|
|
598 |
</div>
|
|
|
599 |
</div>
|
|
|
600 |
<div class="card-footer text-right">
|
| 16992 |
efrain |
601 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
| 16942 |
stevensc |
602 |
<?php if ($allowJobDescription) : ?>
|
|
|
603 |
<button type="button" class="btn btn-info btn-save-job-description"><i class="fa fa-save"></i> LABEL_SAVE </button>
|
|
|
604 |
<?php endif; ?>
|
|
|
605 |
</div>
|
|
|
606 |
</div>
|
|
|
607 |
|
|
|
608 |
</div>
|
|
|
609 |
|
|
|
610 |
</div>
|
|
|
611 |
|
| 16248 |
efrain |
612 |
</div>
|
| 16942 |
stevensc |
613 |
</div>
|
|
|
614 |
</div>
|
|
|
615 |
<!--
|
| 16864 |
efrain |
616 |
<div class="card-footer text-right">
|
|
|
617 |
|
|
|
618 |
</div>
|
|
|
619 |
-->
|
| 16942 |
stevensc |
620 |
</div>
|
| 16864 |
efrain |
621 |
</div>
|
| 16248 |
efrain |
622 |
|
| 16864 |
efrain |
623 |
|
|
|
624 |
|
| 16248 |
efrain |
625 |
<!-- The Modal -->
|
|
|
626 |
<div class="modal" id="modal">
|
|
|
627 |
<div class="modal-dialog modal-xl">
|
|
|
628 |
<div class="modal-content">
|
|
|
629 |
|
|
|
630 |
<!-- Modal Header -->
|
|
|
631 |
<div class="modal-header">
|
| 16845 |
efrain |
632 |
<h6 class="modal-title">LABEL_KNOWLEDGE_AREA_CATEGORY_USERS</h6>
|
| 16822 |
efrain |
633 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
| 16248 |
efrain |
634 |
</div>
|
|
|
635 |
|
|
|
636 |
<!-- Modal body -->
|
|
|
637 |
<div class="modal-body">
|
|
|
638 |
|
|
|
639 |
<?php
|
|
|
640 |
$form = $this->form;
|
|
|
641 |
$form->setAttributes([
|
|
|
642 |
'method' => 'post',
|
|
|
643 |
'name' => 'form',
|
|
|
644 |
'id' => 'form'
|
|
|
645 |
]);
|
|
|
646 |
|
|
|
647 |
$form->prepare();
|
|
|
648 |
echo $this->form()->openTag($form);
|
|
|
649 |
|
|
|
650 |
?>
|
|
|
651 |
<div class="card-body">
|
| 16942 |
stevensc |
652 |
|
|
|
653 |
<div class="row">
|
|
|
654 |
<div class="col-12 mt-3">
|
|
|
655 |
<?php
|
| 16248 |
efrain |
656 |
$element = $form->get('user_id');
|
|
|
657 |
$element->setOptions(['label' => 'LABEL_USER']);
|
|
|
658 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
659 |
|
|
|
660 |
echo $this->formLabel($element);
|
|
|
661 |
echo $this->formSelect($element);
|
|
|
662 |
?>
|
| 16942 |
stevensc |
663 |
</div>
|
|
|
664 |
</div>
|
|
|
665 |
|
|
|
666 |
|
|
|
667 |
<div class="row">
|
|
|
668 |
<div class="col-12 mt-3">
|
|
|
669 |
<?php
|
| 16248 |
efrain |
670 |
$element = $form->get('role');
|
|
|
671 |
$element->setOptions(['label' => 'LABEL_ROLE']);
|
|
|
672 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
673 |
|
|
|
674 |
echo $this->formLabel($element);
|
|
|
675 |
echo $this->formSelect($element);
|
|
|
676 |
?>
|
| 16942 |
stevensc |
677 |
</div>
|
|
|
678 |
</div>
|
| 16248 |
efrain |
679 |
</div>
|
|
|
680 |
</div>
|
|
|
681 |
|
| 16942 |
stevensc |
682 |
|
| 16248 |
efrain |
683 |
<!-- Modal footer -->
|
| 16864 |
efrain |
684 |
<div class="modal-footer text-right">
|
| 16248 |
efrain |
685 |
<button type="submit" id="submitBtn" form="form" class="btn btn-primary">LABEL_SAVE</button>
|
| 16942 |
stevensc |
686 |
<button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
|
| 16248 |
efrain |
687 |
</div>
|
| 16942 |
stevensc |
688 |
<?php echo $this->form()->closeTag($form); ?>
|
| 16248 |
efrain |
689 |
</div>
|
|
|
690 |
|
|
|
691 |
|
|
|
692 |
</div>
|
| 16942 |
stevensc |
693 |
</div>
|