| 1709 |
eleazar |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
$roleName = $currentUser->getUserTypeId();
|
|
|
5 |
|
| 2029 |
eleazar |
6 |
$routeIndex = $this->url('recruitment-and-selection/interview/form');
|
| 2128 |
eleazar |
7 |
$routeAdd = $this->url('recruitment-and-selection/interview/form/add', ['candidate_uuid' => 'UUID_PLACEHOLDER']);
|
| 1877 |
eleazar |
8 |
|
| 1827 |
eleazar |
9 |
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/add') ? 1 : 0;
|
| 1709 |
eleazar |
10 |
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
|
|
|
11 |
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
|
|
|
15 |
|
|
|
16 |
|
| 1885 |
eleazar |
17 |
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
|
| 1709 |
eleazar |
18 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
19 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
20 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
21 |
|
|
|
22 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
|
|
|
23 |
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
|
|
|
24 |
|
|
|
25 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
|
|
|
26 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
|
|
|
27 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
|
|
|
32 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
|
|
|
33 |
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
38 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
|
|
39 |
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
|
|
|
41 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
|
|
|
42 |
|
|
|
43 |
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
|
|
|
44 |
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
|
|
|
45 |
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
|
|
|
46 |
|
| 1887 |
eleazar |
47 |
|
|
|
48 |
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
|
|
|
49 |
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
|
|
|
50 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
|
|
|
51 |
|
|
|
52 |
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
|
| 1709 |
eleazar |
53 |
|
| 2052 |
eleazar |
54 |
// JsRender //
|
|
|
55 |
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
|
| 1709 |
eleazar |
56 |
|
|
|
57 |
$this->headStyle()->captureStart();
|
|
|
58 |
echo <<<CSS
|
|
|
59 |
|
|
|
60 |
CSS;
|
|
|
61 |
$this->headStyle()->captureEnd();
|
|
|
62 |
|
|
|
63 |
$this->inlineScript()->captureStart();
|
|
|
64 |
echo <<<JS
|
|
|
65 |
|
| 1877 |
eleazar |
66 |
var competencies = [];
|
|
|
67 |
var competencies_type = [];
|
| 1709 |
eleazar |
68 |
jQuery( document ).ready(function( $ ) {
|
| 1877 |
eleazar |
69 |
$.validator.setDefaults({
|
| 2015 |
eleazar |
70 |
debug: true,
|
|
|
71 |
highlight: function(element) {
|
|
|
72 |
$(element).addClass('is-invalid');
|
|
|
73 |
},
|
|
|
74 |
unhighlight: function(element) {
|
|
|
75 |
$(element).removeClass('is-invalid');
|
|
|
76 |
},
|
|
|
77 |
errorElement: 'span',
|
|
|
78 |
errorClass: 'error invalid-feedback',
|
|
|
79 |
errorPlacement: function(error, element) {
|
|
|
80 |
if(element.parent('.btn-file').length) {
|
|
|
81 |
error.insertAfter(element.parent().parent());
|
|
|
82 |
} else if(element.parent('.toggle').length) {
|
|
|
83 |
error.insertAfter(element.parent().parent());
|
|
|
84 |
} else {
|
|
|
85 |
error.insertAfter(element.parent());
|
| 1709 |
eleazar |
86 |
}
|
| 2015 |
eleazar |
87 |
}
|
|
|
88 |
});
|
| 1709 |
eleazar |
89 |
|
|
|
90 |
|
| 2015 |
eleazar |
91 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
92 |
var field = $(fieldname);
|
|
|
93 |
if(field) {
|
|
|
94 |
$(field).addClass('is-invalid');
|
| 1709 |
eleazar |
95 |
|
| 2015 |
eleazar |
96 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
97 |
|
|
|
98 |
if(element.parent('.btn-file').length) {
|
|
|
99 |
error.insertAfter(element.parent().parent());
|
|
|
100 |
} else if(element.parent('.toggle').length) {
|
|
|
101 |
error.insertAfter(element.parent().parent());
|
|
|
102 |
} else {
|
|
|
103 |
error.insertAfter(element.parent());
|
| 1709 |
eleazar |
104 |
}
|
| 2015 |
eleazar |
105 |
}
|
|
|
106 |
};
|
| 1827 |
eleazar |
107 |
|
| 2015 |
eleazar |
108 |
var validator = $('#form-interview').validate({
|
| 1877 |
eleazar |
109 |
debug: true,
|
|
|
110 |
onclick: false,
|
|
|
111 |
onkeyup: false,
|
|
|
112 |
ignore: [],
|
|
|
113 |
rules: {
|
|
|
114 |
'name': {
|
|
|
115 |
required: true,
|
|
|
116 |
maxlength: 64,
|
|
|
117 |
},
|
|
|
118 |
'status': {
|
|
|
119 |
required: false,
|
|
|
120 |
},
|
| 2276 |
eleazar |
121 |
|
| 1877 |
eleazar |
122 |
},
|
|
|
123 |
submitHandler: function(form) {
|
|
|
124 |
$.ajax({
|
|
|
125 |
'dataType': 'json',
|
|
|
126 |
'accept': 'application/json',
|
|
|
127 |
'method': 'post',
|
| 2245 |
eleazar |
128 |
'url': $('#form').attr('action'),
|
|
|
129 |
'data': $('#form').serialize()
|
| 1877 |
eleazar |
130 |
}).done(function(response) {
|
|
|
131 |
NProgress.start();
|
|
|
132 |
if (response['success']) {
|
|
|
133 |
$.fn.showSuccess(response['data']);
|
| 1900 |
eleazar |
134 |
$('#content').show();
|
|
|
135 |
$('#row-form').hide();
|
| 1877 |
eleazar |
136 |
gridTable.api().ajax.reload(null, false);
|
|
|
137 |
} else {
|
|
|
138 |
validator.resetForm();
|
|
|
139 |
if (jQuery.type(response['data']) == 'string') {
|
|
|
140 |
$.fn.showError(response['data']);
|
|
|
141 |
} else {
|
|
|
142 |
$.each(response['data'], function(fieldname, errors) {
|
| 2245 |
eleazar |
143 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
| 1877 |
eleazar |
144 |
});
|
|
|
145 |
}
|
|
|
146 |
}
|
|
|
147 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
148 |
$.fn.showError(textStatus);
|
|
|
149 |
}).always(function() {
|
|
|
150 |
NProgress.done();
|
|
|
151 |
});
|
|
|
152 |
return false;
|
|
|
153 |
},
|
|
|
154 |
invalidHandler: function(form, validator) {}
|
|
|
155 |
});
|
| 1709 |
eleazar |
156 |
|
| 2015 |
eleazar |
157 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
158 |
e.preventDefault();
|
|
|
159 |
NProgress.start();
|
|
|
160 |
$.ajax({
|
|
|
161 |
'dataType': 'json',
|
|
|
162 |
'accept': 'application/json',
|
|
|
163 |
'method': 'get',
|
| 2194 |
eleazar |
164 |
'url': '$routeAdd'.replaceAll('UUID_PLACEHOLDER', $('#candidate_uuid').val()),
|
| 2015 |
eleazar |
165 |
}).done(function(response) {
|
|
|
166 |
if (response['success']) {
|
| 2237 |
eleazar |
167 |
var data = response.data
|
| 2264 |
eleazar |
168 |
$("#competencies-job").html($("#competenciesTemplate").render(data))
|
| 2237 |
eleazar |
169 |
|
| 1877 |
eleazar |
170 |
} else {
|
| 2015 |
eleazar |
171 |
$.fn.showError(response['data']);
|
| 1877 |
eleazar |
172 |
}
|
| 2015 |
eleazar |
173 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
174 |
$.fn.showError(textStatus);
|
|
|
175 |
}).always(function() {
|
|
|
176 |
NProgress.done();
|
| 1877 |
eleazar |
177 |
});
|
| 2015 |
eleazar |
178 |
});
|
| 1709 |
eleazar |
179 |
|
| 2015 |
eleazar |
180 |
$('#form-interview #status').bootstrapToggle({
|
|
|
181 |
'on': 'LABEL_ACTIVE',
|
|
|
182 |
'off': 'LABEL_INACTIVE',
|
|
|
183 |
'width': '160px',
|
|
|
184 |
'height': '40px'
|
|
|
185 |
});
|
| 1709 |
eleazar |
186 |
|
| 2015 |
eleazar |
187 |
|
| 2265 |
eleazar |
188 |
|
| 2015 |
eleazar |
189 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
190 |
e.preventDefault();
|
|
|
191 |
$('#content').show();
|
|
|
192 |
$('#row-form').hide();
|
|
|
193 |
$('#div-listing').show();
|
|
|
194 |
});
|
|
|
195 |
|
|
|
196 |
$('#form-filter #vacancy_uuid').change(function(e) {
|
|
|
197 |
e.preventDefault();
|
|
|
198 |
$('#form-filter #candidates_uuid').empty();
|
|
|
199 |
})
|
| 2118 |
eleazar |
200 |
|
| 2015 |
eleazar |
201 |
$('#form-filter #candidates_uuid').change(function(e) {
|
|
|
202 |
e.preventDefault();
|
|
|
203 |
})
|
| 2029 |
eleazar |
204 |
|
|
|
205 |
$('#vacancy_uuid').on('change', function () {
|
| 2042 |
eleazar |
206 |
$('#candidate_uuid').html('');
|
|
|
207 |
|
| 2029 |
eleazar |
208 |
$.ajax({
|
|
|
209 |
'dataType': 'json',
|
|
|
210 |
'accept': 'application/json',
|
|
|
211 |
'method': 'get',
|
| 2031 |
eleazar |
212 |
'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
|
| 2038 |
eleazar |
213 |
}).done(function (response) {
|
|
|
214 |
var data = response.data
|
|
|
215 |
|
| 2036 |
eleazar |
216 |
data.candidates.forEach(function (candidate) {
|
| 2041 |
eleazar |
217 |
var option = $('<option />').val(candidate.uuid).text(candidate.first_name);
|
|
|
218 |
|
|
|
219 |
$('#candidate_uuid').append(option);
|
| 2036 |
eleazar |
220 |
});
|
| 2052 |
eleazar |
221 |
|
| 2244 |
eleazar |
222 |
$('#job-description').html($('#job-description-template').render(response.data));
|
| 2029 |
eleazar |
223 |
})
|
|
|
224 |
});
|
| 2032 |
eleazar |
225 |
|
|
|
226 |
$('#vacancy_uuid').change();
|
| 1709 |
eleazar |
227 |
});
|
|
|
228 |
JS;
|
|
|
229 |
$this->inlineScript()->captureEnd();
|
|
|
230 |
?>
|
|
|
231 |
|
|
|
232 |
|
|
|
233 |
<!-- Content Header (Page header) -->
|
|
|
234 |
<section class="content-header">
|
|
|
235 |
<div class="container-fluid">
|
|
|
236 |
<div class="row mb-2">
|
|
|
237 |
<div class="col-sm-12">
|
|
|
238 |
<h1>LABEL_INTERVIEW</h1>
|
|
|
239 |
</div>
|
|
|
240 |
</div>
|
|
|
241 |
</div><!-- /.container-fluid -->
|
|
|
242 |
</section>
|
|
|
243 |
|
|
|
244 |
<section class="content">
|
|
|
245 |
<div class="container-fluid">
|
|
|
246 |
<div class="row">
|
|
|
247 |
<div class="col-12">
|
|
|
248 |
<div class="card">
|
| 2021 |
eleazar |
249 |
<div class="card-header">
|
| 1709 |
eleazar |
250 |
<div class="row">
|
|
|
251 |
<div class="col-md-6 col-sm-12">
|
|
|
252 |
<div class="form-group">
|
| 2021 |
eleazar |
253 |
<label for="vacancy_uuid">LABEL_VACANCY</label>
|
| 2023 |
eleazar |
254 |
<select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
|
| 2021 |
eleazar |
255 |
<?php foreach($this->vacancies as $vacancy): ?>
|
| 2023 |
eleazar |
256 |
<option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
|
| 2021 |
eleazar |
257 |
<?php endforeach; ?>
|
|
|
258 |
</select>
|
| 1709 |
eleazar |
259 |
</div>
|
|
|
260 |
</div>
|
|
|
261 |
<div class="col-md-6 col-sm-12">
|
|
|
262 |
<div class="form-group">
|
| 2040 |
eleazar |
263 |
<label for="candidate_uuid">LABEL_CANDIDATES</label>
|
| 2024 |
eleazar |
264 |
<select id="candidate_uuid" name="candidate_uuid" class="form-control">
|
|
|
265 |
</select>
|
| 1709 |
eleazar |
266 |
</div>
|
|
|
267 |
</div>
|
|
|
268 |
<div
|
|
|
269 |
class="col-md-12 col-sm-12"
|
|
|
270 |
>
|
|
|
271 |
</div>
|
|
|
272 |
</div>
|
|
|
273 |
</div>
|
|
|
274 |
<div class="card-body">
|
| 2052 |
eleazar |
275 |
<div id="job-description"></div>
|
| 1709 |
eleazar |
276 |
</div>
|
| 2015 |
eleazar |
277 |
|
|
|
278 |
<div class="card-footer clearfix">
|
|
|
279 |
<div style="float:right;">
|
|
|
280 |
<?php if($allowAdd) : ?>
|
|
|
281 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
282 |
<?php endif; ?>
|
| 1876 |
eleazar |
283 |
</div>
|
| 2015 |
eleazar |
284 |
</div>
|
|
|
285 |
</div>
|
| 1876 |
eleazar |
286 |
</div>
|
| 2015 |
eleazar |
287 |
</div>
|
|
|
288 |
</div>
|
|
|
289 |
</section>
|
| 2052 |
eleazar |
290 |
|
|
|
291 |
<script id="job-description-template" type="text/x-jsrender">
|
|
|
292 |
<div class="card">
|
|
|
293 |
<div class="card-body">
|
|
|
294 |
<h5 class="card-title">{{:job_description.name}}</h5>
|
|
|
295 |
<p class="card-text">{{:vacancy.description}}</p>
|
| 2214 |
eleazar |
296 |
<p class="card-text">{{:job_description.objectives}}</p>
|
|
|
297 |
<p class="card-text">{{:job_description.functions}}</p>
|
| 2052 |
eleazar |
298 |
</div>
|
|
|
299 |
</div>
|
| 2061 |
eleazar |
300 |
</script>
|
|
|
301 |
|
| 2216 |
eleazar |
302 |
<section class="interview">
|
| 2215 |
eleazar |
303 |
<div class="container-fluid">
|
|
|
304 |
<div class="row">
|
|
|
305 |
<div class="col-12">
|
|
|
306 |
<div class="card">
|
|
|
307 |
<div class="card-header">
|
|
|
308 |
<label>interview</label>
|
|
|
309 |
</div>
|
|
|
310 |
<div class="card-body">
|
| 2217 |
eleazar |
311 |
<div id="competencies-job"></div>
|
| 2215 |
eleazar |
312 |
</div>
|
| 2277 |
eleazar |
313 |
<div class="form-group">
|
|
|
314 |
<label for="text-option">LABEL_TEXT</label>
|
|
|
315 |
<!-- ckeditor -->
|
|
|
316 |
<textarea name="text-option" id="text-option" rows="5" class="form-control"></textarea>
|
|
|
317 |
</div>
|
| 2280 |
eleazar |
318 |
<div class="card-footer clearfix">
|
| 2284 |
eleazar |
319 |
<button type="button" class="btn btn-primary btn-behavior-submit">LABEL_SAVE</button>
|
|
|
320 |
<button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
|
| 2280 |
eleazar |
321 |
</div>
|
| 2278 |
eleazar |
322 |
</div>
|
| 2215 |
eleazar |
323 |
</div>
|
|
|
324 |
</div>
|
|
|
325 |
</div>
|
|
|
326 |
</section>
|
|
|
327 |
|
| 2264 |
eleazar |
328 |
<script id="competenciesTemplate" type="text/x-jsrender">
|
| 2293 |
eleazar |
329 |
<table class="table table-bordered">
|
|
|
330 |
<thead>
|
|
|
331 |
<tr>
|
| 2306 |
eleazar |
332 |
<th style="width: 50%;">LABEL_ELEMENT</th>
|
| 2293 |
eleazar |
333 |
<th style="width: 50%;">LABEL_TITLE</th>
|
|
|
334 |
</tr>
|
|
|
335 |
</thead>
|
| 2300 |
eleazar |
336 |
<tbody>
|
|
|
337 |
{{for job_description.competencies}}
|
|
|
338 |
<tr>
|
|
|
339 |
<td class="text-left">LABEL_COMPETENCY</td>
|
| 2302 |
eleazar |
340 |
<td class="text-left">{{:competency_name}}</td>
|
| 2300 |
eleazar |
341 |
</tr>
|
| 2302 |
eleazar |
342 |
|
|
|
343 |
{{for behaviors}}
|
| 2308 |
eleazar |
344 |
<tr>
|
| 2302 |
eleazar |
345 |
<td class="text-left">--LABEL_CONDUCT</td>
|
|
|
346 |
<td class="text-left">
|
| 2303 |
eleazar |
347 |
{{:description}}
|
| 2302 |
eleazar |
348 |
</td>
|
|
|
349 |
</tr>
|
|
|
350 |
{{/for}}
|
| 2307 |
eleazar |
351 |
|
| 2302 |
eleazar |
352 |
<tr>
|
| 2310 |
eleazar |
353 |
<td colspan="2">
|
| 2311 |
eleazar |
354 |
<textarea style="width: 100%; border: 1px solid lightgray;"></textarea>
|
| 2310 |
eleazar |
355 |
</td>
|
| 2300 |
eleazar |
356 |
</tr>
|
|
|
357 |
{{/for}}
|
|
|
358 |
</tbody>
|
| 2293 |
eleazar |
359 |
</table>
|
| 2241 |
eleazar |
360 |
</script>
|