| 15430 |
stevensc |
1 |
<?php
|
|
|
2 |
|
| 66 |
efrain |
3 |
use LeadersLinked\Model\JobDescription;
|
|
|
4 |
|
|
|
5 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
6 |
$currentUser = $this->currentUserHelper();
|
|
|
7 |
|
|
|
8 |
$roleName = $currentUser->getUserTypeId();
|
|
|
9 |
|
| 15394 |
efrain |
10 |
|
| 15443 |
efrain |
11 |
$routeAdd = $this->url('jobs-description/add');
|
|
|
12 |
$routeDatatable = $this->url('jobs-description');
|
|
|
13 |
$routeImport = $this->url('jobs-description/import');
|
| 66 |
efrain |
14 |
$routeDashboard = $this->url('dashboard');
|
|
|
15 |
|
| 15443 |
efrain |
16 |
$allowAdd = $acl->isAllowed($roleName, 'jobs-description/add') ? 1 : 0;
|
|
|
17 |
$allowEdit = $acl->isAllowed($roleName, 'jobs-description/edit') ? 1 : 0;
|
|
|
18 |
$allowDelete = $acl->isAllowed($roleName, 'jobs-description/delete') ? 1 : 0;
|
|
|
19 |
$allowReport = $acl->isAllowed($roleName, 'jobs-description/report') ? 1 : 0;
|
|
|
20 |
$allowImport = $acl->isAllowed($roleName, 'jobs-description/import') ? 1 : 0;
|
| 66 |
efrain |
21 |
|
|
|
22 |
|
| 16822 |
efrain |
23 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
24 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
| 16842 |
efrain |
25 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-maxlength/bootstrap-maxlength.min.js'));
|
| 15394 |
efrain |
26 |
|
| 16822 |
efrain |
27 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
29 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
| 15394 |
efrain |
30 |
|
| 16822 |
efrain |
31 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
32 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
| 15394 |
efrain |
33 |
|
| 16822 |
efrain |
34 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
36 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
37 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
| 15394 |
efrain |
38 |
|
| 16822 |
efrain |
39 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
| 66 |
efrain |
41 |
|
| 15394 |
efrain |
42 |
|
|
|
43 |
|
| 1227 |
geraldo |
44 |
|
| 16822 |
efrain |
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
|
|
|
46 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
|
|
|
47 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
|
|
|
48 |
|
|
|
49 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap4-theme/select2-bootstrap4.css'));
|
|
|
50 |
|
| 15394 |
efrain |
51 |
// bootbox Alert //
|
|
|
52 |
|
| 16822 |
efrain |
53 |
|
| 15394 |
efrain |
54 |
// JsRender //
|
| 16822 |
efrain |
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
|
| 15394 |
efrain |
56 |
|
| 16822 |
efrain |
57 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/orgchart/js/jquery.orgchart.js'));
|
|
|
58 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/orgchart/css/jquery.orgchart.css'));
|
| 15394 |
efrain |
59 |
|
| 16787 |
efrain |
60 |
|
|
|
61 |
|
| 15394 |
efrain |
62 |
$status_active = JobDescription::STATUS_ACTIVE;
|
| 16778 |
efrain |
63 |
$status_inactive = JobDescription::STATUS_INACTIVE;
|
| 15394 |
efrain |
64 |
|
| 16787 |
efrain |
65 |
$this->headStyle()->captureStart();
|
|
|
66 |
echo <<<CSS
|
|
|
67 |
div.orgchart
|
|
|
68 |
{
|
|
|
69 |
width: 100%;
|
|
|
70 |
height: 600px
|
|
|
71 |
}
|
|
|
72 |
CSS;
|
|
|
73 |
$this->headStyle()->captureEnd();
|
|
|
74 |
|
|
|
75 |
|
| 15394 |
efrain |
76 |
$this->inlineScript()->captureStart();
|
|
|
77 |
echo <<<JS
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
jQuery(document).ready(function($) {
|
|
|
81 |
|
| 16770 |
efrain |
82 |
|
|
|
83 |
|
| 15443 |
efrain |
84 |
var competencies_selected = new Array();
|
|
|
85 |
var behaviors = new Array();
|
|
|
86 |
var competency_types = new Array();
|
|
|
87 |
var competencies = new Array();
|
| 15394 |
efrain |
88 |
|
|
|
89 |
var allowEdit = $allowEdit;
|
|
|
90 |
var allowDelete = $allowDelete;
|
|
|
91 |
var allowReport = $allowReport;
|
|
|
92 |
|
|
|
93 |
|
| 16787 |
efrain |
94 |
var datasource = {};
|
|
|
95 |
var dataactions = [];
|
|
|
96 |
var oc = null;
|
|
|
97 |
|
| 15394 |
efrain |
98 |
$.fn.renderCompetencies = function() {
|
|
|
99 |
if(competencies_selected.length > 0) {
|
| 16766 |
efrain |
100 |
|
|
|
101 |
|
| 15394 |
efrain |
102 |
$('#renderCompetencies').html($('#competencyTemplate').render(competencies_selected, {
|
|
|
103 |
getCompetencyType: (uuid) => competency_types.filter((item) => item.uuid == uuid ? item : false)[0],
|
|
|
104 |
getCompetency: (uuid) => competencies.filter((item) => item.uuid == uuid ? item : false)[0],
|
|
|
105 |
getBehavior: (uuid) => behaviors.filter((item) => item.uuid == uuid ? item : false)[0]
|
|
|
106 |
}));
|
|
|
107 |
} else {
|
|
|
108 |
$('#renderCompetencies').html('');
|
|
|
109 |
}
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
$.fn.comboCompetencies = function() {
|
|
|
113 |
$('#select-competency').children().remove();
|
|
|
114 |
$.each(competency_types, function(i, competency_type) {
|
|
|
115 |
competencies_filtered = competencies.filter((item) => item.competency_type_uuid == competency_type.uuid ? item : false)
|
|
|
116 |
$.each(competencies_filtered, function(i, competency) {
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
selected = competencies_selected.filter((item) => item.uuid == competency.uuid ? item : false)[0];
|
|
|
120 |
if(!selected) {
|
|
|
121 |
$('#select-competency').append($('<option>', {
|
|
|
122 |
value: competency.uuid,
|
|
|
123 |
text: competency_type.name + ' - ' + competency.name
|
|
|
124 |
}));
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
});
|
|
|
128 |
});
|
|
|
129 |
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
|
134 |
$.validator.setDefaults({
|
|
|
135 |
debug: true,
|
|
|
136 |
highlight: function(element) {
|
|
|
137 |
$(element).addClass('is-invalid');
|
|
|
138 |
},
|
|
|
139 |
unhighlight: function(element) {
|
|
|
140 |
$(element).removeClass('is-invalid');
|
|
|
141 |
},
|
|
|
142 |
errorElement: 'span',
|
|
|
143 |
errorClass: 'error invalid-feedback',
|
|
|
144 |
errorPlacement: function(error, element) {
|
|
|
145 |
if (element.parent('.form-group').length) {
|
|
|
146 |
error.insertAfter(element);
|
|
|
147 |
} else if (element.parent('.toggle').length) {
|
|
|
148 |
error.insertAfter(element.parent().parent());
|
|
|
149 |
} else {
|
|
|
150 |
error.insertAfter(element.parent());
|
|
|
151 |
}
|
|
|
152 |
}
|
|
|
153 |
});
|
|
|
154 |
|
|
|
155 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
156 |
var field = $(fieldname);
|
|
|
157 |
if (field) {
|
|
|
158 |
$(field).addClass('is-invalid');
|
|
|
159 |
var error = $('<span id="' + fieldname + '-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
160 |
if (field.parent('.form-group').length) {
|
|
|
161 |
error.insertAfter(field);
|
|
|
162 |
} else if (field.parent('.toggle').length) {
|
|
|
163 |
error.insertAfter(field.parent().parent());
|
|
|
164 |
} else {
|
|
|
165 |
error.insertAfter(field.parent());
|
|
|
166 |
}
|
|
|
167 |
}
|
|
|
168 |
};
|
|
|
169 |
|
| 16770 |
efrain |
170 |
|
|
|
171 |
|
| 16779 |
efrain |
172 |
|
| 16787 |
efrain |
173 |
$.fn.recursiveTree = function(parent_branch, parent_item) {
|
|
|
174 |
$.each(parent_item, function(i, item) {
|
|
|
175 |
dataactions.push({
|
|
|
176 |
'uuid' : item['uuid'],
|
|
|
177 |
'link_report' : item['link_report'],
|
|
|
178 |
'link_edit' : item['link_edit'],
|
|
|
179 |
'link_delete' : item['link_delete'],
|
|
|
180 |
})
|
| 16779 |
efrain |
181 |
|
| 16787 |
efrain |
182 |
var branch = {
|
|
|
183 |
'uuid' : item['uuid'],
|
|
|
184 |
'name' : item['name'],
|
|
|
185 |
'children' : [
|
| 16770 |
efrain |
186 |
|
| 16787 |
efrain |
187 |
]
|
|
|
188 |
}
|
| 16770 |
efrain |
189 |
|
| 16787 |
efrain |
190 |
if(item.children.length > 0) {
|
|
|
191 |
$.fn.recursiveTree(branch, item.children);
|
|
|
192 |
}
|
| 16779 |
efrain |
193 |
|
| 16787 |
efrain |
194 |
parent_branch.children.push(branch)
|
| 16779 |
efrain |
195 |
|
| 16787 |
efrain |
196 |
});
|
| 16770 |
efrain |
197 |
|
| 16787 |
efrain |
198 |
}
|
| 16770 |
efrain |
199 |
|
|
|
200 |
|
|
|
201 |
|
|
|
202 |
|
|
|
203 |
$.fn.refreshTree = function() {
|
|
|
204 |
NProgress.start();
|
|
|
205 |
$.ajax({
|
|
|
206 |
'dataType': 'json',
|
|
|
207 |
'accept': 'application/json',
|
|
|
208 |
'method': 'get',
|
|
|
209 |
'url': '$routeDatatable',
|
|
|
210 |
}).done(function(response) {
|
|
|
211 |
if (response['success']) {
|
| 16787 |
efrain |
212 |
dataactions = [];
|
|
|
213 |
datasource = {
|
|
|
214 |
'uuid' : 'n-a',
|
|
|
215 |
'name' : '$company_name',
|
|
|
216 |
'children' : [
|
|
|
217 |
|
|
|
218 |
]
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
|
|
|
222 |
$.fn.recursiveTree(datasource, response['data']['items']);
|
|
|
223 |
|
|
|
224 |
|
|
|
225 |
|
|
|
226 |
oc.init({ 'data': datasource });
|
|
|
227 |
oc.\$chart.find('.node').on('mouseover', function(e) {
|
|
|
228 |
e.preventDefault();
|
|
|
229 |
|
|
|
230 |
$('.horizontalEdge').hide();
|
|
|
231 |
$('.verticalEdge').hide();
|
| 16770 |
efrain |
232 |
});
|
| 16787 |
efrain |
233 |
|
|
|
234 |
oc.\$chart.find('.node').on('click', function() {
|
|
|
235 |
var message = $(this).children('.title').text();
|
|
|
236 |
|
|
|
237 |
|
|
|
238 |
if(!allowEdit && !allowDelete && !allowReport) {
|
|
|
239 |
return;
|
|
|
240 |
}
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
var uuid = $(this).attr('id');
|
|
|
244 |
var link_report = '';
|
|
|
245 |
var link_edit = '';
|
|
|
246 |
var link_delete = '';
|
|
|
247 |
|
|
|
248 |
$.each(dataactions, function(i, item) {
|
|
|
249 |
if(uuid == item.uuid) {
|
|
|
250 |
link_report = item.link_report;
|
|
|
251 |
link_edit = item.link_edit;
|
|
|
252 |
link_delete = item.link_delete;
|
|
|
253 |
}
|
|
|
254 |
});
|
|
|
255 |
|
|
|
256 |
var buttons = {}
|
|
|
257 |
|
|
|
258 |
buttons.cancel = {
|
|
|
259 |
label: 'LABEL_CANCEL',
|
|
|
260 |
className: 'btn-default',
|
|
|
261 |
callback: function(){
|
|
|
262 |
console.log('CANCEL clicked');
|
|
|
263 |
}
|
|
|
264 |
};
|
|
|
265 |
|
|
|
266 |
|
|
|
267 |
if(allowEdit && link_edit) {
|
|
|
268 |
buttons.edit = {
|
|
|
269 |
label: 'LABEL_EDIT',
|
|
|
270 |
className: 'btn-edit',
|
|
|
271 |
callback: function(){
|
|
|
272 |
|
|
|
273 |
setTimeout(() => {
|
|
|
274 |
$.fn.editJobDescription(link_edit);
|
|
|
275 |
}, 250);
|
|
|
276 |
|
|
|
277 |
}
|
|
|
278 |
};
|
|
|
279 |
}
|
|
|
280 |
if(allowDelete && link_delete) {
|
|
|
281 |
buttons.delete = {
|
|
|
282 |
label: 'LABEL_DELETE',
|
|
|
283 |
className: 'btn-delete',
|
|
|
284 |
callback: function(){
|
|
|
285 |
setTimeout(() => {
|
|
|
286 |
$.fn.deleteJobDescription(link_delete);
|
|
|
287 |
}, 250);
|
|
|
288 |
|
|
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
}
|
|
|
293 |
};
|
|
|
294 |
}
|
|
|
295 |
|
|
|
296 |
if(allowReport && link_report) {
|
|
|
297 |
buttons.report = {
|
|
|
298 |
label: 'LABEL_REPORT',
|
|
|
299 |
className: 'btn-default',
|
|
|
300 |
callback: function() {
|
|
|
301 |
setTimeout(() => {
|
|
|
302 |
$.fn.reportJobDescription(link_report);
|
|
|
303 |
}, 250);
|
|
|
304 |
}
|
|
|
305 |
};
|
|
|
306 |
}
|
|
|
307 |
|
|
|
308 |
|
|
|
309 |
let dialog = bootbox.dialog({
|
|
|
310 |
title: 'LABEL_JOB_DESCRIPTION',
|
|
|
311 |
message: message,
|
|
|
312 |
size: 'large',
|
|
|
313 |
buttons: buttons,
|
|
|
314 |
});
|
|
|
315 |
dialog.show();
|
|
|
316 |
|
|
|
317 |
});
|
|
|
318 |
|
| 16770 |
efrain |
319 |
} else {
|
|
|
320 |
$.fn.showError(response['data']);
|
|
|
321 |
}
|
|
|
322 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
323 |
$.fn.showError(textStatus);
|
|
|
324 |
}).always(function() {
|
|
|
325 |
NProgress.done();
|
|
|
326 |
});
|
|
|
327 |
}
|
|
|
328 |
|
| 15394 |
efrain |
329 |
var validator = $('#form').validate({
|
|
|
330 |
debug: true,
|
|
|
331 |
onclick: false,
|
|
|
332 |
onkeyup: false,
|
|
|
333 |
ignore: [],
|
|
|
334 |
rules: {
|
|
|
335 |
'name': {
|
|
|
336 |
required: true,
|
|
|
337 |
maxlength: 64,
|
|
|
338 |
},
|
|
|
339 |
'functions': {
|
|
|
340 |
required: true,
|
| 15443 |
efrain |
341 |
maxlength: 1024,
|
| 15394 |
efrain |
342 |
},
|
|
|
343 |
'objectives': {
|
| 15443 |
efrain |
344 |
required: true,
|
|
|
345 |
maxlength: 1024,
|
| 15394 |
efrain |
346 |
},
|
|
|
347 |
'status': {
|
|
|
348 |
required: false,
|
|
|
349 |
},
|
| 16787 |
efrain |
350 |
'job_description_id_boss' : {
|
|
|
351 |
required: false,
|
|
|
352 |
},
|
| 15394 |
efrain |
353 |
},
|
|
|
354 |
submitHandler: function(form) {
|
|
|
355 |
|
| 16778 |
efrain |
356 |
|
|
|
357 |
|
| 15394 |
efrain |
358 |
var data = {
|
|
|
359 |
name : $('#form #name').val(),
|
|
|
360 |
functions : $('#form #functions').val(),
|
|
|
361 |
objectives : $('#form #objectives').val(),
|
| 16778 |
efrain |
362 |
status : $('#form #status').prop('checked') ? '$status_active' : '$status_inactive',
|
| 16787 |
efrain |
363 |
job_description_id_boss: $('#form #job_description_id_boss').val(),
|
| 15394 |
efrain |
364 |
competencies_selected : new Array(),
|
|
|
365 |
};
|
|
|
366 |
|
|
|
367 |
|
|
|
368 |
$.each(competencies_selected, function(i, c) {
|
|
|
369 |
$.each(c.behaviors, function(i, b) {
|
|
|
370 |
data.competencies_selected.push({'competency_uuid' : c.uuid, 'behavior_uuid' : b.uuid, 'level' : b.level});
|
|
|
371 |
});
|
|
|
372 |
});
|
|
|
373 |
|
|
|
374 |
|
|
|
375 |
NProgress.start();
|
|
|
376 |
$.ajax({
|
|
|
377 |
'dataType': 'json',
|
|
|
378 |
'accept': 'application/json',
|
|
|
379 |
'method': 'post',
|
|
|
380 |
'url': $('#form').attr('action'),
|
|
|
381 |
'data': data,
|
|
|
382 |
}).done(function(response) {
|
|
|
383 |
if (response['success']) {
|
|
|
384 |
$.fn.showSuccess(response['data']);
|
|
|
385 |
$('#row-lists').show();
|
|
|
386 |
$('#row-form').hide();
|
| 16770 |
efrain |
387 |
$.fn.refreshTree();
|
| 15394 |
efrain |
388 |
} else {
|
|
|
389 |
validator.resetForm();
|
|
|
390 |
if (jQuery.type(response['data']) == 'string') {
|
|
|
391 |
$.fn.showError(response['data']);
|
|
|
392 |
} else {
|
|
|
393 |
$.each(response['data'], function(fieldname, errors) {
|
|
|
394 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
395 |
});
|
|
|
396 |
}
|
|
|
397 |
}
|
|
|
398 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
399 |
$.fn.showError(textStatus);
|
|
|
400 |
}).always(function() {
|
|
|
401 |
NProgress.done();
|
|
|
402 |
});
|
|
|
403 |
return false;
|
|
|
404 |
},
|
|
|
405 |
invalidHandler: function(form, validator) {}
|
|
|
406 |
});
|
|
|
407 |
|
| 16770 |
efrain |
408 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
| 15394 |
efrain |
409 |
e.preventDefault();
|
| 16770 |
efrain |
410 |
$.fn.refreshTree();
|
|
|
411 |
});
|
|
|
412 |
|
|
|
413 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
414 |
e.preventDefault();
|
|
|
415 |
$('#row-lists').show();
|
|
|
416 |
$('#row-form').hide();
|
|
|
417 |
$('#div-listing').show();
|
|
|
418 |
});
|
|
|
419 |
|
|
|
420 |
$('body').on('click', 'button.btn-import', function(e) {
|
|
|
421 |
e.preventDefault();
|
| 15394 |
efrain |
422 |
NProgress.start();
|
|
|
423 |
$.ajax({
|
|
|
424 |
'dataType': 'json',
|
| 16770 |
efrain |
425 |
'method': 'post',
|
|
|
426 |
'url': '$routeImport',
|
|
|
427 |
}).done(function(response) {
|
|
|
428 |
if (response['success']) {
|
|
|
429 |
$.fn.showSuccess(response['data']);
|
|
|
430 |
$.fn.refreshTree();
|
|
|
431 |
} else {
|
|
|
432 |
$.fn.showError(response['data']);
|
|
|
433 |
}
|
|
|
434 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
435 |
$.fn.showError(textStatus);
|
|
|
436 |
}).always(function() {
|
|
|
437 |
NProgress.done();
|
|
|
438 |
});
|
|
|
439 |
return false;
|
|
|
440 |
});
|
|
|
441 |
|
|
|
442 |
$('body').on('click', 'button.btn-add-job-description', function(e) {
|
|
|
443 |
e.preventDefault();
|
|
|
444 |
|
| 16787 |
efrain |
445 |
var action = $(this).data('link');
|
| 15394 |
efrain |
446 |
|
| 16787 |
efrain |
447 |
NProgress.start();
|
|
|
448 |
$.ajax({
|
|
|
449 |
'dataType': 'json',
|
|
|
450 |
'accept': 'application/json',
|
|
|
451 |
'method': 'get',
|
|
|
452 |
'url' : '$routeAdd',
|
|
|
453 |
}).done(function(response) {
|
| 16778 |
efrain |
454 |
|
| 16787 |
efrain |
455 |
if (response['success']) {
|
|
|
456 |
behaviors = response['data']['behaviors'];
|
|
|
457 |
competency_types = response['data']['competency_types'];
|
|
|
458 |
competencies = response['data']['competencies'];
|
| 16778 |
efrain |
459 |
|
|
|
460 |
|
| 16787 |
efrain |
461 |
competencies_selected = [];
|
|
|
462 |
$.each(competencies, function(i, competency) {
|
|
|
463 |
$.each(competency.behaviors, function(j, behavior) {
|
|
|
464 |
competencies[i].behaviors[j].level = 0;
|
| 16770 |
efrain |
465 |
});
|
| 16787 |
efrain |
466 |
});
|
| 16778 |
efrain |
467 |
|
| 16787 |
efrain |
468 |
$.fn.renderCompetencies();
|
|
|
469 |
$.fn.comboCompetencies();
|
| 16778 |
efrain |
470 |
|
| 16840 |
efrain |
471 |
|
| 16787 |
efrain |
472 |
$('#form').attr('action', action);
|
|
|
473 |
$('#form #name').val('');
|
|
|
474 |
$('#form #status').bootstrapToggle('on');
|
| 16778 |
efrain |
475 |
|
| 16787 |
efrain |
476 |
$('#form #functions').val('');
|
|
|
477 |
$('#form #objectives').val('');
|
|
|
478 |
|
|
|
479 |
|
|
|
480 |
$('#job_description_id_boss').empty();
|
|
|
481 |
$.each(response['data']['jobs_description'], function(id, text) {
|
|
|
482 |
|
|
|
483 |
var option = new Option(text, id, false, false);
|
|
|
484 |
$('#job_description_id_boss').append(option).trigger('change');
|
|
|
485 |
});
|
|
|
486 |
$('#job_description_id_boss').trigger('change');
|
|
|
487 |
$('#job_description_id_boss').val('').trigger('change');
|
| 16778 |
efrain |
488 |
|
| 16787 |
efrain |
489 |
validator.resetForm();
|
| 16778 |
efrain |
490 |
|
|
|
491 |
|
| 16787 |
efrain |
492 |
$('#custom-tabs #custom-tabs-general-tab').tab('show');
|
|
|
493 |
$('#row-lists').hide();
|
|
|
494 |
$('#row-form').show();
|
| 16778 |
efrain |
495 |
|
| 16787 |
efrain |
496 |
} else {
|
|
|
497 |
$.fn.showError(response['data']);
|
|
|
498 |
}
|
| 16778 |
efrain |
499 |
|
| 16787 |
efrain |
500 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
501 |
$.fn.showError(textStatus);
|
|
|
502 |
}).always(function() {
|
|
|
503 |
NProgress.done();
|
|
|
504 |
});
|
|
|
505 |
});
|
| 15394 |
efrain |
506 |
|
| 16787 |
efrain |
507 |
$.fn.deleteJobDescription = function(action)
|
|
|
508 |
{
|
| 16822 |
efrain |
509 |
swal.fire({
|
|
|
510 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
511 |
icon: 'question',
|
|
|
512 |
cancelButtonText: 'LABEL_NO',
|
|
|
513 |
showCancelButton: true,
|
|
|
514 |
confirmButtonText: 'LABEL_YES'
|
|
|
515 |
}).then((result) => {
|
|
|
516 |
if (result.isConfirmed) {
|
| 16787 |
efrain |
517 |
NProgress.start();
|
|
|
518 |
$.ajax({
|
|
|
519 |
'dataType' : 'json',
|
|
|
520 |
'accept' : 'application/json',
|
|
|
521 |
'method' : 'post',
|
|
|
522 |
'url' : action,
|
|
|
523 |
}).done(function(response) {
|
|
|
524 |
if(response['success']) {
|
|
|
525 |
$.fn.showSuccess(response['data']);
|
|
|
526 |
$.fn.refreshTree();
|
|
|
527 |
} else {
|
|
|
528 |
$.fn.showError(response['data']);
|
|
|
529 |
}
|
|
|
530 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
531 |
$.fn.showError(textStatus);
|
|
|
532 |
}).always(function() {
|
|
|
533 |
NProgress.done();
|
|
|
534 |
});
|
|
|
535 |
}
|
|
|
536 |
}
|
|
|
537 |
});
|
| 16778 |
efrain |
538 |
}
|
| 15394 |
efrain |
539 |
|
| 16787 |
efrain |
540 |
$.fn.editJobDescription = function(action)
|
|
|
541 |
{
|
|
|
542 |
NProgress.start();
|
| 15394 |
efrain |
543 |
|
|
|
544 |
$.ajax({
|
|
|
545 |
'dataType': 'json',
|
| 16770 |
efrain |
546 |
'accept': 'application/json',
|
|
|
547 |
'method': 'get',
|
|
|
548 |
'url': action,
|
| 15394 |
efrain |
549 |
}).done(function(response) {
|
|
|
550 |
if (response['success']) {
|
| 16840 |
efrain |
551 |
|
| 16770 |
efrain |
552 |
$('#form').attr('action', action);
|
| 16787 |
efrain |
553 |
$('#form #id').val(response['data']['id']);
|
| 16770 |
efrain |
554 |
$('#form #name').val(response['data']['name']);
|
|
|
555 |
$('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
|
|
|
556 |
|
|
|
557 |
$('#form #functions').val(response['data']['functions']);
|
|
|
558 |
$('#form #objectives').val(response['data']['objectives']);
|
|
|
559 |
|
|
|
560 |
behaviors = response['data']['behaviors'];
|
|
|
561 |
competency_types = response['data']['competency_types'];
|
|
|
562 |
|
|
|
563 |
competencies = response['data']['competencies'];
|
|
|
564 |
competencies_selected = response['data']['competencies_selected'];
|
| 16787 |
efrain |
565 |
|
|
|
566 |
$('#job_description_id_boss').empty();
|
|
|
567 |
$.each(response['data']['jobs_description'], function(id, text) {
|
|
|
568 |
|
|
|
569 |
var option = new Option(text, id, false, false);
|
|
|
570 |
$('#job_description_id_boss').append(option).trigger('change');
|
|
|
571 |
});
|
|
|
572 |
|
|
|
573 |
$('#job_description_id_boss').trigger('change');
|
|
|
574 |
$('#job_description_id_boss').val(response['data']['job_description_id_boss']).trigger('change');
|
|
|
575 |
|
| 16770 |
efrain |
576 |
|
|
|
577 |
$.fn.renderCompetencies();
|
|
|
578 |
$.fn.comboCompetencies();
|
|
|
579 |
|
|
|
580 |
|
|
|
581 |
validator.resetForm();
|
|
|
582 |
$('#custom-tabs #custom-tabs-general-tab').tab('show');
|
|
|
583 |
$('#row-lists').hide();
|
|
|
584 |
$('#row-form').show();
|
| 15394 |
efrain |
585 |
} else {
|
|
|
586 |
$.fn.showError(response['data']);
|
|
|
587 |
}
|
|
|
588 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
589 |
$.fn.showError(textStatus);
|
|
|
590 |
}).always(function() {
|
|
|
591 |
NProgress.done();
|
|
|
592 |
});
|
| 16787 |
efrain |
593 |
}
|
| 15394 |
efrain |
594 |
|
| 16787 |
efrain |
595 |
$.fn.reportJobDescription = function(action)
|
|
|
596 |
{
|
| 16770 |
efrain |
597 |
window.open(action, '_blank');
|
| 15443 |
efrain |
598 |
|
| 16787 |
efrain |
599 |
}
|
| 15394 |
efrain |
600 |
|
|
|
601 |
$('body').on('click', 'button[id="btn-select-competency"]', function(e) {
|
|
|
602 |
var competency_uuid = $('#select-competency').val();
|
|
|
603 |
|
|
|
604 |
if (competency_uuid.length == '') {
|
|
|
605 |
$.fn.showError('ERROR_SELECT_COMPETENCY_IS_EMPTY');
|
|
|
606 |
} else {
|
|
|
607 |
|
|
|
608 |
competency = competencies.filter((item) => item.uuid == competency_uuid ? item : false)[0];
|
|
|
609 |
if(competency) {
|
|
|
610 |
|
|
|
611 |
var competency_selected = {
|
|
|
612 |
uuid : competency.uuid,
|
|
|
613 |
competency_type_uuid: competency.competency_type_uuid,
|
|
|
614 |
behaviors : new Array(),
|
|
|
615 |
}
|
|
|
616 |
|
|
|
617 |
$.each(competency.behaviors, function(index, uuid) {
|
|
|
618 |
competency_selected.behaviors.push({uuid: uuid, level: 0});
|
|
|
619 |
|
|
|
620 |
})
|
|
|
621 |
|
|
|
622 |
|
|
|
623 |
competencies_selected.push(competency_selected);
|
|
|
624 |
|
|
|
625 |
$.fn.renderCompetencies();
|
|
|
626 |
$.fn.comboCompetencies();
|
|
|
627 |
}
|
|
|
628 |
}
|
|
|
629 |
});
|
|
|
630 |
|
| 16770 |
efrain |
631 |
$('body').on('click', 'i.btn-delete-job-description', function(e) {
|
| 15394 |
efrain |
632 |
e.preventDefault();
|
| 16777 |
efrain |
633 |
var action = $(this).data('link');
|
|
|
634 |
|
| 16822 |
efrain |
635 |
swal.fire({
|
|
|
636 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
637 |
icon: 'question',
|
|
|
638 |
cancelButtonText: 'LABEL_NO',
|
|
|
639 |
showCancelButton: true,
|
|
|
640 |
confirmButtonText: 'LABEL_YES'
|
|
|
641 |
}).then((result) => {
|
|
|
642 |
if (result.isConfirmed) {
|
| 16777 |
efrain |
643 |
NProgress.start();
|
|
|
644 |
$.ajax({
|
|
|
645 |
'dataType': 'json',
|
|
|
646 |
'accept': 'application/json',
|
|
|
647 |
'method': 'post',
|
|
|
648 |
'url': action,
|
|
|
649 |
}).done(function(response) {
|
|
|
650 |
if (response['success']) {
|
|
|
651 |
$.fn.showSuccess(response['data']);
|
|
|
652 |
$.fn.refreshTree();
|
|
|
653 |
} else {
|
|
|
654 |
$.fn.showError(response['data']);
|
|
|
655 |
}
|
|
|
656 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
657 |
$.fn.showError(textStatus);
|
|
|
658 |
}).always(function() {
|
|
|
659 |
NProgress.done();
|
|
|
660 |
});
|
|
|
661 |
}
|
| 15394 |
efrain |
662 |
}
|
|
|
663 |
});
|
| 16777 |
efrain |
664 |
|
|
|
665 |
|
|
|
666 |
|
| 15394 |
efrain |
667 |
});
|
|
|
668 |
|
| 16770 |
efrain |
669 |
$('body').on('click', 'button.btn-delete-job-description-competency', function(e) {
|
| 15394 |
efrain |
670 |
e.preventDefault();
|
|
|
671 |
|
|
|
672 |
var uuid = $(this).data('competency');
|
| 16822 |
efrain |
673 |
swal.fire({
|
|
|
674 |
title: 'LABEL_COMPETENCY_DELETE_TITLE',
|
| 15394 |
efrain |
675 |
message: 'LABEL_COMPETENCY_DELETE_MESSAGE',
|
| 16822 |
efrain |
676 |
icon: 'question',
|
|
|
677 |
cancelButtonText: 'LABEL_NO',
|
|
|
678 |
showCancelButton: true,
|
|
|
679 |
confirmButtonText: 'LABEL_YES'
|
|
|
680 |
}).then((result) => {
|
|
|
681 |
if (result.isConfirmed) {
|
| 15394 |
efrain |
682 |
competencies_selected = competencies_selected.filter((item) => item.uuid != uuid ? item : false);
|
|
|
683 |
|
|
|
684 |
|
|
|
685 |
$.fn.renderCompetencies();
|
|
|
686 |
$.fn.comboCompetencies();
|
|
|
687 |
|
|
|
688 |
}
|
|
|
689 |
});
|
|
|
690 |
});
|
|
|
691 |
|
| 16770 |
efrain |
692 |
$('body').on('click','button.btn-edit-job-description-behavior', function(e) {
|
| 15394 |
efrain |
693 |
e.preventDefault();
|
|
|
694 |
|
|
|
695 |
var competency_uuid = $(this).closest('div.panel-competency').data('competency');
|
|
|
696 |
var behavior_uuid = $(this).data('behavior');
|
|
|
697 |
|
|
|
698 |
|
|
|
699 |
competency_selected = competencies_selected.filter((item) => item.uuid == competency_uuid ? item : false)[0];
|
|
|
700 |
if(competency_selected) {
|
|
|
701 |
console.log(competency_selected);
|
|
|
702 |
|
|
|
703 |
behavior = competency_selected .behaviors.filter((item) => item.uuid == behavior_uuid ? item : false)[0];
|
|
|
704 |
if(behavior) {
|
|
|
705 |
|
|
|
706 |
console.log(behavior);
|
|
|
707 |
$('#form-behavior #competency-uuid').val(competency_uuid);
|
|
|
708 |
$('#form-behavior #behavior-uuid').val(behavior_uuid);
|
|
|
709 |
$('#form-behavior #level').val(behavior.level);
|
|
|
710 |
|
|
|
711 |
$('#modal-behavior').modal('show');
|
|
|
712 |
}
|
|
|
713 |
|
|
|
714 |
}
|
|
|
715 |
});
|
|
|
716 |
|
|
|
717 |
$('body').on('click','button.btn-behavior-submit', function(e) {
|
|
|
718 |
e.preventDefault();
|
|
|
719 |
$('#modal-behavior').modal('hide');
|
|
|
720 |
|
|
|
721 |
var competency_uuid = $('#form-behavior #competency-uuid').val();
|
|
|
722 |
var behavior_uuid = $('#form-behavior #behavior-uuid').val();
|
|
|
723 |
var level = $('#form-behavior #level').val();
|
|
|
724 |
|
|
|
725 |
competency_selected = competencies_selected.filter((item) => item.uuid == competency_uuid ? item : false)[0];
|
|
|
726 |
if(competency_selected) {
|
|
|
727 |
behavior = competency_selected .behaviors.filter((item) => item.uuid == behavior_uuid ? item : false)[0];
|
|
|
728 |
if(behavior) {
|
|
|
729 |
behavior.level = level;
|
|
|
730 |
$.fn.renderCompetencies();
|
|
|
731 |
}
|
|
|
732 |
|
|
|
733 |
}
|
|
|
734 |
|
|
|
735 |
});
|
|
|
736 |
|
| 16770 |
efrain |
737 |
$('body').on('click', 'button.btn-edit-job-description-cancel', function(e) {
|
| 15394 |
efrain |
738 |
$('#row-lists').show();
|
|
|
739 |
$('#row-form').hide();
|
|
|
740 |
});
|
|
|
741 |
|
|
|
742 |
$('#form #status').bootstrapToggle({
|
|
|
743 |
'on': 'LABEL_ACTIVE',
|
|
|
744 |
'off': 'LABEL_INACTIVE',
|
|
|
745 |
'width': '160px',
|
|
|
746 |
'height': '40px'
|
|
|
747 |
});
|
|
|
748 |
|
| 15443 |
efrain |
749 |
$('#form #functions').maxlength({
|
|
|
750 |
alwaysShow: true,
|
|
|
751 |
validate: true
|
|
|
752 |
});
|
|
|
753 |
|
|
|
754 |
$('#form #objectives').maxlength({
|
|
|
755 |
alwaysShow: true,
|
|
|
756 |
validate: true
|
|
|
757 |
});
|
|
|
758 |
|
| 16770 |
efrain |
759 |
$('#select-competency').select2({
|
| 15394 |
efrain |
760 |
theme: 'bootstrap4',
|
|
|
761 |
width: '100%',
|
|
|
762 |
});
|
|
|
763 |
|
| 16791 |
efrain |
764 |
$('#job_description_id_boss').select2({
|
| 16787 |
efrain |
765 |
theme: 'bootstrap4',
|
|
|
766 |
width: '100%',
|
|
|
767 |
});
|
| 15394 |
efrain |
768 |
|
|
|
769 |
|
| 16787 |
efrain |
770 |
oc = $('#chart-container').orgchart({
|
|
|
771 |
'data' : datasource,
|
|
|
772 |
'nodeId': 'uuid' ,
|
|
|
773 |
});
|
| 15394 |
efrain |
774 |
|
| 16787 |
efrain |
775 |
|
|
|
776 |
|
|
|
777 |
|
|
|
778 |
$.fn.refreshTree();
|
| 15394 |
efrain |
779 |
});
|
|
|
780 |
|
| 14184 |
stevensc |
781 |
JS;
|
| 66 |
efrain |
782 |
$this->inlineScript()->captureEnd();
|
| 15394 |
efrain |
783 |
?>
|
| 16770 |
efrain |
784 |
|
|
|
785 |
|
| 16773 |
efrain |
786 |
<section class="content" id="row-lists" style="margin-bottom: 20px">
|
| 14185 |
stevensc |
787 |
|
| 15430 |
stevensc |
788 |
<!-- Content Header (Page header) -->
|
|
|
789 |
<div class="content-header">
|
|
|
790 |
<div class="container-fluid">
|
|
|
791 |
<div class="row mb-2">
|
|
|
792 |
<div class="col-sm-12">
|
|
|
793 |
<h1>LABEL_JOBS_DESCRIPTION</h1>
|
|
|
794 |
</div>
|
| 15394 |
efrain |
795 |
</div>
|
| 15430 |
stevensc |
796 |
</div>
|
|
|
797 |
<!-- /.container-fluid -->
|
|
|
798 |
</div>
|
|
|
799 |
<div class="container-fluid">
|
|
|
800 |
<div class="row">
|
|
|
801 |
<div class="col-12">
|
|
|
802 |
<div class="card">
|
|
|
803 |
<div class="card-body">
|
| 16791 |
efrain |
804 |
<div id="chart-container" style="width: 100%; height: 600px">
|
|
|
805 |
</div>
|
| 15430 |
stevensc |
806 |
</div>
|
|
|
807 |
<div class="card-footer clearfix">
|
| 16776 |
efrain |
808 |
<div style="float:right;" >
|
| 15430 |
stevensc |
809 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
|
|
|
810 |
<?php if ($allowAdd) : ?>
|
|
|
811 |
<?php if ($allowImport) : ?>
|
|
|
812 |
<button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
|
|
|
813 |
<?php endif; ?>
|
| 16770 |
efrain |
814 |
<button type="button" class="btn btn-primary btn-add-job-description" data-link="<?php echo $routeAdd ?>"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
| 15430 |
stevensc |
815 |
<?php endif; ?>
|
|
|
816 |
</div>
|
|
|
817 |
</div>
|
|
|
818 |
</div>
|
|
|
819 |
</div>
|
|
|
820 |
</div>
|
|
|
821 |
</div>
|
| 15394 |
efrain |
822 |
</section>
|
|
|
823 |
|
|
|
824 |
<section id="row-form" style="display:none">
|
| 16776 |
efrain |
825 |
<div class="card">
|
|
|
826 |
<div class="card-header">
|
| 16840 |
efrain |
827 |
<h4 class="modal-title">LABEL_JOB_DESCRIPTION</h4>
|
| 15430 |
stevensc |
828 |
</div>
|
| 16784 |
efrain |
829 |
<div class="card-body">
|
| 15430 |
stevensc |
830 |
<div class="card card-primary card-outline card-tabs">
|
|
|
831 |
<div class="card-header p-0 pt-1 border-bottom-0">
|
|
|
832 |
<ul class="nav nav-tabs" id="custom-tabs" role="tablist">
|
|
|
833 |
<li class="nav-item">
|
|
|
834 |
<a class="nav-link active" id="custom-tabs-general-tab" data-toggle="pill" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
|
|
|
835 |
</li>
|
|
|
836 |
<li class="nav-item">
|
|
|
837 |
<a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="pill" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
|
|
|
838 |
</li>
|
|
|
839 |
</ul>
|
|
|
840 |
</div>
|
|
|
841 |
<div class="card-body">
|
|
|
842 |
<?php
|
|
|
843 |
$form = $this->form;
|
|
|
844 |
$form->setAttributes([
|
|
|
845 |
'method' => 'post',
|
|
|
846 |
'name' => 'form',
|
|
|
847 |
'id' => 'form'
|
|
|
848 |
]);
|
|
|
849 |
|
|
|
850 |
$form->prepare();
|
|
|
851 |
echo $this->form()->openTag($form);
|
|
|
852 |
|
|
|
853 |
|
|
|
854 |
$element = $form->get('competencies');
|
|
|
855 |
echo $this->formHidden($element);
|
|
|
856 |
|
|
|
857 |
?>
|
|
|
858 |
|
|
|
859 |
<div class="tab-content" id="custom-tabs-three-tabContent">
|
|
|
860 |
<div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
|
|
|
861 |
<div class="row">
|
|
|
862 |
<div class="col-md col-sm-12 col-12">
|
|
|
863 |
<div class="form-group m-0">
|
|
|
864 |
<?php
|
|
|
865 |
$element = $form->get('name');
|
|
|
866 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
867 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
868 |
|
|
|
869 |
echo $this->formLabel($element);
|
|
|
870 |
echo $this->formText($element);
|
|
|
871 |
?>
|
|
|
872 |
</div>
|
|
|
873 |
</div>
|
|
|
874 |
<div class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center">
|
|
|
875 |
<div class="form-group m-0">
|
|
|
876 |
<label>LABEL_STATUS</label>
|
|
|
877 |
<br />
|
|
|
878 |
<?php
|
|
|
879 |
$element = $form->get('status');
|
|
|
880 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
881 |
// echo $this->formLabel($element);
|
|
|
882 |
echo $this->formCheckbox($element);
|
|
|
883 |
?>
|
|
|
884 |
</div>
|
|
|
885 |
</div>
|
|
|
886 |
</div>
|
|
|
887 |
<div class="form-group">
|
|
|
888 |
<?php
|
|
|
889 |
$element = $form->get('objectives');
|
|
|
890 |
$element->setOptions(['label' => 'LABEL_OBJECTIVES']);
|
|
|
891 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
892 |
|
|
|
893 |
echo $this->formLabel($element);
|
|
|
894 |
echo $this->formTextArea($element);
|
|
|
895 |
?>
|
|
|
896 |
</div>
|
|
|
897 |
<div class="form-group">
|
|
|
898 |
<?php
|
|
|
899 |
$element = $form->get('functions');
|
|
|
900 |
$element->setOptions(['label' => 'LABEL_FUNCTIONS']);
|
|
|
901 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
902 |
|
|
|
903 |
echo $this->formLabel($element);
|
|
|
904 |
echo $this->formTextArea($element);
|
|
|
905 |
?>
|
|
|
906 |
</div>
|
| 16787 |
efrain |
907 |
<div class="form-group">
|
|
|
908 |
<?php
|
|
|
909 |
$element = $form->get('job_description_id_boss');
|
|
|
910 |
$element->setOptions(['label' => 'LABEL_BOSS']);
|
|
|
911 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
912 |
|
|
|
913 |
echo $this->formLabel($element);
|
|
|
914 |
echo $this->formSelect($element);
|
|
|
915 |
?>
|
|
|
916 |
</div>
|
| 15394 |
efrain |
917 |
</div>
|
| 15430 |
stevensc |
918 |
<div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
|
|
|
919 |
<div class="row">
|
|
|
920 |
<div class="col-md-8 col-sm-8 col-xs-12">
|
|
|
921 |
<select id="select-competency" class="form-control"> </select>
|
|
|
922 |
</div>
|
|
|
923 |
<div class="col-md-4 col-sm-4 col-xs-12">
|
|
|
924 |
<button type="button" class="btn btn-primary" id="btn-select-competency" data-toggle="tooltip" title="LABEL_ADD LABEL_COMPETENCY">LABEL_ADD LABEL_COMPETENCY</button>
|
|
|
925 |
</div>
|
|
|
926 |
</div>
|
|
|
927 |
<div class="row">
|
|
|
928 |
<br>
|
|
|
929 |
<div class="col-md-12 col-sm-12 col-xs-12" id="renderCompetencies" style="margin-top: 10px;">
|
|
|
930 |
</div>
|
|
|
931 |
</div>
|
| 15394 |
efrain |
932 |
</div>
|
| 15430 |
stevensc |
933 |
</div>
|
|
|
934 |
</div>
|
| 15394 |
efrain |
935 |
</div>
|
| 15430 |
stevensc |
936 |
<?php echo $this->form()->closeTag($form); ?>
|
| 16776 |
efrain |
937 |
|
| 15430 |
stevensc |
938 |
</div>
|
| 16776 |
efrain |
939 |
<div class="card-footer clearfix">
|
| 15430 |
stevensc |
940 |
<button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
|
| 16770 |
efrain |
941 |
<button type="button" class="btn btn-danger btn-edit-job-description-cancel">Cerrar</button>
|
| 15430 |
stevensc |
942 |
</div>
|
| 16776 |
efrain |
943 |
</div>
|
|
|
944 |
|
|
|
945 |
|
| 15394 |
efrain |
946 |
</section>
|
|
|
947 |
|
|
|
948 |
|
|
|
949 |
<!--start modal behavior-->
|
| 15430 |
stevensc |
950 |
<div id="modal-behavior" class="modal" tabindex="-1" role="dialog">
|
| 16778 |
efrain |
951 |
<form action="#" name="form-behavior" id="form-behavior">
|
|
|
952 |
<div class="modal-dialog " role="document">
|
|
|
953 |
<input type="hidden" id="behavior-uuid" name="behavior-uuid" value="" />
|
|
|
954 |
<input type="hidden" id="competency-uuid" name="competency-uuid value="" />
|
|
|
955 |
<div class=" modal-content">
|
|
|
956 |
<div class="modal-header">
|
|
|
957 |
<h4 class="modal-title">LABEL_EDIT LABEL_LEVEL</h4>
|
|
|
958 |
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
959 |
<span aria-hidden="true">×</span>
|
|
|
960 |
</button>
|
|
|
961 |
</div>
|
|
|
962 |
<div class="modal-body">
|
|
|
963 |
<div class="form-group">
|
|
|
964 |
<label for="behavior-value">LABEL_LEVEL</label>
|
|
|
965 |
<input type="number" step="1" min="0" max="100" id="level" name="level">
|
|
|
966 |
</div>
|
|
|
967 |
<div class="modal-footer">
|
|
|
968 |
<button type="button" class="btn btn-primary btn-behavior-submit">LABEL_SAVE</button>
|
| 16822 |
efrain |
969 |
<button type="button" class="btn btn-light" data-dismiss="modal">LABEL_CLOSE</button>
|
| 16778 |
efrain |
970 |
</div>
|
|
|
971 |
</div>
|
|
|
972 |
</div>
|
|
|
973 |
</div>
|
|
|
974 |
</form>
|
| 15394 |
efrain |
975 |
</div>
|
| 15436 |
stevensc |
976 |
|
| 15394 |
efrain |
977 |
|
| 15443 |
efrain |
978 |
|
| 15430 |
stevensc |
979 |
<!---Template Competencies --->
|
|
|
980 |
<script id="competencyTemplate" type="text/x-jsrender">
|
|
|
981 |
<div class="panel panel-default panel-competency" id="panel-{{:uuid}}" data-competency="{{:uuid}}">
|
| 15394 |
efrain |
982 |
<div class="panel-heading">
|
|
|
983 |
<h4 class="panel-title" style=" font-size: 18px;">
|
|
|
984 |
<a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:uuid}}" href="#collapse-{{:uuid}}">
|
|
|
985 |
<span class="section-name{{:uuid}}">
|
|
|
986 |
{{:~getCompetencyType(competency_type_uuid).name}} - {{:~getCompetency(uuid).name}}
|
|
|
987 |
</span>
|
|
|
988 |
</a>
|
|
|
989 |
</h4>
|
|
|
990 |
</div>
|
|
|
991 |
<div id="collapse-{{:uuid}}" class="panel-collapse in collapse show">
|
|
|
992 |
<div class="panel-body">
|
|
|
993 |
<div class="table-responsive">
|
|
|
994 |
<table class="table table-bordered">
|
|
|
995 |
<thead>
|
|
|
996 |
<tr>
|
|
|
997 |
<th style="width: 20%;">LABEL_ELEMENT</th>
|
|
|
998 |
<th style="width: 50%;">LABEL_TITLE</th>
|
|
|
999 |
<th style="width: 10%;">LABEL_LEVEL</th>
|
|
|
1000 |
<th style="width: 20%;">LABEL_ACTIONS</th>
|
|
|
1001 |
</tr>
|
|
|
1002 |
</thead>
|
|
|
1003 |
<tbody>
|
|
|
1004 |
<tr>
|
|
|
1005 |
<td class="text-left">LABEL_COMPETENCY</td>
|
|
|
1006 |
<td class="text-left">{{:name}}</td>
|
|
|
1007 |
<td>
|
|
|
1008 |
</td>
|
|
|
1009 |
<td>
|
| 16770 |
efrain |
1010 |
<button type="button" class="btn btn-default btn-delete-job-description-competency" data-competency="{{:uuid}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button>
|
| 15394 |
efrain |
1011 |
</td>
|
|
|
1012 |
</tr>
|
|
|
1013 |
{{for behaviors}}
|
|
|
1014 |
<tr >
|
|
|
1015 |
<td class="text-left">--LABEL_BEHAVIOR</td>
|
|
|
1016 |
<td class="text-left">
|
|
|
1017 |
{{:~getBehavior(uuid).description}}
|
|
|
1018 |
</td>
|
| 15443 |
efrain |
1019 |
<td class="text-right">
|
|
|
1020 |
{{:level}}
|
|
|
1021 |
</td>
|
| 15394 |
efrain |
1022 |
<td>
|
| 16770 |
efrain |
1023 |
<button type="button" class="btn btn-default btn-edit-job-description-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button>
|
| 15443 |
efrain |
1024 |
</td>
|
|
|
1025 |
</tr>
|
|
|
1026 |
{{/for}}
|
|
|
1027 |
</tbody>
|
|
|
1028 |
</table>
|
|
|
1029 |
</div>
|
|
|
1030 |
</div>
|
|
|
1031 |
</div>
|
|
|
1032 |
</div>
|
|
|
1033 |
</script>
|
|
|
1034 |
|
|
|
1035 |
<script id="competencyTemplateWithLevel" type="text/x-jsrender">
|
|
|
1036 |
<div class="panel panel-default panel-competency" id="panel-{{:uuid}}" data-competency="{{:uuid}}">
|
|
|
1037 |
<div class="panel-heading">
|
|
|
1038 |
<h4 class="panel-title" style=" font-size: 18px;">
|
|
|
1039 |
<a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:uuid}}" href="#collapse-{{:uuid}}">
|
|
|
1040 |
<span class="section-name{{:uuid}}">
|
|
|
1041 |
{{:~getCompetencyType(competency_type_uuid).name}} - {{:~getCompetency(uuid).name}}
|
|
|
1042 |
</span>
|
|
|
1043 |
</a>
|
|
|
1044 |
</h4>
|
|
|
1045 |
</div>
|
|
|
1046 |
<div id="collapse-{{:uuid}}" class="panel-collapse in collapse show">
|
|
|
1047 |
<div class="panel-body">
|
|
|
1048 |
<div class="table-responsive">
|
|
|
1049 |
<table class="table table-bordered">
|
|
|
1050 |
<thead>
|
|
|
1051 |
<tr>
|
|
|
1052 |
<th style="width: 20%;">LABEL_ELEMENT</th>
|
|
|
1053 |
<th style="width: 50%;">LABEL_TITLE</th>
|
|
|
1054 |
<th style="width: 10%;">LABEL_LEVEL</th>
|
|
|
1055 |
<th style="width: 20%;">LABEL_ACTIONS</th>
|
|
|
1056 |
</tr>
|
|
|
1057 |
</thead>
|
|
|
1058 |
<tbody>
|
|
|
1059 |
<tr>
|
|
|
1060 |
<td class="text-left">LABEL_COMPETENCY</td>
|
|
|
1061 |
<td class="text-left">{{:name}}</td>
|
|
|
1062 |
<td>
|
|
|
1063 |
</td>
|
|
|
1064 |
<td>
|
| 16770 |
efrain |
1065 |
<button type="button" class="btn btn-default btn-delete-job-description-competency" data-competency="{{:uuid}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button>
|
| 15443 |
efrain |
1066 |
</td>
|
|
|
1067 |
</tr>
|
|
|
1068 |
{{for behaviors}}
|
|
|
1069 |
<tr >
|
|
|
1070 |
<td class="text-left">--LABEL_BEHAVIOR</td>
|
|
|
1071 |
<td class="text-left">
|
|
|
1072 |
{{:~getBehavior(uuid).description}}
|
|
|
1073 |
</td>
|
|
|
1074 |
<td>
|
| 15394 |
efrain |
1075 |
{{if level == '0'}} LABEL_NA {{/if}}
|
|
|
1076 |
{{if level == '1' }} LABEL_LEVEL_ONE {{/if}}
|
|
|
1077 |
{{if level == '2' }} LABEL_LEVEL_TWO {{/if}}
|
|
|
1078 |
{{if level == '3' }} LABEL_LEVEL_THREE {{/if}}
|
|
|
1079 |
{{if level == '4' }} LABEL_LEVEL_FOUR {{/if}}
|
|
|
1080 |
</td>
|
|
|
1081 |
<td>
|
| 16770 |
efrain |
1082 |
<button type="button" class="btn btn-default btn-edit-job-description-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button>
|
| 15394 |
efrain |
1083 |
</td>
|
|
|
1084 |
</tr>
|
|
|
1085 |
{{/for}}
|
|
|
1086 |
</tbody>
|
|
|
1087 |
</table>
|
|
|
1088 |
</div>
|
|
|
1089 |
</div>
|
|
|
1090 |
</div>
|
|
|
1091 |
</div>
|
|
|
1092 |
</script>
|
|
|
1093 |
|
| 16770 |
efrain |
1094 |
<script id="listJobDescriptionTemplate" type="text/x-jsrender">
|
| 16779 |
efrain |
1095 |
<li data-id="{{:uuid}}" >
|
|
|
1096 |
<div class="content">
|
|
|
1097 |
|
|
|
1098 |
|
|
|
1099 |
|
|
|
1100 |
<div class="sidebar {{if status == '<?php echo JobDescription::STATUS_INACTIVE ?>' }} sidebar-inactive {{/if}}">
|
|
|
1101 |
|
| 16778 |
efrain |
1102 |
{{>name}}
|
| 16779 |
efrain |
1103 |
<div class="float-right right-sidebar">
|
| 16778 |
efrain |
1104 |
{{if status == '<?php echo JobDescription::STATUS_ACTIVE ?>' }}
|
| 16770 |
efrain |
1105 |
{{if link_add }}
|
|
|
1106 |
<i class="fa fa-plus btn-add-job-description" data-link="{{:link_add}}"></i>
|
|
|
1107 |
{{/if}}
|
| 16778 |
efrain |
1108 |
{{/if}}
|
| 16770 |
efrain |
1109 |
{{if link_edit }}
|
|
|
1110 |
<i class="fa fa-pencil btn-edit-job-description" data-link="{{:link_edit}}"></i>
|
|
|
1111 |
{{/if}}
|
|
|
1112 |
{{if link_delete }}
|
|
|
1113 |
<i class="fa fa-trash btn-delete-job-description" data-link="{{:link_delete}}"></i>
|
|
|
1114 |
{{/if}}
|
| 16778 |
efrain |
1115 |
{{if status == '<?php echo JobDescription::STATUS_ACTIVE ?>' }}
|
| 16770 |
efrain |
1116 |
{{if link_report }}
|
|
|
1117 |
<i class="fa fa-file-o btn-pdf-job-description" data-link="{{:link_report}}"></i>
|
|
|
1118 |
{{/if}}
|
| 16778 |
efrain |
1119 |
{{/if}}
|
| 16770 |
efrain |
1120 |
</div>
|
| 16779 |
efrain |
1121 |
</div>
|
|
|
1122 |
</div>
|
| 16770 |
efrain |
1123 |
<ol>
|
|
|
1124 |
{{for children tmpl="#listJobDescriptionTemplate"/}}
|
|
|
1125 |
</ol>
|
|
|
1126 |
</li>
|
|
|
1127 |
</script>
|
| 15394 |
efrain |
1128 |
|