1384 |
efrain |
1 |
<?php
|
|
|
2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
3 |
$currentUser = $this->currentUserHelper();
|
|
|
4 |
|
|
|
5 |
$roleName = $currentUser->getUserTypeId();
|
|
|
6 |
|
|
|
7 |
$routeDashboard = $this->url('dashboard');
|
1477 |
efrain |
8 |
$routeDatatable = $this->url('recruitment-and-selection/vacancies');
|
|
|
9 |
$routeAdd = $this->url('recruitment-and-selection/vacancies/add');
|
1384 |
efrain |
10 |
|
15457 |
efrain |
11 |
|
1477 |
efrain |
12 |
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/add') ? 1 : 0;
|
|
|
13 |
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/edit') ? 1 : 0;
|
|
|
14 |
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/vacancies/delete') ? 1 : 0;
|
|
|
15 |
|
|
|
16 |
|
15457 |
efrain |
17 |
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
|
|
|
18 |
|
|
|
19 |
|
16822 |
efrain |
20 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
15457 |
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'));
|
15457 |
efrain |
25 |
|
|
|
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'));
|
15457 |
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'));
|
15457 |
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'));
|
15457 |
efrain |
38 |
|
|
|
39 |
|
16822 |
efrain |
40 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
|
|
|
41 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
|
1384 |
efrain |
42 |
|
16822 |
efrain |
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.full.min.js'));
|
1384 |
efrain |
44 |
|
16822 |
efrain |
45 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
|
|
|
46 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
|
|
|
47 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
|
15457 |
efrain |
48 |
|
|
|
49 |
|
16822 |
efrain |
50 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
51 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
1384 |
efrain |
52 |
|
12264 |
stevensc |
53 |
|
16822 |
efrain |
54 |
|
|
|
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
|
|
|
56 |
|
15457 |
efrain |
57 |
// bootbox Alert //
|
|
|
58 |
|
16822 |
efrain |
59 |
|
15457 |
efrain |
60 |
// JsRender //
|
16822 |
efrain |
61 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
|
15457 |
efrain |
62 |
|
|
|
63 |
|
|
|
64 |
// Page Styles
|
|
|
65 |
$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
$status_active = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_ACTIVE;
|
|
|
69 |
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_INACTIVE;
|
|
|
70 |
|
|
|
71 |
$this->inlineScript()->captureStart();
|
|
|
72 |
echo <<<JS
|
|
|
73 |
jQuery(document).ready(function($) {
|
15461 |
efrain |
74 |
|
|
|
75 |
|
|
|
76 |
|
15457 |
efrain |
77 |
var allowEdit = $allowEdit;
|
|
|
78 |
var allowDelete = $allowDelete;
|
|
|
79 |
|
15461 |
efrain |
80 |
$.validator.setDefaults({
|
|
|
81 |
debug: true,
|
|
|
82 |
highlight: function(element) {
|
|
|
83 |
$(element).addClass('is-invalid');
|
|
|
84 |
},
|
|
|
85 |
unhighlight: function(element) {
|
|
|
86 |
$(element).removeClass('is-invalid');
|
|
|
87 |
},
|
|
|
88 |
errorElement: 'span',
|
|
|
89 |
errorClass: 'error invalid-feedback',
|
|
|
90 |
errorPlacement: function(error, element) {
|
|
|
91 |
if(element.parent('.form-group').length) {
|
|
|
92 |
error.insertAfter(element);
|
|
|
93 |
} else if(element.parent('.toggle').length) {
|
|
|
94 |
error.insertAfter(element.parent().parent());
|
|
|
95 |
} else {
|
|
|
96 |
error.insertAfter(element.parent());
|
|
|
97 |
}
|
|
|
98 |
}
|
|
|
99 |
});
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
103 |
var field = $(fieldname);
|
|
|
104 |
if(field) {
|
|
|
105 |
$(field).addClass('is-invalid');
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
|
|
|
109 |
if(field.parent('.form-group').length) {
|
|
|
110 |
error.insertAfter(field);
|
|
|
111 |
} else if(field.parent('.toggle').length) {
|
|
|
112 |
error.insertAfter(field.parent().parent());
|
|
|
113 |
} else {
|
|
|
114 |
error.insertAfter(field.parent());
|
|
|
115 |
}
|
|
|
116 |
}
|
|
|
117 |
};
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
15457 |
efrain |
121 |
var gridTable = $('#gridTable').dataTable({
|
|
|
122 |
'processing': true,
|
|
|
123 |
'serverSide': true,
|
|
|
124 |
'searching': true,
|
|
|
125 |
'order': [
|
|
|
126 |
[0, 'asc']
|
|
|
127 |
],
|
|
|
128 |
'ordering': true,
|
|
|
129 |
'ordenable': true,
|
|
|
130 |
'responsive': true,
|
|
|
131 |
'select': false,
|
|
|
132 |
'paging': true,
|
|
|
133 |
'pagingType': 'simple_numbers',
|
|
|
134 |
'ajax': {
|
|
|
135 |
'url': '$routeDatatable',
|
|
|
136 |
'type': 'get',
|
|
|
137 |
'beforeSend': function(request) {
|
|
|
138 |
NProgress.start();
|
|
|
139 |
},
|
|
|
140 |
'dataFilter': function(response) {
|
|
|
141 |
var response = jQuery.parseJSON(response);
|
|
|
142 |
var json = {};
|
|
|
143 |
json.recordsTotal = 0;
|
|
|
144 |
json.recordsFiltered = 0;
|
|
|
145 |
json.data = [];
|
|
|
146 |
if (response.success) {
|
|
|
147 |
json.recordsTotal = response.data.total;
|
|
|
148 |
json.recordsFiltered = response.data.total;
|
|
|
149 |
json.data = response.data.items;
|
|
|
150 |
} else {
|
|
|
151 |
$.fn.showError(response.data)
|
|
|
152 |
}
|
|
|
153 |
return JSON.stringify(json);
|
|
|
154 |
}
|
|
|
155 |
},
|
|
|
156 |
'language': {
|
|
|
157 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
158 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
159 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
160 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
161 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
162 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
163 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
164 |
'sInfoPostFix': '',
|
|
|
165 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
166 |
'sUrl': '',
|
|
|
167 |
'sInfoThousands': ',',
|
|
|
168 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
169 |
'oPaginate': {
|
|
|
170 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
171 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
172 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
173 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
174 |
},
|
|
|
175 |
'oAria': {
|
|
|
176 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
177 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
178 |
},
|
|
|
179 |
},
|
|
|
180 |
'drawCallback': function(settings) {
|
|
|
181 |
NProgress.done();
|
16822 |
efrain |
182 |
|
15457 |
efrain |
183 |
},
|
|
|
184 |
'aoColumns': [
|
|
|
185 |
{ 'mDataProp': 'name' },
|
|
|
186 |
{ 'mDataProp': 'job_description' },
|
|
|
187 |
{ 'mDataProp': 'last_date' },
|
|
|
188 |
{ 'mDataProp': 'status' },
|
|
|
189 |
{ 'mDataProp': 'actions' },
|
|
|
190 |
],
|
|
|
191 |
'columnDefs': [
|
|
|
192 |
{
|
|
|
193 |
'targets': 0,
|
|
|
194 |
'className': 'text-vertical-middle',
|
|
|
195 |
},
|
|
|
196 |
{
|
|
|
197 |
'targets': 1,
|
|
|
198 |
'className': 'text-vertical-middle',
|
|
|
199 |
},
|
|
|
200 |
{
|
|
|
201 |
'targets': 2,
|
|
|
202 |
'className': 'text-vertical-middle',
|
|
|
203 |
},
|
|
|
204 |
{
|
|
|
205 |
'targets': 3,
|
|
|
206 |
'className': 'text-vertical-middle',
|
|
|
207 |
},
|
|
|
208 |
{
|
|
|
209 |
'targets': -1,
|
|
|
210 |
'orderable': false,
|
|
|
211 |
'render': function(data, type, row) {
|
|
|
212 |
s = '';
|
|
|
213 |
if (allowEdit) {
|
|
|
214 |
s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button> ';
|
|
|
215 |
}
|
|
|
216 |
if (allowDelete) {
|
|
|
217 |
s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button> ';
|
|
|
218 |
}
|
|
|
219 |
return s;
|
|
|
220 |
}
|
|
|
221 |
}
|
|
|
222 |
],
|
|
|
223 |
});
|
|
|
224 |
|
|
|
225 |
$.validator.addMethod('checkLocation', function (value, element, param) {
|
|
|
226 |
var otherElement = $(param);
|
|
|
227 |
return $.trim(otherElement.val()).length > 0;
|
|
|
228 |
}, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
|
|
|
229 |
|
15461 |
efrain |
230 |
|
15457 |
efrain |
231 |
var autocompleteLocation = new google.maps.places.Autocomplete(
|
|
|
232 |
(document.getElementById('location_search')),
|
|
|
233 |
{types: ['(cities)']}
|
|
|
234 |
);
|
|
|
235 |
|
15461 |
efrain |
236 |
|
15457 |
efrain |
237 |
$.fn.fillInAddressLocation = function() {
|
15461 |
efrain |
238 |
|
|
|
239 |
|
15457 |
efrain |
240 |
var place = autocompleteLocation.getPlace();
|
|
|
241 |
if (!place.geometry) {
|
|
|
242 |
$.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
|
|
|
243 |
return;
|
|
|
244 |
} else {
|
15461 |
efrain |
245 |
|
15457 |
efrain |
246 |
address1 = '';
|
|
|
247 |
address2 = '';
|
|
|
248 |
city1 = '';
|
|
|
249 |
city2 = '';
|
|
|
250 |
state = '';
|
|
|
251 |
country = '';
|
|
|
252 |
postal_code = '';
|
|
|
253 |
|
|
|
254 |
formatted_address = place.formatted_address;
|
|
|
255 |
latitude = place.geometry.location.lat();
|
|
|
256 |
longitude = place.geometry.location.lng();
|
|
|
257 |
var arrAddress = place.address_components;
|
15461 |
efrain |
258 |
|
|
|
259 |
|
15457 |
efrain |
260 |
$.each(arrAddress, function(i, address_component) {
|
|
|
261 |
if (address_component.types[0] == "route") {
|
|
|
262 |
address1 = address_component.long_name;
|
|
|
263 |
}
|
|
|
264 |
if (address_component.types[0] == "sublocality") {
|
|
|
265 |
address2 = address_component.long_name;
|
|
|
266 |
}
|
|
|
267 |
if (address_component.types[0] == "locality") {
|
|
|
268 |
city1 = address_component.long_name;
|
|
|
269 |
}
|
|
|
270 |
if (address_component.types[0] == "administrative_area_level_2") {
|
|
|
271 |
city2 = address_component.long_name;
|
|
|
272 |
}
|
|
|
273 |
if (address_component.types[0] == "administrative_area_level_1") {
|
|
|
274 |
state = address_component.long_name;
|
|
|
275 |
}
|
|
|
276 |
if (address_component.types[0] == "country") {
|
|
|
277 |
country = address_component.long_name;
|
|
|
278 |
}
|
|
|
279 |
if (address_component.types[0] == "postal_code") {
|
|
|
280 |
postal_code = address_component.long_name;
|
|
|
281 |
}
|
|
|
282 |
});
|
|
|
283 |
|
15461 |
efrain |
284 |
|
|
|
285 |
$('#form #formatted_address').val(formatted_address);
|
|
|
286 |
$('#form #address1').val(address1);
|
|
|
287 |
$('#form #address2').val(address2);
|
|
|
288 |
$('#form #city1').val(city1);
|
|
|
289 |
$('#form #city2').val(city2);
|
|
|
290 |
$('#form #state').val(state);
|
|
|
291 |
$('#form #country').val(country);
|
|
|
292 |
$('#form #postal_code').val(postal_code);
|
|
|
293 |
$('#form #latitude').val(latitude);
|
|
|
294 |
$('#form #longitude').val(longitude);
|
|
|
295 |
|
9427 |
stevensc |
296 |
}
|
15457 |
efrain |
297 |
}
|
|
|
298 |
|
15461 |
efrain |
299 |
|
|
|
300 |
|
|
|
301 |
autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
|
|
|
302 |
|
|
|
303 |
var validator = $('#form').validate({
|
|
|
304 |
debug: true,
|
|
|
305 |
onclick: true,
|
|
|
306 |
onkeyup: false,
|
|
|
307 |
ignore: [],
|
|
|
308 |
rules: {
|
|
|
309 |
'name': {
|
|
|
310 |
required: true,
|
|
|
311 |
maxlength: 128,
|
|
|
312 |
},
|
|
|
313 |
'job_description_id': {
|
|
|
314 |
required: true,
|
|
|
315 |
|
|
|
316 |
},
|
|
|
317 |
'job_category_id' : {
|
|
|
318 |
required: true,
|
|
|
319 |
|
|
|
320 |
},
|
|
|
321 |
'industry_id' : {
|
|
|
322 |
required: true,
|
|
|
323 |
|
|
|
324 |
},
|
|
|
325 |
'description': {
|
|
|
326 |
updateCkeditor:function() {
|
|
|
327 |
CKEDITOR.instances.description.updateElement();
|
|
|
328 |
},
|
|
|
329 |
required: true
|
|
|
330 |
},
|
|
|
331 |
'location_search': {
|
|
|
332 |
required: true,
|
15462 |
efrain |
333 |
//checkLocation: '#form #latitude',
|
15461 |
efrain |
334 |
},
|
|
|
335 |
'last_date' : {
|
|
|
336 |
required: true,
|
|
|
337 |
|
|
|
338 |
},
|
|
|
339 |
'status': {
|
|
|
340 |
required: false,
|
|
|
341 |
|
|
|
342 |
},
|
|
|
343 |
},
|
|
|
344 |
submitHandler: function(form)
|
|
|
345 |
{
|
|
|
346 |
|
|
|
347 |
$.ajax({
|
|
|
348 |
'dataType' : 'json',
|
|
|
349 |
'accept' : 'application/json',
|
|
|
350 |
'method' : 'post',
|
|
|
351 |
'url' : $('#form').attr('action'),
|
|
|
352 |
'data' : $('#form').serialize()
|
|
|
353 |
}).done(function(response) {
|
|
|
354 |
NProgress.start();
|
|
|
355 |
if(response['success']) {
|
|
|
356 |
$.fn.showSuccess(response['data']);
|
|
|
357 |
|
|
|
358 |
$('#section-title').html('LABEL_VACANCIES');
|
|
|
359 |
$('#row-form').hide();
|
|
|
360 |
$('#row-list').show();
|
|
|
361 |
|
|
|
362 |
|
|
|
363 |
gridTable.api().ajax.reload(null, false);
|
|
|
364 |
} else {
|
|
|
365 |
validator.resetForm();
|
|
|
366 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
367 |
$.fn.showError(response['data']);
|
|
|
368 |
} else {
|
|
|
369 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
370 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
371 |
});
|
|
|
372 |
}
|
|
|
373 |
}
|
|
|
374 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
375 |
$.fn.showError(textStatus);
|
|
|
376 |
}).always(function() {
|
|
|
377 |
NProgress.done();
|
|
|
378 |
|
|
|
379 |
});
|
|
|
380 |
return false;
|
|
|
381 |
},
|
|
|
382 |
invalidHandler: function(form, validator) {
|
|
|
383 |
|
|
|
384 |
}
|
|
|
385 |
});
|
|
|
386 |
|
|
|
387 |
|
|
|
388 |
|
|
|
389 |
|
|
|
390 |
|
|
|
391 |
|
15457 |
efrain |
392 |
|
15461 |
efrain |
393 |
|
|
|
394 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
395 |
e.preventDefault();
|
|
|
396 |
form_id = $(this).data('id')
|
|
|
397 |
var action = $(this).data('href');
|
|
|
398 |
$.ajax({
|
|
|
399 |
'dataType': 'json',
|
|
|
400 |
'accept': 'application/json',
|
|
|
401 |
'method': 'get',
|
|
|
402 |
'url': action,
|
|
|
403 |
}).done(function(response) {
|
|
|
404 |
if (response['success']) {
|
|
|
405 |
$('#section-title').html('LABEL_EDIT_VACANCY');
|
|
|
406 |
|
|
|
407 |
$('#form').attr('action', action);
|
|
|
408 |
$('#form #name').val(response['data']['name']);
|
|
|
409 |
$('#form #job_description_id').val(response['data']['job_description_id']).trigger('change');
|
|
|
410 |
$('#form #job_category_id').val(response['data']['job_category_id']).trigger('change');
|
|
|
411 |
$('#form #industry_id').val(response['data']['industry_id']).trigger('change');
|
|
|
412 |
$('#form #location_search').val(response['data']['location_search']);
|
|
|
413 |
$('#form #formatted_address').val(response['data']['formatted_address']);
|
|
|
414 |
$('#form #address1').val(response['data']['address1']);
|
|
|
415 |
$('#form #address2').val(response['data']['address2']);
|
|
|
416 |
$('#form #city1').val(response['data']['city1']);
|
|
|
417 |
$('#form #city2').val(response['data']['city2']);
|
|
|
418 |
$('#form #state').val(response['data']['state']);
|
|
|
419 |
$('#form #country').val(response['data']['country']);
|
|
|
420 |
$('#form #postal_code').val(response['data']['postal_code']);
|
|
|
421 |
$('#form #latitude').val(response['data']['latitude']);
|
|
|
422 |
$('#form #longitude').val(response['data']['longitude']);
|
|
|
423 |
$('#form #last_date').val(response['data']['last_date']);
|
|
|
424 |
$('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
|
|
|
425 |
CKEDITOR.instances['description'].setData(response['data']['description']);
|
|
|
426 |
$('#row-list').hide();
|
|
|
427 |
$('#row-form').show();
|
|
|
428 |
|
|
|
429 |
} else {
|
|
|
430 |
$.fn.showError(response['message']);
|
|
|
431 |
}
|
|
|
432 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
|
|
433 |
$.fn.showError(textStatus);
|
|
|
434 |
});
|
|
|
435 |
});
|
|
|
436 |
|
|
|
437 |
$('#form #last_date').datetimepicker({
|
|
|
438 |
locale: 'es',
|
|
|
439 |
format: 'DD/MM/YYYY'
|
|
|
440 |
});
|
|
|
441 |
|
|
|
442 |
$('button.btn-add').click(function(e) {
|
|
|
443 |
$('#section-title').html('LABEL_NEW_VACANCY');
|
|
|
444 |
|
|
|
445 |
|
|
|
446 |
$('#form').attr('action', '$routeAdd');
|
|
|
447 |
$('#form #name').val('');
|
|
|
448 |
$('#form #job_description_id').val('').trigger('change');
|
|
|
449 |
$('#form #job_category_id').val('').trigger('change');
|
|
|
450 |
$('#form #industry_id').val('').trigger('change');
|
|
|
451 |
|
|
|
452 |
$('#form #location_search').val('');
|
|
|
453 |
$('#form #address1').val('');
|
|
|
454 |
$('#form #address2').val('');
|
|
|
455 |
$('#form #city1').val('');
|
|
|
456 |
$('#form #city2').val('');
|
|
|
457 |
$('#form #state').val('');
|
|
|
458 |
$('#form #country').val('');
|
|
|
459 |
$('#form #postal_code').val('');
|
|
|
460 |
$('#form #latitude').val('');
|
|
|
461 |
$('#form #longitude').val('');
|
|
|
462 |
|
|
|
463 |
$('#form #last_date').val('');
|
|
|
464 |
$('#form #status').bootstrapToggle('on')
|
|
|
465 |
|
|
|
466 |
CKEDITOR.instances['description'].setData('');
|
|
|
467 |
|
|
|
468 |
$('#row-list').hide();
|
|
|
469 |
$('#row-form').show();
|
|
|
470 |
$('#form #name').focus();
|
|
|
471 |
return;
|
|
|
472 |
});
|
|
|
473 |
|
|
|
474 |
|
|
|
475 |
|
|
|
476 |
|
15457 |
efrain |
477 |
$('button.btn-edit-cancel').click(function(e) {
|
|
|
478 |
$('#row-form').hide();
|
|
|
479 |
$('#row-list').show();
|
15461 |
efrain |
480 |
|
|
|
481 |
$('#section-title').html('LABEL_VACANCIES');
|
15457 |
efrain |
482 |
return;
|
|
|
483 |
});
|
|
|
484 |
|
|
|
485 |
$('body').on('click', 'button.btn-refresh', function (e) {
|
|
|
486 |
e.preventDefault();
|
|
|
487 |
gridTable.api().ajax.reload(null, false);
|
|
|
488 |
|
|
|
489 |
});
|
|
|
490 |
|
16822 |
efrain |
491 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
492 |
e.preventDefault();
|
|
|
493 |
var action = $(this).data('href');
|
|
|
494 |
|
|
|
495 |
|
|
|
496 |
swal.fire({
|
|
|
497 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
498 |
icon: 'question',
|
|
|
499 |
cancelButtonText: 'LABEL_NO',
|
|
|
500 |
showCancelButton: true,
|
|
|
501 |
confirmButtonText: 'LABEL_YES'
|
|
|
502 |
}).then((result) => {
|
|
|
503 |
if (result.isConfirmed) {
|
|
|
504 |
|
|
|
505 |
NProgress.start();
|
|
|
506 |
$.ajax({
|
|
|
507 |
'dataType' : 'json',
|
|
|
508 |
'accept' : 'application/json',
|
|
|
509 |
'method' : 'post',
|
|
|
510 |
'url' : action,
|
|
|
511 |
}).done(function(response) {
|
|
|
512 |
if(response['success']) {
|
|
|
513 |
$.fn.showSuccess(response['data']);
|
|
|
514 |
gridTable.api().ajax.reload(null, false);
|
|
|
515 |
} else {
|
|
|
516 |
$.fn.showError(response['data']);
|
|
|
517 |
}
|
|
|
518 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
519 |
$.fn.showError(textStatus);
|
|
|
520 |
}).always(function() {
|
|
|
521 |
NProgress.done();
|
|
|
522 |
});
|
|
|
523 |
}
|
|
|
524 |
});
|
|
|
525 |
});
|
|
|
526 |
|
15457 |
efrain |
527 |
$('#job_description_id').select2({
|
|
|
528 |
theme: 'bootstrap4',
|
|
|
529 |
width: '100%',
|
|
|
530 |
});
|
|
|
531 |
|
|
|
532 |
|
|
|
533 |
$('#job_category_id').select2({
|
|
|
534 |
theme: 'bootstrap4',
|
|
|
535 |
width: '100%',
|
|
|
536 |
});
|
|
|
537 |
|
|
|
538 |
|
|
|
539 |
$('#industry_id').select2({
|
|
|
540 |
theme: 'bootstrap4',
|
|
|
541 |
width: '100%',
|
|
|
542 |
});
|
|
|
543 |
|
|
|
544 |
|
|
|
545 |
$('#status').bootstrapToggle({
|
|
|
546 |
'on': 'LABEL_ACTIVE',
|
|
|
547 |
'off': 'LABEL_INACTIVE',
|
|
|
548 |
'width': '160px',
|
|
|
549 |
'height': '40px'
|
|
|
550 |
});
|
|
|
551 |
|
|
|
552 |
|
15461 |
efrain |
553 |
|
15457 |
efrain |
554 |
|
|
|
555 |
|
|
|
556 |
|
|
|
557 |
|
|
|
558 |
CKEDITOR.replace('description', {
|
|
|
559 |
toolbar: [
|
|
|
560 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
561 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
562 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
563 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
564 |
'/',
|
|
|
565 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
566 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
567 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
568 |
],
|
|
|
569 |
removePlugins: 'elementspath,Anchor',
|
|
|
570 |
heigth: 100
|
|
|
571 |
});
|
|
|
572 |
});
|
9427 |
stevensc |
573 |
JS;
|
9469 |
stevensc |
574 |
|
15457 |
efrain |
575 |
$this->inlineScript()->captureEnd();
|
9469 |
stevensc |
576 |
|
1384 |
efrain |
577 |
?>
|
|
|
578 |
<!-- Content Header (Page header) -->
|
9427 |
stevensc |
579 |
|
15461 |
efrain |
580 |
|
15457 |
efrain |
581 |
<section class="content-header">
|
|
|
582 |
<div class="container-fluid">
|
|
|
583 |
<div class="row mb-2">
|
|
|
584 |
<div class="col-sm-12">
|
15461 |
efrain |
585 |
<h1 id="section-title"></h1>
|
15457 |
efrain |
586 |
</div>
|
|
|
587 |
</div>
|
|
|
588 |
</div>
|
|
|
589 |
<!-- /.container-fluid -->
|
|
|
590 |
</section>
|
|
|
591 |
<section class="content">
|
15461 |
efrain |
592 |
<div class="container-fluid">
|
|
|
593 |
<div class="row" id="row-list">
|
15457 |
efrain |
594 |
<div class="col-12">
|
|
|
595 |
<div class="card">
|
|
|
596 |
<div class="card-body">
|
|
|
597 |
<table id="gridTable" class="table table-hover">
|
|
|
598 |
<thead>
|
|
|
599 |
<tr>
|
|
|
600 |
<th>LABEL_NAME</th>
|
|
|
601 |
<th>LABEL_JOB_DESCRIPTION</th>
|
|
|
602 |
<th>LABEL_LAST_DATE</th>
|
|
|
603 |
<th>LABEL_STATUS</th>
|
|
|
604 |
<th>LABEL_ACTIONS</th>
|
|
|
605 |
</tr>
|
|
|
606 |
</thead>
|
|
|
607 |
<tbody>
|
|
|
608 |
</tbody>
|
|
|
609 |
</table>
|
|
|
610 |
</div>
|
|
|
611 |
<div class="card-footer clearfix">
|
|
|
612 |
<div style="float:right;">
|
|
|
613 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
|
|
|
614 |
<?php if ($allowAdd) : ?>
|
|
|
615 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
616 |
<?php endif; ?>
|
|
|
617 |
</div>
|
|
|
618 |
</div>
|
|
|
619 |
</div>
|
|
|
620 |
</div>
|
|
|
621 |
</div>
|
|
|
622 |
</div>
|
|
|
623 |
|
|
|
624 |
|
|
|
625 |
<!-- Create/Edit Form -->
|
|
|
626 |
<div class="row" id="row-form" style="display: none; padding: 16px;">
|
|
|
627 |
<div class="col-xs-12 col-md-12">
|
|
|
628 |
<?php
|
|
|
629 |
$form = $this->form;
|
|
|
630 |
$form->setAttributes([
|
|
|
631 |
'method' => 'post',
|
15461 |
efrain |
632 |
'name' => 'form',
|
|
|
633 |
'id' => 'form'
|
15457 |
efrain |
634 |
]);
|
|
|
635 |
|
|
|
636 |
$form->prepare();
|
|
|
637 |
echo $this->form()->openTag($form);
|
|
|
638 |
|
|
|
639 |
$fields = ['formatted_address',
|
|
|
640 |
'address1',
|
|
|
641 |
'address2',
|
|
|
642 |
'country',
|
|
|
643 |
'state',
|
|
|
644 |
'city1',
|
|
|
645 |
'city2',
|
|
|
646 |
'postal_code',
|
|
|
647 |
'latitude',
|
|
|
648 |
'longitude',
|
|
|
649 |
];
|
|
|
650 |
|
|
|
651 |
foreach($fields as $field)
|
|
|
652 |
{
|
|
|
653 |
$element = $form->get($field);
|
|
|
654 |
echo $this->formHidden($element);
|
|
|
655 |
}
|
|
|
656 |
|
|
|
657 |
?>
|
|
|
658 |
<div class="form-group">
|
|
|
659 |
<?php
|
|
|
660 |
$element = $form->get('name');
|
|
|
661 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
662 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
663 |
|
|
|
664 |
echo $this->formLabel($element);
|
|
|
665 |
echo $this->formText($element);
|
|
|
666 |
?>
|
|
|
667 |
</div>
|
|
|
668 |
<div class="form-group">
|
|
|
669 |
<?php
|
|
|
670 |
$element = $form->get('job_description_id');
|
|
|
671 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
672 |
$element->setOptions(['label' => 'LABEL_POSITION_EVALUATED']);
|
|
|
673 |
|
|
|
674 |
echo $this->formLabel($element);
|
|
|
675 |
echo $this->formSelect($element);
|
|
|
676 |
?>
|
|
|
677 |
</div>
|
|
|
678 |
<div class="form-group">
|
|
|
679 |
<?php
|
|
|
680 |
$element = $form->get('job_category_id');
|
|
|
681 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
682 |
$element->setOptions(['label' => 'LABEL_JOB_CATEGORY']);
|
|
|
683 |
|
|
|
684 |
echo $this->formLabel($element);
|
|
|
685 |
echo $this->formSelect($element);
|
|
|
686 |
?>
|
|
|
687 |
</div>
|
|
|
688 |
<div class="form-group">
|
|
|
689 |
<?php
|
|
|
690 |
$element = $form->get('location_search');
|
|
|
691 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
692 |
$element->setOptions(['label' => 'LABEL_LOCATION']);
|
|
|
693 |
|
|
|
694 |
echo $this->formLabel($element);
|
|
|
695 |
echo $this->formText($element);
|
|
|
696 |
?>
|
|
|
697 |
</div>
|
|
|
698 |
<div class="form-group">
|
|
|
699 |
<?php
|
|
|
700 |
$element = $form->get('industry_id');
|
|
|
701 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
702 |
$element->setOptions(['label' => 'LABEL_INDUSTRY']);
|
|
|
703 |
|
|
|
704 |
echo $this->formLabel($element);
|
|
|
705 |
echo $this->formSelect($element);
|
|
|
706 |
?>
|
|
|
707 |
</div>
|
|
|
708 |
<div class="form-group">
|
|
|
709 |
<?php
|
|
|
710 |
$element = $form->get('last_date');
|
|
|
711 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
712 |
$element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
|
|
|
713 |
|
|
|
714 |
echo $this->formLabel($element);
|
|
|
715 |
echo $this->formText($element);
|
|
|
716 |
?>
|
|
|
717 |
</div>
|
|
|
718 |
<div class="form-group">
|
|
|
719 |
<?php
|
|
|
720 |
$element = $form->get('description');
|
|
|
721 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
722 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
723 |
|
|
|
724 |
echo $this->formLabel($element);
|
|
|
725 |
echo $this->formTextArea($element);
|
|
|
726 |
?>
|
|
|
727 |
</div>
|
15461 |
efrain |
728 |
<div class="form-group">
|
15457 |
efrain |
729 |
<?php
|
|
|
730 |
$element = $form->get('status');
|
|
|
731 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
732 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
733 |
echo $this->formLabel($element);
|
15461 |
efrain |
734 |
?>
|
|
|
735 |
<br/>
|
|
|
736 |
<?php
|
|
|
737 |
|
15457 |
efrain |
738 |
echo $this->formCheckbox($element);
|
|
|
739 |
?>
|
15461 |
efrain |
740 |
|
15457 |
efrain |
741 |
</div>
|
|
|
742 |
|
|
|
743 |
|
|
|
744 |
|
|
|
745 |
<div class="form-group">
|
15461 |
efrain |
746 |
<button type="submit" class="btn btn-primary btn-form-save-close">LABEL_SAVE</button>
|
16822 |
efrain |
747 |
<button type="button" class="btn btn-light btn-edit-cancel">LABEL_CANCEL</button>
|
15457 |
efrain |
748 |
</div>
|
|
|
749 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
750 |
</div>
|
|
|
751 |
</div>
|
|
|
752 |
<!-- Create/Edit Form-->
|
|
|
753 |
|
|
|
754 |
</section>
|