| 1631 |
eleazar |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
$roleName = $currentUser->getUserTypeId();
|
| 1481 |
eleazar |
5 |
|
| 1482 |
eleazar |
6 |
$routeDatatable = $this->url('recruitment-and-selection/candidates');
|
| 1637 |
eleazar |
7 |
$routeEmail = $this->url('recruitment-and-selection/user-by-email');
|
| 1506 |
eleazar |
8 |
$routeAdd = $this->url('recruitment-and-selection/candidates/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
|
| 1481 |
eleazar |
9 |
|
| 1482 |
eleazar |
10 |
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/add') ? 1 : 0;
|
|
|
11 |
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/delete') ? 1 : 0;
|
| 1613 |
eleazar |
12 |
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/edit') ? 1 : 0;
|
| 1636 |
eleazar |
13 |
$allowEmail = $acl->isAllowed($roleName, 'recruitment-and-selection/user-by-email') ? 1 : 0;
|
| 1481 |
eleazar |
14 |
|
|
|
15 |
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
|
|
|
16 |
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
|
|
|
17 |
|
| 1649 |
eleazar |
18 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
| 1481 |
eleazar |
19 |
|
|
|
20 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
|
|
|
21 |
|
| 1490 |
eleazar |
22 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
23 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
| 1481 |
eleazar |
24 |
|
| 1490 |
eleazar |
25 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
26 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
|
|
|
27 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
|
|
|
29 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
30 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
|
|
31 |
|
|
|
32 |
|
| 1481 |
eleazar |
33 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
34 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
36 |
|
|
|
37 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
|
|
|
38 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
|
|
|
39 |
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
|
|
|
43 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
47 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
48 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
52 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
|
|
53 |
|
|
|
54 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|
|
|
55 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
|
|
|
56 |
|
|
|
57 |
|
| 1649 |
eleazar |
58 |
$status_active = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_ACTIVE;
|
|
|
59 |
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_INACTIVE;
|
|
|
60 |
|
| 1658 |
eleazar |
61 |
$evaluation_0 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_0;
|
|
|
62 |
$evaluation_1 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_1;
|
|
|
63 |
$evaluation_2 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_2;
|
|
|
64 |
$evaluation_3 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_3;
|
|
|
65 |
$evaluation_4 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_4;
|
| 1649 |
eleazar |
66 |
|
| 1481 |
eleazar |
67 |
$this->inlineScript()->captureStart();
|
|
|
68 |
echo <<<JS
|
| 1631 |
eleazar |
69 |
jQuery(document).ready(function ($) {
|
| 1481 |
eleazar |
70 |
var allowAdd = $allowAdd;
|
| 1613 |
eleazar |
71 |
var allowDelete = $allowDelete;
|
|
|
72 |
var allowEdit = $allowEdit;
|
| 1630 |
eleazar |
73 |
var allowEmail = $allowEmail;
|
| 1481 |
eleazar |
74 |
|
| 1631 |
eleazar |
75 |
var gridTable = $('#gridTable').dataTable({
|
|
|
76 |
'processing': true,
|
|
|
77 |
'serverSide': true,
|
|
|
78 |
'searching': true,
|
|
|
79 |
'order': [[1, 'asc']],
|
|
|
80 |
'ordering': true,
|
|
|
81 |
'ordenable': true,
|
|
|
82 |
'responsive': true,
|
|
|
83 |
'select': false,
|
|
|
84 |
'paging': true,
|
|
|
85 |
'pagingType': 'simple_numbers',
|
|
|
86 |
'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, 'All']],
|
| 1481 |
eleazar |
87 |
|
| 1631 |
eleazar |
88 |
'ajax': {
|
|
|
89 |
'url': '$routeDatatable',
|
|
|
90 |
'type': 'get',
|
|
|
91 |
'data': function (d) {
|
| 1481 |
eleazar |
92 |
},
|
| 1631 |
eleazar |
93 |
'beforeSend': function (request) {
|
|
|
94 |
NProgress.start();
|
|
|
95 |
},
|
|
|
96 |
'dataFilter': function (response) {
|
|
|
97 |
var response = jQuery.parseJSON(response);
|
| 1481 |
eleazar |
98 |
|
| 1631 |
eleazar |
99 |
var json = {};
|
|
|
100 |
json.recordsTotal = 0;
|
|
|
101 |
json.recordsFiltered = 0;
|
|
|
102 |
json.data = [];
|
| 1481 |
eleazar |
103 |
|
| 1631 |
eleazar |
104 |
if (response.success) {
|
|
|
105 |
json.recordsTotal = response.data.total;
|
|
|
106 |
json.recordsFiltered = response.data.total;
|
|
|
107 |
json.data = response.data.items;
|
|
|
108 |
} else {
|
|
|
109 |
$.fn.showError(response.data)
|
|
|
110 |
}
|
| 1484 |
eleazar |
111 |
|
| 1631 |
eleazar |
112 |
return JSON.stringify(json);
|
|
|
113 |
}
|
|
|
114 |
},
|
|
|
115 |
'language': {
|
|
|
116 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
117 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
118 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
119 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
120 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
121 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
122 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
123 |
'sInfoPostFix': '',
|
|
|
124 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
125 |
'sUrl': '',
|
|
|
126 |
'sInfoThousands': ',',
|
|
|
127 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
128 |
'oPaginate': {
|
|
|
129 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
130 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
131 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
132 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
133 |
},
|
|
|
134 |
'oAria': {
|
|
|
135 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
136 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
137 |
},
|
|
|
138 |
},
|
|
|
139 |
'drawCallback': function (settings) {
|
|
|
140 |
NProgress.done();
|
|
|
141 |
$('button.btn-delete').confirmation({
|
|
|
142 |
rootSelector: 'button.btn-delete',
|
|
|
143 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
144 |
singleton: true,
|
|
|
145 |
btnOkLabel: 'LABEL_YES',
|
|
|
146 |
btnCancelLabel: 'LABEL_NO',
|
|
|
147 |
onConfirm: function (value) {
|
|
|
148 |
action = $(this).data('href');
|
|
|
149 |
NProgress.start();
|
|
|
150 |
$.ajax({
|
|
|
151 |
'dataType': 'json',
|
|
|
152 |
'accept': 'application/json',
|
|
|
153 |
'method': 'post',
|
|
|
154 |
'url': action,
|
|
|
155 |
}).done(function (response) {
|
|
|
156 |
if (response['success']) {
|
|
|
157 |
$.fn.showSuccess(response['data']);
|
|
|
158 |
gridTable.api().ajax.reload(null, false);
|
|
|
159 |
} else {
|
|
|
160 |
$.fn.showError(response['data']);
|
|
|
161 |
}
|
|
|
162 |
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
163 |
$.fn.showError(textStatus);
|
|
|
164 |
}).always(function () {
|
|
|
165 |
NProgress.done();
|
|
|
166 |
});
|
|
|
167 |
},
|
|
|
168 |
});
|
| 1484 |
eleazar |
169 |
|
| 1631 |
eleazar |
170 |
$('#form-add #file').fileinput({
|
|
|
171 |
theme: 'fas',
|
|
|
172 |
language: 'es',
|
|
|
173 |
showUpload: false,
|
|
|
174 |
dropZoneEnabled: false,
|
|
|
175 |
maxFileCount: 1,
|
|
|
176 |
allowedFileExtensions: ['pdf', 'docx'],
|
|
|
177 |
});
|
| 1484 |
eleazar |
178 |
|
| 1631 |
eleazar |
179 |
$('body').on('click', 'button.btn-add', function (e) {
|
|
|
180 |
e.preventDefault();
|
| 1484 |
eleazar |
181 |
|
| 1485 |
eleazar |
182 |
|
| 1631 |
eleazar |
183 |
$('#form-add #first_name').val('');
|
|
|
184 |
$('#form-add #last_name').val('');
|
|
|
185 |
$('#form-add #email').val('');
|
|
|
186 |
$('#form-add #file').fileinput('reset');
|
|
|
187 |
$('#form-add #file').val('');
|
| 1649 |
eleazar |
188 |
$('#form-add #status').val('$status_active');
|
| 1658 |
eleazar |
189 |
$('#form-add #evaluation').val('$preselection_0');
|
| 1653 |
eleazar |
190 |
CKEDITOR.instances.coment.setData('');
|
| 1631 |
eleazar |
191 |
validatorAdd.resetForm();
|
| 1616 |
eleazar |
192 |
|
| 1631 |
eleazar |
193 |
$('#add-candidate-box').modal('show');
|
|
|
194 |
return false;
|
|
|
195 |
});
|
| 1616 |
eleazar |
196 |
|
| 1631 |
eleazar |
197 |
$(".close-box, .btn-add-cancel").on("click", function (e) {
|
|
|
198 |
e.preventDefault();
|
|
|
199 |
$('#add-candidate-box').modal('hide');
|
|
|
200 |
$('#edit-candidate-box').modal('hide');
|
|
|
201 |
return false;
|
| 1616 |
eleazar |
202 |
});
|
|
|
203 |
|
| 1631 |
eleazar |
204 |
var validatorEdit = $('#form-edit').validate({
|
|
|
205 |
debug: true,
|
|
|
206 |
onclick: false,
|
|
|
207 |
onkeyup: false,
|
|
|
208 |
onfocusout: false,
|
|
|
209 |
ignore: [],
|
|
|
210 |
rules: {
|
|
|
211 |
'first_name': {
|
|
|
212 |
required: true,
|
|
|
213 |
maxlength: 128,
|
|
|
214 |
},
|
|
|
215 |
'file': {
|
|
|
216 |
required: false,
|
|
|
217 |
extension: 'pdf|docx',
|
|
|
218 |
accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
|
|
|
219 |
},
|
|
|
220 |
'last_name': {
|
|
|
221 |
required: true,
|
|
|
222 |
},
|
|
|
223 |
'email': {
|
|
|
224 |
required: true,
|
|
|
225 |
},
|
| 1658 |
eleazar |
226 |
'evaluation':{
|
| 1649 |
eleazar |
227 |
required: false,
|
|
|
228 |
},
|
| 1654 |
eleazar |
229 |
'coment':{
|
|
|
230 |
updateCkeditor:function() {
|
| 1656 |
eleazar |
231 |
CKEDITOR.instances.coment.updateElement();
|
| 1654 |
eleazar |
232 |
},
|
| 1649 |
eleazar |
233 |
},
|
| 1631 |
eleazar |
234 |
'status': {
|
|
|
235 |
required: true,
|
|
|
236 |
}
|
|
|
237 |
},
|
|
|
238 |
submitHandler: function (form) {
|
|
|
239 |
var formdata = false;
|
|
|
240 |
if (window.FormData) {
|
|
|
241 |
formdata = new FormData(form); //form[0]);
|
|
|
242 |
}
|
| 1616 |
eleazar |
243 |
|
| 1631 |
eleazar |
244 |
$('input[type="submit"]').prop('disabled', true);
|
| 1616 |
eleazar |
245 |
|
| 1631 |
eleazar |
246 |
$.ajax({
|
|
|
247 |
'dataType': 'json',
|
|
|
248 |
'accept': 'application/json',
|
|
|
249 |
'method': 'post',
|
|
|
250 |
'url': $('#form-edit').attr('action'),
|
|
|
251 |
'data': formdata,
|
|
|
252 |
'processData': false,
|
|
|
253 |
'contentType': false,
|
|
|
254 |
}).done(function (response) {
|
|
|
255 |
if (response['success']) {
|
|
|
256 |
$.fn.showSuccess(response['data']);
|
|
|
257 |
|
|
|
258 |
$('#edit-candidate-box').modal('hide');
|
|
|
259 |
gridTable.api().ajax.reload(null, false);
|
|
|
260 |
} else {
|
|
|
261 |
validatorEdit.resetForm();
|
|
|
262 |
if (jQuery.type(response['data']) == 'string') {
|
|
|
263 |
$.fn.showError(response['data']);
|
|
|
264 |
} else {
|
|
|
265 |
$.each(response['data'], function (fieldname, errors) {
|
|
|
266 |
$.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
|
|
|
267 |
});
|
|
|
268 |
}
|
|
|
269 |
}
|
|
|
270 |
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
271 |
$.fn.showError(textStatus);
|
|
|
272 |
}).always(function () {
|
|
|
273 |
NProgress.done();
|
|
|
274 |
});
|
|
|
275 |
return false;
|
|
|
276 |
},
|
|
|
277 |
invalidHandler: function (form, validator) {
|
|
|
278 |
|
| 1616 |
eleazar |
279 |
}
|
|
|
280 |
});
|
|
|
281 |
|
| 1631 |
eleazar |
282 |
$('body').on('click', 'button.btn-edit', function (e) {
|
|
|
283 |
e.preventDefault();
|
| 1486 |
eleazar |
284 |
|
| 1631 |
eleazar |
285 |
var url = $(this).data('href');
|
|
|
286 |
$.ajax({
|
|
|
287 |
'dataType': 'json',
|
|
|
288 |
'accept': 'application/json',
|
|
|
289 |
'method': 'get',
|
|
|
290 |
'url': url,
|
|
|
291 |
}).done(function (response) {
|
|
|
292 |
if (response['success']) {
|
|
|
293 |
$('#form-edit')[0].reset();
|
| 1486 |
eleazar |
294 |
|
| 1631 |
eleazar |
295 |
$('#form-edit').attr('action', url);
|
|
|
296 |
$('#form-edit #first_name').val(response['data']['first_name']);
|
|
|
297 |
$('#form-edit #last_name').val(response['data']['last_name']);
|
|
|
298 |
$('#form-edit #email').val(response['data']['email']);
|
| 1649 |
eleazar |
299 |
$('#form-edit #status').val(response['data']['status']);
|
| 1653 |
eleazar |
300 |
CKEDITOR.instances.coment.setData(response['data']['coment']);
|
| 1631 |
eleazar |
301 |
$('#form-edit #file').fileinput('reset');
|
|
|
302 |
$('#form-edit #file').val('');
|
|
|
303 |
|
|
|
304 |
|
|
|
305 |
$('#form-edit #status').val(response['data']['status']);
|
|
|
306 |
|
|
|
307 |
$('#edit-candidate-box').modal('show');
|
|
|
308 |
} else {
|
|
|
309 |
validatorEdit.resetForm();
|
|
|
310 |
if (jQuery.type(response['data']) == 'string') {
|
|
|
311 |
$.fn.showError(response['data']);
|
|
|
312 |
} else {
|
|
|
313 |
$.each(response['data'], function (fieldname, errors) {
|
|
|
314 |
$.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
|
|
|
315 |
});
|
|
|
316 |
}
|
| 1486 |
eleazar |
317 |
}
|
| 1631 |
eleazar |
318 |
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
319 |
$.fn.showError(textStatus);
|
|
|
320 |
}).always(function () {
|
|
|
321 |
NProgress.done();
|
|
|
322 |
});
|
| 1486 |
eleazar |
323 |
});
|
|
|
324 |
|
| 1631 |
eleazar |
325 |
var validatorAdd = $('#form-add').validate({
|
|
|
326 |
debug: true,
|
|
|
327 |
onclick: false,
|
|
|
328 |
onkeyup: false,
|
|
|
329 |
onfocusout: false,
|
|
|
330 |
ignore: [],
|
|
|
331 |
rules: {
|
|
|
332 |
'first_name': {
|
|
|
333 |
required: true,
|
|
|
334 |
maxlength: 128,
|
|
|
335 |
},
|
|
|
336 |
'file': {
|
|
|
337 |
required: false,
|
|
|
338 |
extension: 'pdf|docx',
|
|
|
339 |
accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
|
|
|
340 |
},
|
|
|
341 |
'last_name': {
|
|
|
342 |
required: true,
|
|
|
343 |
},
|
|
|
344 |
'email': {
|
|
|
345 |
required: true,
|
|
|
346 |
},
|
| 1658 |
eleazar |
347 |
'evaluation':{
|
| 1649 |
eleazar |
348 |
required: false,
|
|
|
349 |
},
|
| 1654 |
eleazar |
350 |
'coment':{
|
|
|
351 |
updateCkeditor:function() {
|
| 1656 |
eleazar |
352 |
CKEDITOR.instances.coment.updateElement();
|
| 1654 |
eleazar |
353 |
},
|
| 1649 |
eleazar |
354 |
},
|
| 1631 |
eleazar |
355 |
'status': {
|
|
|
356 |
required: true,
|
|
|
357 |
}
|
|
|
358 |
},
|
|
|
359 |
submitHandler: function (form) {
|
|
|
360 |
var formdata = false;
|
|
|
361 |
if (window.FormData) {
|
|
|
362 |
formdata = new FormData(form); //form[0]);
|
|
|
363 |
}
|
| 1630 |
eleazar |
364 |
|
| 1631 |
eleazar |
365 |
$('input[type="submit"]').prop('disabled', true);
|
| 1630 |
eleazar |
366 |
|
| 1631 |
eleazar |
367 |
$.ajax({
|
|
|
368 |
'dataType': 'json',
|
|
|
369 |
'accept': 'application/json',
|
|
|
370 |
'method': 'post',
|
|
|
371 |
'url': $('#form-add').attr('action'),
|
|
|
372 |
'data': formdata,
|
|
|
373 |
'processData': false,
|
|
|
374 |
'contentType': false,
|
|
|
375 |
}).done(function (response) {
|
|
|
376 |
if (response['success']) {
|
|
|
377 |
$.fn.showSuccess(response['data']);
|
|
|
378 |
|
|
|
379 |
$('#add-candidate-box').modal('hide');
|
|
|
380 |
gridTable.api().ajax.reload(null, false);
|
|
|
381 |
} else {
|
|
|
382 |
validatorAdd.resetForm();
|
|
|
383 |
if (jQuery.type(response['data']) == 'string') {
|
|
|
384 |
$.fn.showError(response['data']);
|
|
|
385 |
} else {
|
|
|
386 |
$.each(response['data'], function (fieldname, errors) {
|
|
|
387 |
$.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
|
|
|
388 |
});
|
|
|
389 |
}
|
|
|
390 |
}
|
|
|
391 |
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
392 |
$.fn.showError(textStatus);
|
|
|
393 |
}).always(function () {
|
|
|
394 |
NProgress.done();
|
|
|
395 |
});
|
|
|
396 |
return false;
|
|
|
397 |
},
|
|
|
398 |
invalidHandler: function (form, validator) {
|
|
|
399 |
|
| 1630 |
eleazar |
400 |
}
|
|
|
401 |
});
|
|
|
402 |
},
|
| 1631 |
eleazar |
403 |
'aoColumns': [
|
|
|
404 |
{ 'mDataProp': 'first_name' },
|
|
|
405 |
{ 'mDataProp': 'last_name' },
|
|
|
406 |
{ 'mDataProp': 'email' },
|
|
|
407 |
{ 'mDataProp': 'actions' },
|
|
|
408 |
],
|
|
|
409 |
'columnDefs': [
|
|
|
410 |
{
|
|
|
411 |
'targets': -1,
|
|
|
412 |
'orderable': false,
|
|
|
413 |
'render': function (data, type, row) {
|
|
|
414 |
s = '';
|
| 1630 |
eleazar |
415 |
|
| 1631 |
eleazar |
416 |
if (allowEdit && data['link_edit']) {
|
|
|
417 |
s = s + '<button class="btn btn-info btn-sm btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button> ';
|
|
|
418 |
}
|
| 1481 |
eleazar |
419 |
|
| 1631 |
eleazar |
420 |
if (allowDelete && data['link_delete']) {
|
|
|
421 |
s = s + '<button class="btn btn-danger btn-sm btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-times"></i> LABEL_DELETE </button> ';
|
|
|
422 |
}
|
| 1614 |
eleazar |
423 |
|
| 1631 |
eleazar |
424 |
return s;
|
| 1481 |
eleazar |
425 |
}
|
| 1631 |
eleazar |
426 |
}
|
|
|
427 |
],
|
|
|
428 |
});
|
| 1481 |
eleazar |
429 |
|
| 1631 |
eleazar |
430 |
$('#form-filter #form_uuid').change(function (e) {
|
| 1481 |
eleazar |
431 |
e.preventDefault();
|
|
|
432 |
|
| 1503 |
eleazar |
433 |
var uuid = e.target.value;
|
|
|
434 |
|
| 1507 |
eleazar |
435 |
$('#form-add').attr('action', String("$routeAdd").replaceAll('UUID_PLACEHOLDER', uuid));
|
| 1503 |
eleazar |
436 |
|
| 1599 |
eleazar |
437 |
gridTable.api().ajax.url("$routeDatatable" + "/" + uuid);
|
| 1481 |
eleazar |
438 |
gridTable.api().ajax.reload(null, false);
|
|
|
439 |
})
|
|
|
440 |
|
|
|
441 |
|
| 1631 |
eleazar |
442 |
$('body').on('click', 'button.btn-refresh', function (e) {
|
| 1481 |
eleazar |
443 |
e.preventDefault();
|
|
|
444 |
gridTable.api().ajax.reload(null, false);
|
|
|
445 |
});
|
| 1507 |
eleazar |
446 |
|
|
|
447 |
$('#form-filter #form_uuid').change();
|
| 1642 |
eleazar |
448 |
|
|
|
449 |
$('body').on('click', '#check-email', function () {
|
|
|
450 |
$.ajax("$routeEmail", {
|
|
|
451 |
accepts: 'application/json',
|
|
|
452 |
method: 'GET',
|
|
|
453 |
data: {
|
|
|
454 |
'email': $('#form-add #email').val(),
|
|
|
455 |
}
|
| 1648 |
eleazar |
456 |
}).done(function (response) {
|
|
|
457 |
if (response['success']) {
|
|
|
458 |
$('#form-add #first_name').val(response['data']['first_name']);
|
|
|
459 |
$('#form-add #last_name').val(response['data']['last_name']);
|
|
|
460 |
} else {
|
| 1646 |
eleazar |
461 |
$.fn.showError(response['data']);
|
|
|
462 |
}
|
|
|
463 |
}).fail(function (jqXHR, textStatus, errorThrown) {
|
|
|
464 |
$.fn.showError(textStatus);
|
|
|
465 |
}).always(function () {
|
|
|
466 |
NProgress.done();
|
|
|
467 |
});
|
| 1648 |
eleazar |
468 |
})
|
| 1655 |
eleazar |
469 |
|
|
|
470 |
CKEDITOR.replace('coment');
|
| 1481 |
eleazar |
471 |
});
|
|
|
472 |
JS;
|
|
|
473 |
$this->inlineScript()->captureEnd();
|
|
|
474 |
?>
|
|
|
475 |
|
|
|
476 |
|
|
|
477 |
<!-- Content Header (Page header) -->
|
|
|
478 |
<section class="content-header">
|
| 1631 |
eleazar |
479 |
<div class="container-fluid">
|
|
|
480 |
<div class="row mb-2">
|
|
|
481 |
<div class="col-sm-12">
|
|
|
482 |
<h1>LABEL_CANDIDATES</h1>
|
|
|
483 |
</div>
|
|
|
484 |
</div>
|
|
|
485 |
</div><!-- /.container-fluid -->
|
| 1481 |
eleazar |
486 |
</section>
|
|
|
487 |
|
|
|
488 |
<section class="content">
|
| 1631 |
eleazar |
489 |
<div class="container-fluid">
|
|
|
490 |
<div class="row">
|
|
|
491 |
<div class="col-12">
|
|
|
492 |
<div class="card">
|
|
|
493 |
<div class="card-header">
|
|
|
494 |
<?php
|
| 1486 |
eleazar |
495 |
// $form = $this->form;
|
| 1631 |
eleazar |
496 |
$form->setAttributes([
|
|
|
497 |
'name' => 'form-filter',
|
|
|
498 |
'id' => 'form-filter',
|
| 1481 |
eleazar |
499 |
]);
|
| 1631 |
eleazar |
500 |
|
| 1481 |
eleazar |
501 |
$form->prepare();
|
|
|
502 |
echo $this->form()->openTag($form);
|
| 1631 |
eleazar |
503 |
?>
|
| 1481 |
eleazar |
504 |
<div class="row">
|
|
|
505 |
<div class="col-md-6 col-sm-12">
|
|
|
506 |
<div class="form-group">
|
|
|
507 |
<?php
|
|
|
508 |
$element = $form->get('form_uuid');
|
| 1631 |
eleazar |
509 |
|
| 1484 |
eleazar |
510 |
$element->setOptions(['label' => 'LABEL_VACANCIES']);
|
| 1631 |
eleazar |
511 |
|
| 1481 |
eleazar |
512 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
513 |
echo $this->formLabel($element);
|
|
|
514 |
echo $this->formSelect($element);
|
|
|
515 |
?>
|
| 1631 |
eleazar |
516 |
</div>
|
| 1481 |
eleazar |
517 |
</div>
|
|
|
518 |
|
|
|
519 |
</div>
|
| 1631 |
eleazar |
520 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
521 |
</div>
|
|
|
522 |
<div class="card-body">
|
|
|
523 |
<table id="gridTable" class="table table-hover">
|
|
|
524 |
<thead>
|
|
|
525 |
<tr>
|
|
|
526 |
<th>LABEL_FIRST_NAME</th>
|
|
|
527 |
<th>LABEL_LAST_NAME</th>
|
|
|
528 |
<th>LABEL_EMAIL</th>
|
|
|
529 |
<th>LABEL_ACTIONS</th>
|
|
|
530 |
</tr>
|
|
|
531 |
</thead>
|
|
|
532 |
<tbody>
|
|
|
533 |
</tbody>
|
|
|
534 |
</table>
|
|
|
535 |
</div>
|
|
|
536 |
<div class="card-footer clearfix">
|
|
|
537 |
<div style="float:right;">
|
|
|
538 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i>
|
|
|
539 |
LABEL_REFRESH
|
|
|
540 |
</button>
|
|
|
541 |
<?php if ($allowAdd) : ?>
|
|
|
542 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i>
|
|
|
543 |
LABEL_ADD
|
|
|
544 |
</button>
|
|
|
545 |
<?php endif; ?>
|
|
|
546 |
</div>
|
|
|
547 |
</div>
|
|
|
548 |
</div>
|
|
|
549 |
</div>
|
|
|
550 |
</div>
|
|
|
551 |
</div>
|
|
|
552 |
</section>
|
| 1616 |
eleazar |
553 |
|
|
|
554 |
<!-- The Add Modal -->
|
|
|
555 |
<div class="modal" tabindex="-1" role="dialog" id="add-candidate-box">
|
| 1631 |
eleazar |
556 |
<div class="modal-dialog" role="document">
|
|
|
557 |
<?php
|
|
|
558 |
//$form = $this->formA;
|
|
|
559 |
$form->setAttributes([
|
|
|
560 |
'method' => 'post',
|
|
|
561 |
'name' => 'form-add',
|
|
|
562 |
'action' => $routeAdd,
|
|
|
563 |
'email' => $routeEmail,
|
|
|
564 |
'id' => 'form-add'
|
|
|
565 |
]);
|
|
|
566 |
$form->prepare();
|
|
|
567 |
echo $this->form()->openTag($form);
|
|
|
568 |
|
|
|
569 |
?>
|
|
|
570 |
<div class="modal-content">
|
|
|
571 |
<div class="modal-header">
|
|
|
572 |
<h3 class="modal-title">LABEL_NEW_CANDIDATE</h3>
|
|
|
573 |
</div>
|
|
|
574 |
<div class="modal-body">
|
|
|
575 |
<div class="form-group">
|
|
|
576 |
<?php
|
|
|
577 |
$element = $form->get('first_name');
|
|
|
578 |
$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
|
|
|
579 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
580 |
echo $this->formLabel($element);
|
|
|
581 |
echo $this->formText($element);
|
| 1485 |
eleazar |
582 |
?>
|
| 1631 |
eleazar |
583 |
</div>
|
|
|
584 |
<div class="form-group">
|
|
|
585 |
<?php
|
|
|
586 |
$element = $form->get('last_name');
|
|
|
587 |
$element->setOptions(['label' => 'LABEL_LAST_NAME']);
|
|
|
588 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
589 |
echo $this->formLabel($element);
|
|
|
590 |
echo $this->formText($element);
|
| 1485 |
eleazar |
591 |
?>
|
| 1631 |
eleazar |
592 |
</div>
|
|
|
593 |
<div class="form-group">
|
|
|
594 |
<?php
|
|
|
595 |
$element = $form->get('email');
|
|
|
596 |
$element->setOptions(['label' => 'LABEL_EMAIL']);
|
|
|
597 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
598 |
echo $this->formLabel($element);
|
|
|
599 |
echo $this->formText($element);
|
| 1485 |
eleazar |
600 |
?>
|
| 1631 |
eleazar |
601 |
</div>
|
|
|
602 |
<div class="form-group">
|
| 1649 |
eleazar |
603 |
<?php
|
| 1652 |
eleazar |
604 |
$element = $form->get('coment');
|
| 1649 |
eleazar |
605 |
$element->setAttributes(['class' => 'form-control']);
|
| 1657 |
eleazar |
606 |
$element->setOptions(['label' => 'LABEL_COMMENT']);
|
| 1649 |
eleazar |
607 |
echo $this->formLabel($element);
|
|
|
608 |
echo $this->formTextArea($element);
|
|
|
609 |
?>
|
|
|
610 |
</div>
|
|
|
611 |
<div class="form-group">
|
| 1631 |
eleazar |
612 |
<?php
|
| 1658 |
eleazar |
613 |
$element = $form->get('evaluation');
|
| 1649 |
eleazar |
614 |
$element->setAttributes(['class' => 'form-control']);
|
| 1658 |
eleazar |
615 |
$element->setOptions(['label' => 'LABEL_EVALUATION']);
|
| 1649 |
eleazar |
616 |
echo $this->formLabel($element);
|
|
|
617 |
echo $this->formSelect($element);
|
|
|
618 |
?>
|
|
|
619 |
</div>
|
|
|
620 |
<div class="form-group">
|
|
|
621 |
<?php
|
| 1485 |
eleazar |
622 |
$element = $form->get('file');
|
| 1631 |
eleazar |
623 |
|
|
|
624 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
|
| 1485 |
eleazar |
625 |
$element->setOptions(['label' => 'LABEL_CURRICULUM']);
|
|
|
626 |
echo $this->formLabel($element);
|
|
|
627 |
?>
|
|
|
628 |
<div class="file-loading">
|
| 1631 |
eleazar |
629 |
<?php echo $this->formFile($element); ?>
|
| 1493 |
eleazar |
630 |
</div>
|
| 1631 |
eleazar |
631 |
</div>
|
|
|
632 |
<div class="form-group">
|
|
|
633 |
<?php
|
|
|
634 |
$element = $form->get('status');
|
|
|
635 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
636 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
637 |
echo $this->formLabel($element);
|
|
|
638 |
echo $this->formSelect($element);
|
| 1619 |
eleazar |
639 |
?>
|
| 1631 |
eleazar |
640 |
</div>
|
|
|
641 |
</div>
|
|
|
642 |
<div class="modal-footer">
|
|
|
643 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
644 |
<button id="check-email" type="button" class="btn btn-primary">LABEL_CHECK_EMAIL</button>
|
|
|
645 |
<button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
|
|
|
646 |
</div>
|
|
|
647 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
648 |
</div>
|
|
|
649 |
</div>
|
| 1616 |
eleazar |
650 |
</div>
|
|
|
651 |
|
|
|
652 |
<!-- The Edit Modal -->
|
|
|
653 |
<div class="modal" tabindex="-1" role="dialog" id="edit-candidate-box">
|
| 1631 |
eleazar |
654 |
<div class="modal-dialog" role="document">
|
|
|
655 |
<?php
|
|
|
656 |
$form->setAttributes([
|
|
|
657 |
'method' => 'post',
|
|
|
658 |
'name' => 'form-edit',
|
|
|
659 |
'id' => 'form-edit'
|
|
|
660 |
]);
|
|
|
661 |
$form->prepare();
|
|
|
662 |
echo $this->form()->openTag($form);
|
|
|
663 |
|
|
|
664 |
?>
|
|
|
665 |
<div class="modal-content">
|
|
|
666 |
<div class="modal-header">
|
|
|
667 |
<h3 class="modal-title">LABEL_CANDIDATE</h3>
|
|
|
668 |
</div>
|
|
|
669 |
<div class="modal-body">
|
|
|
670 |
<div class="form-group">
|
|
|
671 |
<?php
|
|
|
672 |
$element = $form->get('first_name');
|
|
|
673 |
$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
|
|
|
674 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
675 |
echo $this->formLabel($element);
|
|
|
676 |
echo $this->formText($element);
|
| 1616 |
eleazar |
677 |
?>
|
| 1631 |
eleazar |
678 |
</div>
|
|
|
679 |
<div class="form-group">
|
|
|
680 |
<?php
|
|
|
681 |
$element = $form->get('last_name');
|
|
|
682 |
$element->setOptions(['label' => 'LABEL_LAST_NAME']);
|
|
|
683 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
684 |
echo $this->formLabel($element);
|
|
|
685 |
echo $this->formText($element);
|
| 1616 |
eleazar |
686 |
?>
|
| 1631 |
eleazar |
687 |
</div>
|
|
|
688 |
<div class="form-group">
|
|
|
689 |
<?php
|
|
|
690 |
$element = $form->get('email');
|
|
|
691 |
$element->setOptions(['label' => 'LABEL_EMAIL']);
|
|
|
692 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
693 |
echo $this->formLabel($element);
|
|
|
694 |
echo $this->formText($element);
|
| 1616 |
eleazar |
695 |
?>
|
| 1631 |
eleazar |
696 |
</div>
|
|
|
697 |
<div class="form-group">
|
| 1649 |
eleazar |
698 |
<?php
|
| 1652 |
eleazar |
699 |
$element = $form->get('coment');
|
| 1649 |
eleazar |
700 |
$element->setAttributes(['class' => 'form-control']);
|
| 1657 |
eleazar |
701 |
$element->setOptions(['label' => 'LABEL_COMMENT']);
|
| 1649 |
eleazar |
702 |
echo $this->formLabel($element);
|
|
|
703 |
echo $this->formTextArea($element);
|
|
|
704 |
?>
|
|
|
705 |
</div>
|
|
|
706 |
<div class="form-group">
|
| 1631 |
eleazar |
707 |
<?php
|
| 1658 |
eleazar |
708 |
$element = $form->get('evaluation');
|
| 1649 |
eleazar |
709 |
$element->setAttributes(['class' => 'form-control']);
|
| 1658 |
eleazar |
710 |
$element->setOptions(['label' => 'LABEL_EVALUATION']);
|
| 1649 |
eleazar |
711 |
echo $this->formLabel($element);
|
|
|
712 |
echo $this->formSelect($element);
|
|
|
713 |
?>
|
|
|
714 |
</div>
|
|
|
715 |
<div class="form-group">
|
|
|
716 |
<?php
|
| 1616 |
eleazar |
717 |
$element = $form->get('file');
|
| 1631 |
eleazar |
718 |
|
|
|
719 |
$element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
|
| 1616 |
eleazar |
720 |
$element->setOptions(['label' => 'LABEL_CURRICULUM']);
|
|
|
721 |
echo $this->formLabel($element);
|
|
|
722 |
?>
|
|
|
723 |
<div class="file-loading">
|
| 1631 |
eleazar |
724 |
<?php echo $this->formFile($element); ?>
|
| 1616 |
eleazar |
725 |
</div>
|
| 1631 |
eleazar |
726 |
</div>
|
| 1619 |
eleazar |
727 |
|
| 1631 |
eleazar |
728 |
<div class="form-group">
|
|
|
729 |
<?php
|
|
|
730 |
$element = $form->get('status');
|
|
|
731 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
732 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
733 |
echo $this->formLabel($element);
|
|
|
734 |
echo $this->formSelect($element);
|
| 1619 |
eleazar |
735 |
?>
|
| 1631 |
eleazar |
736 |
</div>
|
|
|
737 |
</div>
|
|
|
738 |
<div class="modal-footer">
|
|
|
739 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
740 |
<button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
|
|
|
741 |
</div>
|
|
|
742 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
743 |
</div>
|
|
|
744 |
</div>
|
| 1485 |
eleazar |
745 |
</div>
|