15461 |
efrain |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
4 |
$currentUser = $this->currentUserHelper();
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
$routeDatatable = $this->url( 'activities-center/recruitment-and-selection');
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
$allowTakeaTest = $acl->isAllowed($roleName, 'activities-center/recruitment-and-selection/take-a-test') ? 1 : 0;
|
|
|
11 |
$allowReport = $acl->isAllowed($roleName, 'activities-center/recruitment-and-selection/report') ? 1 : 0;
|
|
|
12 |
|
16822 |
efrain |
13 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
14 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
15461 |
efrain |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
16842 |
efrain |
20 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-maxlength/bootstrap-maxlength.min.js'));
|
15461 |
efrain |
21 |
|
|
|
22 |
|
|
|
23 |
|
16929 |
efrain |
24 |
|
|
|
25 |
|
|
|
26 |
|
16822 |
efrain |
27 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
28 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
15461 |
efrain |
29 |
|
16822 |
efrain |
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
31 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
15461 |
efrain |
34 |
|
|
|
35 |
|
|
|
36 |
|
16929 |
efrain |
37 |
|
|
|
38 |
|
|
|
39 |
|
16822 |
efrain |
40 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
|
|
|
41 |
//$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
|
|
|
42 |
//$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
|
15461 |
efrain |
43 |
|
16822 |
efrain |
44 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datepicker/js/bootstrap-datepicker.js'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datepicker/js/bootstrap-datepicker.es.js'));
|
15461 |
efrain |
46 |
|
|
|
47 |
|
16822 |
efrain |
48 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datepicker/css/bootstrap-datepicker.css'));
|
15461 |
efrain |
49 |
|
16822 |
efrain |
50 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
|
16918 |
efrain |
51 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
|
16822 |
efrain |
52 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.min.js'));
|
|
|
53 |
|
15461 |
efrain |
54 |
// JsRender //
|
16822 |
efrain |
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
|
15461 |
efrain |
56 |
|
16822 |
efrain |
57 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
58 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
15461 |
efrain |
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
16804 |
efrain |
63 |
|
16822 |
efrain |
64 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
|
16804 |
efrain |
65 |
|
16822 |
efrain |
66 |
|
|
|
67 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-wizard/jquery.smartWizard.min.js'));
|
|
|
68 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/jquery-wizard/smart_wizard_all.min.css'));
|
|
|
69 |
|
16843 |
efrain |
70 |
//$this->headLink()->appendStylesheet($this->basePath('css/activity-center-accordion.css'));
|
16804 |
efrain |
71 |
|
15461 |
efrain |
72 |
$this->inlineScript()->captureStart();
|
|
|
73 |
echo <<<JS
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
jQuery( document ).ready(function( $ ) {
|
|
|
77 |
|
|
|
78 |
var allowTakeaTest = $allowTakeaTest;
|
|
|
79 |
var allowReport = $allowReport
|
|
|
80 |
|
|
|
81 |
var competencies_selected = new Array();
|
|
|
82 |
var subordinates_selected = new Array();
|
|
|
83 |
|
|
|
84 |
var competency_types = new Array();
|
|
|
85 |
var competencies = new Array();
|
|
|
86 |
var behaviors = new Array();
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
$.fn.renderJobDescription = function(data) {
|
|
|
90 |
|
|
|
91 |
$('#div-job-description').html($('#job-description-template').render(data));
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
$.fn.renderCompetencies = function() {
|
|
|
96 |
|
|
|
97 |
if(competencies_selected.length > 0) {
|
|
|
98 |
|
16804 |
efrain |
99 |
$('#accordion').html($('#competencyTemplate').render(competencies_selected, {
|
15461 |
efrain |
100 |
getCompetencyType: (uuid) => competency_types.filter((item) => item.uuid == uuid ? item : false)[0],
|
|
|
101 |
getCompetency: (uuid) => competencies.filter((item) => item.uuid == uuid ? item : false)[0],
|
|
|
102 |
getBehavior: (uuid) => behaviors.filter((item) => item.uuid == uuid ? item : false)[0]
|
|
|
103 |
}));
|
|
|
104 |
} else {
|
16804 |
efrain |
105 |
$('#accordion').empty();
|
|
|
106 |
}
|
15461 |
efrain |
107 |
|
16804 |
efrain |
108 |
$('.collapse.show').each(function(){
|
|
|
109 |
$(this).siblings('.card-header').find('.btn i').attr('class', 'fa fa-minus');
|
|
|
110 |
});
|
|
|
111 |
|
|
|
112 |
$('.collapse').on('show.bs.collapse', function(){
|
|
|
113 |
$(this).parent().find('.card-header .btn i').attr('class', 'fa fa-minus');
|
|
|
114 |
}).on('hide.bs.collapse', function(){
|
|
|
115 |
$(this).parent().find('.card-header .btn i').attr('class', 'fa fa-plus');
|
|
|
116 |
});
|
15461 |
efrain |
117 |
}
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
16929 |
efrain |
123 |
|
15461 |
efrain |
124 |
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
128 |
'processing': true,
|
|
|
129 |
'serverSide': true,
|
|
|
130 |
'searching': true,
|
|
|
131 |
'search' : {
|
|
|
132 |
'search' : '$search',
|
|
|
133 |
},
|
|
|
134 |
|
|
|
135 |
'order': [[ 1, 'asc' ]],
|
|
|
136 |
'ordering': true,
|
|
|
137 |
'ordenable' : true,
|
|
|
138 |
'responsive': true,
|
|
|
139 |
'select' : false,
|
|
|
140 |
'paging': true,
|
|
|
141 |
'pagingType': 'simple_numbers',
|
|
|
142 |
'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, 'All'] ],
|
|
|
143 |
|
|
|
144 |
'ajax': {
|
|
|
145 |
'url' : '$routeDatatable',
|
|
|
146 |
'type' : 'get',
|
|
|
147 |
'data': function ( d ) {
|
|
|
148 |
|
|
|
149 |
|
|
|
150 |
},
|
|
|
151 |
'beforeSend': function (request) {
|
|
|
152 |
NProgress.start();
|
|
|
153 |
},
|
|
|
154 |
'dataFilter': function(response) {
|
|
|
155 |
var response = jQuery.parseJSON( response );
|
|
|
156 |
|
|
|
157 |
var json = {};
|
|
|
158 |
json.recordsTotal = 0;
|
|
|
159 |
json.recordsFiltered = 0;
|
|
|
160 |
json.data = [];
|
|
|
161 |
|
|
|
162 |
if(response.success) {
|
|
|
163 |
json.recordsTotal = response.data.total;
|
|
|
164 |
json.recordsFiltered = response.data.total;
|
|
|
165 |
json.data = response.data.items;
|
|
|
166 |
} else {
|
|
|
167 |
$.fn.showError(response.data)
|
|
|
168 |
}
|
|
|
169 |
|
|
|
170 |
return JSON.stringify( json );
|
|
|
171 |
}
|
|
|
172 |
},
|
|
|
173 |
'language' : {
|
|
|
174 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
175 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
176 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
177 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
178 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
179 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
180 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
181 |
'sInfoPostFix': '',
|
|
|
182 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
183 |
'sUrl': '',
|
|
|
184 |
'sInfoThousands': ',',
|
|
|
185 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
186 |
'oPaginate': {
|
|
|
187 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
188 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
189 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
190 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
191 |
},
|
|
|
192 |
'oAria': {
|
|
|
193 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
194 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
195 |
},
|
|
|
196 |
},
|
|
|
197 |
'drawCallback': function( settings ) {
|
|
|
198 |
NProgress.done();
|
16822 |
efrain |
199 |
|
15461 |
efrain |
200 |
|
|
|
201 |
|
|
|
202 |
},
|
|
|
203 |
'aoColumns': [
|
|
|
204 |
{ 'mDataProp': 'last_date' },
|
|
|
205 |
{ 'mDataProp': 'type' },
|
|
|
206 |
{ 'mDataProp': 'vacancy' },
|
|
|
207 |
{ 'mDataProp': 'candidate' },
|
|
|
208 |
{ 'mDataProp': 'status' },
|
|
|
209 |
|
|
|
210 |
],
|
|
|
211 |
'columnDefs': [
|
|
|
212 |
{
|
|
|
213 |
'targets': 1,
|
|
|
214 |
'render' : function ( data, type, row ) {
|
|
|
215 |
var s = row['type'];
|
|
|
216 |
|
|
|
217 |
if (allowTakeaTest && row['actions']['link_take_a_test']) {
|
|
|
218 |
|
16906 |
efrain |
219 |
s = s + '<br><button class="btn btn-default btn-take-the-test" data-href="' + row['actions']['link_take_a_test'] + '" data-toggle="tooltip" title="LABEL_PERFORMANCE_EVALUATION_TAKE_TEST"><i class="fa fa-pen"></i> LABEL_PERFORMANCE_EVALUATION_TAKE_TEST </button> ';
|
15461 |
efrain |
220 |
}
|
|
|
221 |
|
|
|
222 |
if (allowReport && row['actions']['link_pdf']) {
|
|
|
223 |
s = s + '<br><button class="btn btn-default btn-pdf" data-href="' + row['actions']['link_pdf'] + '" data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-pdf"></i> LABEL_PDF </button> ';
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
return s;
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
}
|
|
|
230 |
},
|
|
|
231 |
|
|
|
232 |
|
|
|
233 |
],
|
|
|
234 |
});
|
|
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
|
238 |
$('body').on('click', 'button.btn-save', function(e) {
|
|
|
239 |
e.preventDefault();
|
|
|
240 |
|
|
|
241 |
var ok = $('#comment').val().trim().length > 0
|
|
|
242 |
$.each($('input.input-behavior-comment'), function(index, element) {
|
|
|
243 |
ok = ok && $(element).val().trim().length > 0;
|
|
|
244 |
});
|
|
|
245 |
|
|
|
246 |
if(!ok) {
|
|
|
247 |
$.fn.showError('ERROR_PERFORMANCE_SOMEONE_COMMENT_IS_EMPTY');
|
|
|
248 |
return false;
|
|
|
249 |
}
|
|
|
250 |
|
16822 |
efrain |
251 |
swal.fire({
|
|
|
252 |
title: 'LABEL_ARE_YOU_SURE',
|
15461 |
efrain |
253 |
message: 'LABEL_RECRUITMENT_AND_SELECTION_TEST_IS_COMPLETED',
|
16822 |
efrain |
254 |
icon: 'question',
|
|
|
255 |
cancelButtonText: 'LABEL_NO',
|
|
|
256 |
showCancelButton: true,
|
|
|
257 |
confirmButtonText: 'LABEL_YES'
|
|
|
258 |
}).then((result) => {
|
|
|
259 |
if (result.isConfirmed) {
|
|
|
260 |
|
|
|
261 |
|
15461 |
efrain |
262 |
var data = new Array()
|
|
|
263 |
data['status'] = $('#status').val();
|
|
|
264 |
data['comment'] = $('#comment').val().trim();
|
|
|
265 |
data['points'] = $('#points').val();
|
|
|
266 |
$.each($('input.input-behavior-comment'), function(index, element) {
|
|
|
267 |
k = $(this).attr('name');
|
|
|
268 |
v = $(this).val().trim();
|
|
|
269 |
|
|
|
270 |
data[k] = v;
|
|
|
271 |
});
|
|
|
272 |
$.each($('input.input-behavior-level'), function(index, element) {
|
|
|
273 |
k = $(this).attr('name');
|
|
|
274 |
v = $(this).val();
|
|
|
275 |
|
|
|
276 |
data[k] = v;
|
|
|
277 |
});
|
|
|
278 |
|
|
|
279 |
|
|
|
280 |
|
|
|
281 |
var action = $('#form').attr('action');
|
|
|
282 |
$.ajax({
|
|
|
283 |
'dataType': 'json',
|
|
|
284 |
'accept': 'application/json',
|
|
|
285 |
'method': 'post',
|
|
|
286 |
'url': action,
|
|
|
287 |
'data' : $('#form').serialize()
|
|
|
288 |
}).done(function(response) {
|
|
|
289 |
if (response['success']) {
|
|
|
290 |
$('#row-test').hide();
|
|
|
291 |
$('#row-header').show();
|
|
|
292 |
$('#row-table').show();
|
|
|
293 |
|
|
|
294 |
gridTable.api().ajax.reload(null, false);
|
|
|
295 |
} else {
|
|
|
296 |
$.fn.showError(response['data']);
|
|
|
297 |
}
|
|
|
298 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
299 |
$.fn.showError(textStatus);
|
|
|
300 |
});
|
16843 |
efrain |
301 |
|
15461 |
efrain |
302 |
}
|
|
|
303 |
});
|
|
|
304 |
|
|
|
305 |
|
|
|
306 |
});
|
|
|
307 |
|
|
|
308 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
309 |
e.preventDefault();
|
|
|
310 |
gridTable.api().ajax.reload(null, false);
|
|
|
311 |
});
|
|
|
312 |
|
|
|
313 |
|
|
|
314 |
$('body').on('click', 'button.btn-pdf', function(e) {
|
|
|
315 |
e.preventDefault();
|
|
|
316 |
var action = $(this).data('href');
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
NProgress.start();
|
|
|
320 |
$.ajax({
|
|
|
321 |
'dataType' : 'json',
|
|
|
322 |
'method' : 'get',
|
|
|
323 |
'url' : action,
|
|
|
324 |
}).done(function(response) {
|
|
|
325 |
if(response['success']) {
|
|
|
326 |
var anchor = window.document.createElement("a");
|
|
|
327 |
anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
|
|
|
328 |
anchor.download = response['data']['basename'];
|
|
|
329 |
document.body.appendChild(anchor);
|
|
|
330 |
anchor.click(); // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
|
|
|
331 |
document.body.removeChild(anchor);
|
|
|
332 |
} else {
|
|
|
333 |
$.fn.showError(response['data']);
|
|
|
334 |
}
|
|
|
335 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
336 |
$.fn.showError(textStatus);
|
|
|
337 |
}).always(function() {
|
|
|
338 |
NProgress.done();
|
|
|
339 |
});
|
|
|
340 |
|
|
|
341 |
|
|
|
342 |
|
|
|
343 |
});
|
|
|
344 |
|
|
|
345 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
346 |
e.preventDefault();
|
|
|
347 |
|
|
|
348 |
$('#row-test').hide();
|
|
|
349 |
$('#row-header').show();
|
|
|
350 |
$('#row-table').show();
|
|
|
351 |
|
|
|
352 |
});
|
|
|
353 |
|
|
|
354 |
|
|
|
355 |
$('body').on('click', 'button.btn-take-the-test', function(e) {
|
|
|
356 |
e.preventDefault();
|
|
|
357 |
|
|
|
358 |
var action = $(this).data('href');
|
|
|
359 |
$.getJSON(action, function(response) {
|
|
|
360 |
if(response['success']) {
|
|
|
361 |
|
|
|
362 |
$('#form').attr('action', action);
|
|
|
363 |
|
|
|
364 |
behaviors = response['data']['behaviors'];
|
|
|
365 |
competency_types = response['data']['competency_types'];
|
|
|
366 |
competencies = response['data']['competencies'];
|
|
|
367 |
competencies_selected = response['data']['competencies_selected'];
|
|
|
368 |
subordinates_selected = response['data']['subordinates_selected'];
|
|
|
369 |
|
|
|
370 |
$.fn.renderCompetencies();
|
|
|
371 |
|
16843 |
efrain |
372 |
$('#form-title').html( response['data']['name'])
|
15461 |
efrain |
373 |
|
16843 |
efrain |
374 |
|
15461 |
efrain |
375 |
var data = {
|
|
|
376 |
name: response['data']['name'],
|
|
|
377 |
functions : response['data']['functions'],
|
|
|
378 |
objectives : response['data']['objectives'],
|
|
|
379 |
form : response['data']['form'],
|
|
|
380 |
type : response['data']['type'],
|
|
|
381 |
interviewer : response['data']['interviewer'],
|
|
|
382 |
candidate : response['data']['candidate'],
|
|
|
383 |
last_date : response['data']['last_date'],
|
|
|
384 |
}
|
|
|
385 |
$.fn.renderJobDescription(data);
|
|
|
386 |
|
|
|
387 |
|
|
|
388 |
|
|
|
389 |
$('input.input-behavior-level').inputNumberFormat({decimal: 0});
|
|
|
390 |
$('input.input-behavior-level').change(function(e) {
|
|
|
391 |
e.preventDefault();
|
|
|
392 |
|
|
|
393 |
var v = parseInt($(this).val());
|
|
|
394 |
if(isNaN(v)) {
|
|
|
395 |
$(this).val('0');
|
|
|
396 |
} else {
|
|
|
397 |
if(v > 100) {
|
|
|
398 |
$(this).val('100');
|
|
|
399 |
}
|
|
|
400 |
}
|
|
|
401 |
});
|
|
|
402 |
|
|
|
403 |
|
|
|
404 |
$('#comment').val('');
|
|
|
405 |
$('#points').val('');
|
|
|
406 |
$('#row-header').hide();
|
|
|
407 |
$('#row-table').hide();
|
|
|
408 |
$('#row-test').show();
|
|
|
409 |
|
16804 |
efrain |
410 |
$('#stepwizard').smartWizard('reset');
|
|
|
411 |
|
15461 |
efrain |
412 |
|
|
|
413 |
} else {
|
|
|
414 |
$.fn.showError(response['data'])
|
|
|
415 |
}
|
|
|
416 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
417 |
$.fn.showError(textStatus);
|
|
|
418 |
}).always(function() {
|
|
|
419 |
NProgress.done();
|
|
|
420 |
});
|
|
|
421 |
|
|
|
422 |
|
|
|
423 |
});
|
|
|
424 |
|
16822 |
efrain |
425 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
426 |
e.preventDefault();
|
|
|
427 |
var action = $(this).data('href');
|
15461 |
efrain |
428 |
|
16822 |
efrain |
429 |
|
|
|
430 |
swal.fire({
|
|
|
431 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
432 |
icon: 'question',
|
|
|
433 |
cancelButtonText: 'LABEL_NO',
|
|
|
434 |
showCancelButton: true,
|
|
|
435 |
confirmButtonText: 'LABEL_YES'
|
|
|
436 |
}).then((result) => {
|
|
|
437 |
if (result.isConfirmed) {
|
|
|
438 |
|
|
|
439 |
NProgress.start();
|
|
|
440 |
$.ajax({
|
|
|
441 |
'dataType' : 'json',
|
|
|
442 |
'accept' : 'application/json',
|
|
|
443 |
'method' : 'post',
|
|
|
444 |
'url' : action,
|
|
|
445 |
}).done(function(response) {
|
|
|
446 |
if(response['success']) {
|
|
|
447 |
$.fn.showSuccess(response['data']);
|
|
|
448 |
gridTable.api().ajax.reload(null, false);
|
|
|
449 |
} else {
|
|
|
450 |
$.fn.showError(response['data']);
|
|
|
451 |
}
|
|
|
452 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
453 |
$.fn.showError(textStatus);
|
|
|
454 |
}).always(function() {
|
|
|
455 |
NProgress.done();
|
|
|
456 |
});
|
|
|
457 |
}
|
|
|
458 |
});
|
|
|
459 |
|
|
|
460 |
});
|
|
|
461 |
|
15461 |
efrain |
462 |
$('#form #comment').maxlength({
|
|
|
463 |
alwaysShow: true,
|
|
|
464 |
validate: true
|
|
|
465 |
});
|
|
|
466 |
|
|
|
467 |
|
|
|
468 |
|
|
|
469 |
$('#points').inputNumberFormat({decimal: 0});
|
|
|
470 |
$('#points').change(function(e) {
|
|
|
471 |
e.preventDefault();
|
|
|
472 |
|
|
|
473 |
var v = parseInt($(this).val());
|
|
|
474 |
if(isNaN(v)) {
|
|
|
475 |
$(this).val('0');
|
|
|
476 |
} else {
|
|
|
477 |
if(v > 100) {
|
|
|
478 |
$(this).val('100');
|
|
|
479 |
}
|
|
|
480 |
}
|
|
|
481 |
});
|
|
|
482 |
|
16804 |
efrain |
483 |
$('#stepwizard').smartWizard({
|
|
|
484 |
selected: 0,
|
|
|
485 |
// autoAdjustHeight: false,
|
|
|
486 |
theme: 'arrows', // basic, arrows, square, round, dots
|
|
|
487 |
transition: {
|
|
|
488 |
animation:'none'
|
|
|
489 |
},
|
|
|
490 |
lang: {
|
|
|
491 |
next: 'LABEL_NEXT',
|
|
|
492 |
previous: 'LABEL_PREVIOUS',
|
|
|
493 |
},
|
|
|
494 |
toolbar: {
|
|
|
495 |
showNextButton: true, // show/hide a Next button
|
|
|
496 |
showPreviousButton: true, // show/hide a Previous button
|
|
|
497 |
position: 'bottom', // none/ top/ both bottom
|
|
|
498 |
extraHtml: `<button type="button" class="btn btn-primary btn-save">LABEL_SAVE</button>`
|
16822 |
efrain |
499 |
+ `<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>`
|
16804 |
efrain |
500 |
},
|
|
|
501 |
anchor: {
|
|
|
502 |
enableNavigation: true, // Enable/Disable anchor navigation
|
|
|
503 |
enableNavigationAlways: false, // Activates all anchors clickable always
|
|
|
504 |
enableDoneState: true, // Add done state on visited steps
|
|
|
505 |
markPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
|
|
|
506 |
unDoneOnBackNavigation: true, // While navigate back, done state will be cleared
|
|
|
507 |
enableDoneStateNavigation: true // Enable/Disable the done state navigation
|
|
|
508 |
},
|
|
|
509 |
});
|
|
|
510 |
|
|
|
511 |
$('#stepwizard').smartWizard('reset');
|
|
|
512 |
|
15461 |
efrain |
513 |
|
|
|
514 |
});
|
|
|
515 |
JS;
|
|
|
516 |
$this->inlineScript()->captureEnd();
|
|
|
517 |
?>
|
|
|
518 |
|
16843 |
efrain |
519 |
<div class="container">
|
|
|
520 |
<div class="card" id="row-table">
|
|
|
521 |
<div class="card-header">
|
|
|
522 |
LABEL_RECRUITMENT_AND_SELECTION
|
|
|
523 |
</div>
|
|
|
524 |
<div class="card-body">
|
|
|
525 |
<div class="row">
|
|
|
526 |
<div class="col-12 mt-3">
|
16845 |
efrain |
527 |
<table id="gridTable" class="table table-bordered">
|
15461 |
efrain |
528 |
<thead>
|
|
|
529 |
<tr>
|
16843 |
efrain |
530 |
<th style="width:15%">LABEL_LAST_DATE</th>
|
15461 |
efrain |
531 |
<th style="width:35%">LABEL_TYPE</th>
|
|
|
532 |
<th style="width:35%">LABEL_VACANCY</th>
|
|
|
533 |
<th style="width:35%">LABEL_CANDIDATE</th>
|
|
|
534 |
|
|
|
535 |
<th style="width:15%">LABEL_STATUS</th>
|
|
|
536 |
|
|
|
537 |
</tr>
|
|
|
538 |
</thead>
|
|
|
539 |
<tbody></tbody>
|
16843 |
efrain |
540 |
</table>
|
|
|
541 |
</div>
|
|
|
542 |
</div>
|
|
|
543 |
</div>
|
|
|
544 |
<div class="card-footer text-right">
|
16992 |
efrain |
545 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-sync"></i> LABEL_REFRESH </button>
|
16843 |
efrain |
546 |
</div>
|
|
|
547 |
</div>
|
16804 |
efrain |
548 |
<?php
|
|
|
549 |
$form->setAttributes([
|
|
|
550 |
'method' => 'post',
|
|
|
551 |
'name' => 'form',
|
|
|
552 |
'id' => 'form',
|
|
|
553 |
]);
|
|
|
554 |
$form->prepare();
|
|
|
555 |
echo $this->form()->openTag($form);
|
|
|
556 |
?>
|
16843 |
efrain |
557 |
|
|
|
558 |
|
|
|
559 |
<div class="row" id="row-test" style="display: none;">
|
|
|
560 |
<div class="col-12 mt-3">
|
|
|
561 |
|
16845 |
efrain |
562 |
<h6 class="text-center" id="form-title"></h6>
|
16843 |
efrain |
563 |
|
16804 |
efrain |
564 |
|
|
|
565 |
<div id="stepwizard" class="border border-gray p-4 mt-2">
|
|
|
566 |
<ul class="nav">
|
|
|
567 |
<li class="nav-item">
|
|
|
568 |
<a class="nav-link" href="#step-1">
|
|
|
569 |
<div class="num">1</div>
|
|
|
570 |
LABEL_GENERAL
|
|
|
571 |
</a>
|
|
|
572 |
</li>
|
|
|
573 |
<li class="nav-item">
|
|
|
574 |
<a class="nav-link" href="#step-2">
|
|
|
575 |
<div class="num">2</div>
|
|
|
576 |
LABEL_COMPETENCIES
|
|
|
577 |
</a>
|
|
|
578 |
</li>
|
|
|
579 |
<li class="nav-item">
|
|
|
580 |
<a class="nav-link" href="#step-3">
|
|
|
581 |
<span class="num">3</span>
|
|
|
582 |
LABEL_CONCLUTION
|
|
|
583 |
</a>
|
|
|
584 |
</li>
|
|
|
585 |
</ul>
|
|
|
586 |
<div class="tab-content">
|
|
|
587 |
<div id="step-1" class="tab-pane" role="tabpanel" aria-labelledby="step-1">
|
16843 |
efrain |
588 |
<div class="row">
|
|
|
589 |
<div class="col-mt-3">
|
|
|
590 |
<h5 id="interview"></h5>
|
|
|
591 |
<div id="div-job-description"></div>
|
16804 |
efrain |
592 |
</div>
|
|
|
593 |
</div>
|
|
|
594 |
</div>
|
|
|
595 |
<div id="step-2" class="tab-pane" role="tabpanel" aria-labelledby="step-2">
|
16843 |
efrain |
596 |
<div class="row">
|
|
|
597 |
<div class="col-mt-3">
|
|
|
598 |
<div class="accordion" id="accordion" style="height: 500px; overflow-y: auto;"></div>
|
16804 |
efrain |
599 |
</div>
|
|
|
600 |
</div>
|
|
|
601 |
</div>
|
|
|
602 |
<div id="step-3" class="tab-pane" role="tabpanel" aria-labelledby="step-3">
|
16843 |
efrain |
603 |
<div class="row">
|
|
|
604 |
<div class="col-mt-3">
|
|
|
605 |
<?php
|
|
|
606 |
$element = $form->get('comment');
|
|
|
607 |
$element->setOptions(['label' => 'LABEL_COMMENT']);
|
|
|
608 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
609 |
echo $this->formLabel($element);
|
|
|
610 |
echo $this->formTextArea($element);
|
|
|
611 |
?>
|
|
|
612 |
</div>
|
|
|
613 |
</div>
|
|
|
614 |
<div class="row">
|
|
|
615 |
<div class="col-mt-3">
|
|
|
616 |
<?php
|
|
|
617 |
$element = $form->get('points');
|
|
|
618 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
619 |
$element->setOptions(['label' => 'LABEL_EVALUATION']);
|
|
|
620 |
echo $this->formLabel($element);
|
|
|
621 |
echo $this->formNumber($element);
|
|
|
622 |
?>
|
|
|
623 |
</div>
|
16804 |
efrain |
624 |
</div>
|
16843 |
efrain |
625 |
<div class="row">
|
|
|
626 |
<div class="col-mt-3">
|
|
|
627 |
<?php
|
|
|
628 |
$element = $form->get('status');
|
|
|
629 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
630 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
631 |
echo $this->formLabel($element);
|
|
|
632 |
echo $this->formSelect($element);
|
|
|
633 |
?>
|
|
|
634 |
</div>
|
16804 |
efrain |
635 |
</div>
|
|
|
636 |
</div>
|
|
|
637 |
</div>
|
|
|
638 |
</div>
|
|
|
639 |
</div>
|
|
|
640 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
641 |
</div>
|
16822 |
efrain |
642 |
|
|
|
643 |
</div>
|
|
|
644 |
|
|
|
645 |
|
15461 |
efrain |
646 |
|
|
|
647 |
<script id="job-description-template" type="text/x-jsrender">
|
|
|
648 |
<div class="card">
|
|
|
649 |
<div class="card-body">
|
|
|
650 |
<table class="table table-bordered">
|
|
|
651 |
<tr>
|
|
|
652 |
<th>LABEL_LAST_DATE</th>
|
|
|
653 |
<th>LABEL_TYPE</th>
|
|
|
654 |
</tr>
|
|
|
655 |
<tr>
|
|
|
656 |
<td>{{:last_date}}</td>
|
|
|
657 |
<td>{{:type}}</td>
|
|
|
658 |
</tr>
|
|
|
659 |
|
|
|
660 |
<tr>
|
|
|
661 |
<th>LABEL_INTERVIEWED_BY</th>
|
|
|
662 |
<th>LABEL_CANDIDATE</th>
|
|
|
663 |
</tr>
|
|
|
664 |
<tr>
|
|
|
665 |
<td>{{:interviewer}}</td>
|
|
|
666 |
<td>{{:candidate}}</td>
|
|
|
667 |
</tr>
|
|
|
668 |
</table>
|
|
|
669 |
<br/>
|
|
|
670 |
|
|
|
671 |
<p class="card-text"><b>LABEL_OBJECTIVES</b></p>
|
|
|
672 |
<p class="card-text">{{:objectives}}</p>
|
|
|
673 |
<p class="card-text"><b>LABEL_FUNCTIONS</b></p>
|
|
|
674 |
<p class="card-text">{{:functions}}</p>
|
|
|
675 |
|
|
|
676 |
</div>
|
|
|
677 |
</div>
|
|
|
678 |
</script>
|
|
|
679 |
|
|
|
680 |
|
|
|
681 |
<script id="competencyTemplate" type="text/x-jsrender">
|
16843 |
efrain |
682 |
<div class="accordion-item">
|
|
|
683 |
<h2 class="accordion-header" id="heading-{{:uuid}}">
|
|
|
684 |
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse-{{:uuid}}" aria-expanded="true" aria-controls="collapseOne">
|
|
|
685 |
{{:~getCompetencyType(competency_type_uuid).name}} - {{:~getCompetency(uuid).name}}
|
|
|
686 |
</button>
|
|
|
687 |
</h2>
|
|
|
688 |
<div id="collapse-{{:uuid}}" class="accordion-collapse collapse " aria-labelledby="headingOne" data-bs-parent="#accordion">
|
|
|
689 |
<div class="accordion-body">
|
|
|
690 |
|
16804 |
efrain |
691 |
<div class="card-body">
|
|
|
692 |
<div class="table-responsive">
|
|
|
693 |
<table class="table table-bordered">
|
|
|
694 |
<thead>
|
|
|
695 |
<tr>
|
|
|
696 |
<th style="width: 30%;">LABEL_ELEMENT</th>
|
|
|
697 |
<th style="width: 50%;">LABEL_TITLE</th>
|
|
|
698 |
<th style="width: 10%;">LABEL_LEVEL</th>
|
|
|
699 |
<th style="width: 10%;">LABEL_POINTS</th>
|
|
|
700 |
</tr>
|
|
|
701 |
</thead>
|
|
|
702 |
<tbody>
|
|
|
703 |
<tr>
|
|
|
704 |
<td class="text-left">LABEL_COMPETENCY</td>
|
|
|
705 |
<td class="text-left">{{:name}}</td>
|
|
|
706 |
<td> </td>
|
|
|
707 |
<td> </td>
|
|
|
708 |
</tr>
|
|
|
709 |
{{for behaviors}}
|
|
|
710 |
<tr >
|
|
|
711 |
<td class="text-left">--LABEL_BEHAVIOR</td>
|
|
|
712 |
<td class="text-left">
|
|
|
713 |
{{:~getBehavior(uuid).description}}
|
|
|
714 |
</td>
|
|
|
715 |
<td class="text-right">
|
|
|
716 |
{{:level}}
|
|
|
717 |
</td>
|
|
|
718 |
<td class="text-right">
|
|
|
719 |
<input type="number" class="form-control input-behavior-level " value="0" step="1" min="0" max="100" name="{{:competency_uuid}}-{{:uuid}}-points" id="{{:competency_uuid}}-{{:uuid}}-points" ></input>
|
|
|
720 |
</td>
|
|
|
721 |
</tr>
|
|
|
722 |
<tr >
|
|
|
723 |
<td colspan="4">
|
|
|
724 |
LABEL_COMMENT
|
|
|
725 |
<input type="text" class="form-control input-behavior-comment" value="" maxlength="128" name="{{:competency_uuid}}-{{:uuid}}-comment" id="{{:competency_uuid}}-{{:uuid}}-comment" ></input>
|
|
|
726 |
</td>
|
|
|
727 |
</tr >
|
15461 |
efrain |
728 |
|
16804 |
efrain |
729 |
{{/for}}
|
|
|
730 |
</tbody>
|
|
|
731 |
</table>
|
|
|
732 |
</div>
|
16843 |
efrain |
733 |
|
|
|
734 |
|
|
|
735 |
</div>
|
16804 |
efrain |
736 |
</div>
|
16843 |
efrain |
737 |
</div>
|
15461 |
efrain |
738 |
|
16843 |
efrain |
739 |
|
|
|
740 |
|
|
|
741 |
|
16804 |
efrain |
742 |
</script>
|
15461 |
efrain |
743 |
|
16804 |
efrain |
744 |
|