15443 |
efrain |
1 |
<?php
|
|
|
2 |
$t = strtotime("+3 days");
|
|
|
3 |
$startDate = date('d/m/Y', $t);
|
|
|
4 |
|
|
|
5 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
|
|
6 |
$currentUser = $this->currentUserHelper();
|
|
|
7 |
$roleName = $currentUser->getUserTypeId();
|
|
|
8 |
|
|
|
9 |
$routeDatatable = $this->url('performance-evaluation/evaluations');
|
|
|
10 |
$routeAdd = $this->url('performance-evaluation/evaluations/add');
|
|
|
11 |
|
|
|
12 |
$allowAdd = $acl->isAllowed($roleName, 'performance-evaluation/evaluations/add') ? 1 : 0;
|
|
|
13 |
$allowDelete = $acl->isAllowed($roleName, 'performance-evaluation/evaluations/delete') ? 1 : 0;
|
|
|
14 |
$allowReport = $acl->isAllowed($roleName, 'performance-evaluation/evaluations/report') ? 1 : 0;
|
|
|
15 |
|
16822 |
efrain |
16 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
17 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
15443 |
efrain |
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
16822 |
efrain |
23 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
24 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
25 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
15443 |
efrain |
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'));
|
15443 |
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'));
|
15443 |
efrain |
34 |
|
|
|
35 |
|
16822 |
efrain |
36 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
37 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
38 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
15443 |
efrain |
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'));
|
15443 |
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'));
|
15443 |
efrain |
46 |
|
|
|
47 |
|
16822 |
efrain |
48 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datepicker/css/bootstrap-datepicker.css'));
|
15443 |
efrain |
49 |
|
16822 |
efrain |
50 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
|
|
|
51 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
|
|
|
52 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.min.js'));
|
|
|
53 |
|
15443 |
efrain |
54 |
// JsRender //
|
16822 |
efrain |
55 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
|
15443 |
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'));
|
15443 |
efrain |
59 |
|
|
|
60 |
|
|
|
61 |
|
16822 |
efrain |
62 |
|
|
|
63 |
|
15443 |
efrain |
64 |
$this->inlineScript()->captureStart();
|
|
|
65 |
echo <<<JS
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
jQuery( document ).ready(function( $ ) {
|
|
|
69 |
|
|
|
70 |
var allowAdd = $allowAdd;
|
|
|
71 |
var allowDelete = $allowDelete
|
|
|
72 |
var allowReport = $allowReport
|
|
|
73 |
|
|
|
74 |
$.validator.setDefaults({
|
|
|
75 |
debug: true,
|
|
|
76 |
highlight: function(element) {
|
|
|
77 |
$(element).addClass('is-invalid');
|
|
|
78 |
},
|
|
|
79 |
unhighlight: function(element) {
|
|
|
80 |
$(element).removeClass('is-invalid');
|
|
|
81 |
},
|
|
|
82 |
errorElement: 'span',
|
|
|
83 |
errorClass: 'error invalid-feedback',
|
|
|
84 |
errorPlacement: function(error, element) {
|
|
|
85 |
if(element.parent('.form-group').length) {
|
|
|
86 |
error.insertAfter(element);
|
|
|
87 |
} else if(element.parent('.toggle').length) {
|
|
|
88 |
error.insertAfter(element.parent().parent());
|
|
|
89 |
} else {
|
|
|
90 |
error.insertAfter(element.parent());
|
|
|
91 |
}
|
|
|
92 |
}
|
|
|
93 |
});
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
$.fn.showFormErrorValidator = function(fieldname, errors) {
|
|
|
98 |
var field = $(fieldname);
|
|
|
99 |
if(field) {
|
|
|
100 |
$(field).addClass('form-group-has-error');
|
|
|
101 |
|
|
|
102 |
var error = $('<div id="' + fieldname +'-error" class="form-group-invalid-feedback">' + errors + '</div>');
|
|
|
103 |
if(field.parent('.form-group').length) {
|
|
|
104 |
error.insertAfter(field.parent());
|
|
|
105 |
} else {
|
|
|
106 |
error.insertAfter(field);
|
|
|
107 |
}
|
|
|
108 |
}
|
|
|
109 |
};
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
var validator = $('#form').validate({
|
|
|
113 |
debug: true,
|
|
|
114 |
onclick: false,
|
|
|
115 |
onkeyup: false,
|
|
|
116 |
onfocusout: false,
|
|
|
117 |
ignore: [],
|
|
|
118 |
rules: {
|
|
|
119 |
'last_date': {
|
|
|
120 |
required: true,
|
|
|
121 |
},
|
|
|
122 |
'form_id' : {
|
|
|
123 |
required: true,
|
|
|
124 |
},
|
|
|
125 |
'supervisor_id' : {
|
|
|
126 |
required: true,
|
|
|
127 |
},
|
|
|
128 |
'employee_id' : {
|
|
|
129 |
required: true,
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
},
|
|
|
133 |
submitHandler: function(form)
|
|
|
134 |
{
|
|
|
135 |
NProgress.start();
|
|
|
136 |
$.ajax({
|
|
|
137 |
'dataType' : 'json',
|
|
|
138 |
'accept' : 'application/json',
|
|
|
139 |
'method' : 'post',
|
|
|
140 |
'url' : $('#form').attr('action'),
|
|
|
141 |
'data' : $('#form').serialize(),
|
|
|
142 |
}).done(function(response) {
|
|
|
143 |
if(response['success']) {
|
|
|
144 |
$('#row-form').hide();
|
|
|
145 |
$('#row-listing').show();
|
|
|
146 |
$('#row-header').show();
|
|
|
147 |
gridTable.api().ajax.reload(null, false);
|
|
|
148 |
} else {
|
|
|
149 |
validator.resetForm();
|
|
|
150 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
151 |
$.fn.showError(response['data']);
|
|
|
152 |
} else {
|
|
|
153 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
154 |
$.fn.showFormErrorValidator('#form #' + fieldname, errors);
|
|
|
155 |
});
|
|
|
156 |
}
|
|
|
157 |
}
|
|
|
158 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
159 |
$.fn.showError(textStatus);
|
|
|
160 |
}).always(function() {
|
|
|
161 |
NProgress.done();
|
|
|
162 |
});
|
|
|
163 |
return false;
|
|
|
164 |
},
|
|
|
165 |
invalidHandler: function(form, validator) {
|
|
|
166 |
|
|
|
167 |
}
|
|
|
168 |
});
|
|
|
169 |
|
|
|
170 |
var gridTable = $('#gridTable').dataTable( {
|
|
|
171 |
'processing': true,
|
|
|
172 |
'serverSide': true,
|
|
|
173 |
'searching': true,
|
|
|
174 |
'order': [[ 1, 'asc' ]],
|
|
|
175 |
'ordering': true,
|
|
|
176 |
'ordenable' : true,
|
|
|
177 |
'responsive': true,
|
|
|
178 |
'select' : false,
|
|
|
179 |
'paging': true,
|
|
|
180 |
'pagingType': 'simple_numbers',
|
|
|
181 |
'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, 'All'] ],
|
|
|
182 |
|
|
|
183 |
'ajax': {
|
|
|
184 |
'url' : '$routeDatatable',
|
|
|
185 |
'type' : 'get',
|
|
|
186 |
'data': function ( d ) {
|
|
|
187 |
|
|
|
188 |
|
|
|
189 |
},
|
|
|
190 |
'beforeSend': function (request) {
|
|
|
191 |
NProgress.start();
|
|
|
192 |
},
|
|
|
193 |
'dataFilter': function(response) {
|
|
|
194 |
var response = jQuery.parseJSON( response );
|
|
|
195 |
|
|
|
196 |
var json = {};
|
|
|
197 |
json.recordsTotal = 0;
|
|
|
198 |
json.recordsFiltered = 0;
|
|
|
199 |
json.data = [];
|
|
|
200 |
|
|
|
201 |
if(response.success) {
|
|
|
202 |
json.recordsTotal = response.data.total;
|
|
|
203 |
json.recordsFiltered = response.data.total;
|
|
|
204 |
json.data = response.data.items;
|
|
|
205 |
} else {
|
|
|
206 |
$.fn.showError(response.data)
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
return JSON.stringify( json );
|
|
|
210 |
}
|
|
|
211 |
},
|
|
|
212 |
'language' : {
|
|
|
213 |
'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
|
|
|
214 |
'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
|
|
|
215 |
'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
|
|
|
216 |
'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
|
|
|
217 |
'sInfo': 'LABEL_DATATABLE_SINFO',
|
|
|
218 |
'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
|
|
|
219 |
'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
|
|
|
220 |
'sInfoPostFix': '',
|
|
|
221 |
'sSearch': 'LABEL_DATATABLE_SSEARCH',
|
|
|
222 |
'sUrl': '',
|
|
|
223 |
'sInfoThousands': ',',
|
|
|
224 |
'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
|
|
|
225 |
'oPaginate': {
|
|
|
226 |
'sFirst': 'LABEL_DATATABLE_SFIRST',
|
|
|
227 |
'sLast': 'LABEL_DATATABLE_SLAST',
|
|
|
228 |
'sNext': 'LABEL_DATATABLE_SNEXT',
|
|
|
229 |
'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
|
|
|
230 |
},
|
|
|
231 |
'oAria': {
|
|
|
232 |
'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
|
|
|
233 |
'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
|
|
|
234 |
},
|
|
|
235 |
},
|
|
|
236 |
'drawCallback': function( settings ) {
|
|
|
237 |
NProgress.done();
|
16822 |
efrain |
238 |
|
15443 |
efrain |
239 |
|
|
|
240 |
|
|
|
241 |
},
|
|
|
242 |
'aoColumns': [
|
|
|
243 |
{ 'mDataProp': 'last_date' },
|
|
|
244 |
{ 'mDataProp': 'form' },
|
|
|
245 |
{ 'mDataProp': 'supervisor_first_name' },
|
|
|
246 |
{ 'mDataProp': 'employee_last_name' },
|
|
|
247 |
{ 'mDataProp': 'status' },
|
|
|
248 |
{ 'mDataProp': 'actions' },
|
|
|
249 |
],
|
|
|
250 |
'columnDefs': [
|
|
|
251 |
{
|
|
|
252 |
'targets': 0,
|
|
|
253 |
'render' : function ( data, type, row ) {
|
|
|
254 |
var s = data;
|
|
|
255 |
|
|
|
256 |
return s;
|
|
|
257 |
|
|
|
258 |
|
|
|
259 |
}
|
|
|
260 |
},
|
|
|
261 |
{
|
|
|
262 |
'targets': 1,
|
|
|
263 |
'render' : function ( data, type, row ) {
|
|
|
264 |
var s = row['form'];
|
|
|
265 |
|
|
|
266 |
if(allowReport && row['actions']['link_pdf_both']) {
|
|
|
267 |
s = s + '<br><button class="btn btn-default btn-pdf" data-href="' + row['actions']['link_pdf_both'] + '" data-toggle="tooltip" title="LABEL_PDF_BOTH"><i class="fa fa-pdf"></i> LABEL_PDF_BOTH </button> ';
|
|
|
268 |
|
|
|
269 |
}
|
|
|
270 |
return s;
|
|
|
271 |
|
|
|
272 |
}
|
|
|
273 |
},
|
|
|
274 |
{
|
|
|
275 |
'targets': 2,
|
|
|
276 |
'render' : function ( data, type, row ) {
|
|
|
277 |
var s = row['supervisor_first_name'] + ' ' + row['supervisor_last_name'];
|
|
|
278 |
|
|
|
279 |
if(allowReport && row['actions']['link_pdf_supervisor']) {
|
|
|
280 |
s = s + '<br><button class="btn btn-default btn-pdf" data-href="' + row['actions']['link_pdf_supervisor'] + '" data-toggle="tooltip" title="LABEL_PDF_SUPERVISOR"><i class="fa fa-pdf"></i> LABEL_PDF_SUPERVISOR </button> ';
|
|
|
281 |
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
return s;
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
}
|
|
|
288 |
},
|
|
|
289 |
{
|
|
|
290 |
'targets': 3,
|
|
|
291 |
'render' : function ( data, type, row ) {
|
|
|
292 |
var s = row['employee_first_name'] + ' ' + row['employee_last_name'];
|
|
|
293 |
|
|
|
294 |
if(allowReport && row['actions']['link_pdf_employee']) {
|
|
|
295 |
s = s + '<br><button class="btn btn-default btn-pdf" data-href="' + row['actions']['link_pdf_employee'] + '" data-toggle="tooltip" title="LABEL_PDF_EMPLOYEE"><i class="fa fa-pdf"></i> LABEL_PDF_EMPLOYEE </button> ';
|
|
|
296 |
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
return s;
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
}
|
|
|
303 |
},
|
|
|
304 |
{
|
|
|
305 |
'targets': -1,
|
|
|
306 |
'orderable': false,
|
|
|
307 |
'render' : function ( data, type, row ) {
|
|
|
308 |
s = '';
|
|
|
309 |
|
|
|
310 |
|
|
|
311 |
if (allowDelete && data['link_delete']) {
|
|
|
312 |
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> ';
|
|
|
313 |
}
|
|
|
314 |
|
|
|
315 |
|
|
|
316 |
|
|
|
317 |
|
|
|
318 |
return s;
|
|
|
319 |
}
|
|
|
320 |
}
|
|
|
321 |
],
|
|
|
322 |
});
|
|
|
323 |
|
|
|
324 |
$('body').on('click', 'button.btn-pdf', function(e) {
|
|
|
325 |
e.preventDefault();
|
|
|
326 |
var action = $(this).data('href');
|
|
|
327 |
|
|
|
328 |
|
|
|
329 |
NProgress.start();
|
|
|
330 |
$.ajax({
|
|
|
331 |
'dataType' : 'json',
|
|
|
332 |
'method' : 'get',
|
|
|
333 |
'url' : action,
|
|
|
334 |
}).done(function(response) {
|
|
|
335 |
if(response['success']) {
|
|
|
336 |
var anchor = window.document.createElement("a");
|
|
|
337 |
anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
|
|
|
338 |
anchor.download = response['data']['basename'];
|
|
|
339 |
document.body.appendChild(anchor);
|
|
|
340 |
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
|
|
|
341 |
document.body.removeChild(anchor);
|
|
|
342 |
} else {
|
|
|
343 |
$.fn.showError(response['data']);
|
|
|
344 |
}
|
|
|
345 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
346 |
$.fn.showError(textStatus);
|
|
|
347 |
}).always(function() {
|
|
|
348 |
NProgress.done();
|
|
|
349 |
});
|
|
|
350 |
|
|
|
351 |
|
|
|
352 |
|
|
|
353 |
});
|
|
|
354 |
|
|
|
355 |
$('.btn-evaluation-close').on("click", function(e){
|
|
|
356 |
e.preventDefault();
|
|
|
357 |
|
|
|
358 |
$('#row-form').hide();
|
|
|
359 |
$('#row-listing').show();
|
|
|
360 |
$('#row-header').show();
|
|
|
361 |
return false;
|
|
|
362 |
});
|
|
|
363 |
|
|
|
364 |
|
|
|
365 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
366 |
e.preventDefault();
|
|
|
367 |
gridTable.api().ajax.reload(null, false);
|
|
|
368 |
});
|
|
|
369 |
|
|
|
370 |
|
|
|
371 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
372 |
e.preventDefault();
|
|
|
373 |
$('#row').show();
|
|
|
374 |
$('#main').hide();
|
|
|
375 |
});
|
|
|
376 |
|
|
|
377 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
378 |
e.preventDefault();
|
|
|
379 |
|
|
|
380 |
|
|
|
381 |
$('#form').attr('action','$routeAdd');
|
|
|
382 |
|
|
|
383 |
$('#form #last_date').val('$startDate');
|
|
|
384 |
$('#form #form_id').val('').trigger('change');
|
|
|
385 |
$('#form #supervisor_id').val('').trigger('change');
|
|
|
386 |
$('#form #employee_id').val('').trigger('change');
|
|
|
387 |
validator.resetForm();
|
|
|
388 |
|
|
|
389 |
$('#row-listing').hide();
|
|
|
390 |
$('#row-header').hide();
|
|
|
391 |
$('#row-form').show();
|
|
|
392 |
|
|
|
393 |
return false;
|
|
|
394 |
});
|
|
|
395 |
|
16822 |
efrain |
396 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
397 |
e.preventDefault();
|
|
|
398 |
var action = $(this).data('href');
|
15443 |
efrain |
399 |
|
16822 |
efrain |
400 |
|
|
|
401 |
swal.fire({
|
|
|
402 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
403 |
icon: 'question',
|
|
|
404 |
cancelButtonText: 'LABEL_NO',
|
|
|
405 |
showCancelButton: true,
|
|
|
406 |
confirmButtonText: 'LABEL_YES'
|
|
|
407 |
}).then((result) => {
|
|
|
408 |
if (result.isConfirmed) {
|
|
|
409 |
|
|
|
410 |
NProgress.start();
|
|
|
411 |
$.ajax({
|
|
|
412 |
'dataType' : 'json',
|
|
|
413 |
'accept' : 'application/json',
|
|
|
414 |
'method' : 'post',
|
|
|
415 |
'url' : action,
|
|
|
416 |
}).done(function(response) {
|
|
|
417 |
if(response['success']) {
|
|
|
418 |
$.fn.showSuccess(response['data']);
|
|
|
419 |
gridTable.api().ajax.reload(null, false);
|
|
|
420 |
} else {
|
|
|
421 |
$.fn.showError(response['data']);
|
|
|
422 |
}
|
|
|
423 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
424 |
$.fn.showError(textStatus);
|
|
|
425 |
}).always(function() {
|
|
|
426 |
NProgress.done();
|
|
|
427 |
});
|
|
|
428 |
}
|
|
|
429 |
});
|
|
|
430 |
});
|
|
|
431 |
|
|
|
432 |
|
15443 |
efrain |
433 |
$('#form #last_date').datepicker({
|
|
|
434 |
language: 'es',
|
|
|
435 |
format: 'dd/mm/yyyy',
|
|
|
436 |
startDate: '$startDate',
|
|
|
437 |
|
|
|
438 |
});
|
|
|
439 |
|
|
|
440 |
$('#form #form_id').select2({
|
|
|
441 |
theme: 'bootstrap4',
|
|
|
442 |
width: '100%',
|
|
|
443 |
});
|
|
|
444 |
|
|
|
445 |
$('#form #supervisor_id').select2({
|
|
|
446 |
theme: 'bootstrap4',
|
|
|
447 |
width: '100%',
|
|
|
448 |
});
|
|
|
449 |
|
|
|
450 |
$('#form #employee_id').select2({
|
|
|
451 |
theme: 'bootstrap4',
|
|
|
452 |
width: '100%',
|
|
|
453 |
});
|
|
|
454 |
|
|
|
455 |
|
|
|
456 |
|
|
|
457 |
});
|
|
|
458 |
JS;
|
|
|
459 |
$this->inlineScript()->captureEnd();
|
|
|
460 |
?>
|
|
|
461 |
|
|
|
462 |
<!-- Content Header (Page header) -->
|
|
|
463 |
<section id="row-header" class="content-header">
|
|
|
464 |
<div class="container-fluid">
|
|
|
465 |
<div class="row mb-2">
|
|
|
466 |
<div class="col-sm-12">
|
16320 |
stevensc |
467 |
<h1>LABEL_EVALUATION</h1>
|
15443 |
efrain |
468 |
</div>
|
|
|
469 |
</div>
|
|
|
470 |
</div>
|
|
|
471 |
<!-- /.container-fluid -->
|
|
|
472 |
</section>
|
|
|
473 |
<section id="row-listing" class="content">
|
|
|
474 |
<div class="container-fluid" id="row-lists">
|
|
|
475 |
<div class="row">
|
|
|
476 |
<div class="col-12">
|
|
|
477 |
<div class="card">
|
|
|
478 |
<div class="card-body">
|
16845 |
efrain |
479 |
<table id="gridTable" class="table table-bordered">
|
15443 |
efrain |
480 |
<thead>
|
|
|
481 |
<tr>
|
|
|
482 |
<th style="width:15%">LABEL_LAST_DATE</th>
|
|
|
483 |
<th style="width:35%">LABEL_FORM_NAME</th>
|
|
|
484 |
<th style="width:35%">LABEL_SUPERVISOR</th>
|
|
|
485 |
<th style="width:35%">LABEL_EMPLOYEE</th>
|
|
|
486 |
<th style="width:15%">LABEL_STATUS</th>
|
|
|
487 |
<th style="width:15%">LABEL_ACTIONS</th>
|
|
|
488 |
</tr>
|
|
|
489 |
</thead>
|
|
|
490 |
<tbody></tbody>
|
|
|
491 |
</table>
|
|
|
492 |
</div>
|
|
|
493 |
<div class="card-footer clearfix">
|
|
|
494 |
<div style="float:right;">
|
|
|
495 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
|
|
|
496 |
<?php if ($allowAdd) : ?>
|
|
|
497 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
|
|
498 |
<?php endif; ?>
|
|
|
499 |
</div>
|
|
|
500 |
</div>
|
|
|
501 |
</div>
|
|
|
502 |
</div>
|
|
|
503 |
</div>
|
|
|
504 |
</div>
|
16320 |
stevensc |
505 |
</section>
|
|
|
506 |
|
|
|
507 |
|
15443 |
efrain |
508 |
<section id="row-form" class="content" style="display: none">
|
|
|
509 |
<div class="container-fluid" id="row-lists">
|
|
|
510 |
<div class="row">
|
|
|
511 |
<div class="col-12">
|
16320 |
stevensc |
512 |
<?php
|
15443 |
efrain |
513 |
$form = $this->form;
|
|
|
514 |
$form->setAttributes([
|
|
|
515 |
'method' => 'post',
|
|
|
516 |
'name' => 'form',
|
|
|
517 |
'action' => $routeAdd,
|
|
|
518 |
'id' => 'form'
|
|
|
519 |
]);
|
|
|
520 |
$form->prepare();
|
|
|
521 |
echo $this->form()->openTag($form);
|
16320 |
stevensc |
522 |
|
15443 |
efrain |
523 |
?>
|
16320 |
stevensc |
524 |
<div class="card">
|
|
|
525 |
<div class="card-header">
|
|
|
526 |
<h3>LABEL_NEW_EVALUATION</h3>
|
|
|
527 |
</div>
|
15443 |
efrain |
528 |
<div class="card-body">
|
|
|
529 |
<div class="form-group">
|
|
|
530 |
<?php
|
|
|
531 |
$element = $form->get('last_date');
|
|
|
532 |
$element->setOptions(['label' => 'LABEL_LAST_DATE']);
|
|
|
533 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
534 |
echo $this->formLabel($element);
|
|
|
535 |
echo $this->formText($element);
|
|
|
536 |
?>
|
|
|
537 |
</div>
|
|
|
538 |
<div class="form-group">
|
|
|
539 |
<?php
|
|
|
540 |
$element = $form->get('form_id');
|
|
|
541 |
$element->setOptions(['label' => 'LABEL_FORM_NAME']);
|
|
|
542 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
543 |
echo $this->formLabel($element);
|
|
|
544 |
echo $this->formSelect($element);
|
|
|
545 |
?>
|
|
|
546 |
</div>
|
|
|
547 |
<div class="form-group">
|
|
|
548 |
<?php
|
|
|
549 |
$element = $form->get('supervisor_id');
|
|
|
550 |
$element->setOptions(['label' => 'LABEL_SUPERVISOR']);
|
|
|
551 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
552 |
echo $this->formLabel($element);
|
|
|
553 |
echo $this->formSelect($element);
|
|
|
554 |
?>
|
|
|
555 |
</div>
|
16320 |
stevensc |
556 |
<div class="form-group">
|
15443 |
efrain |
557 |
<?php
|
|
|
558 |
$element = $form->get('employee_id');
|
|
|
559 |
$element->setOptions(['label' => 'LABEL_EMPLOYEE']);
|
|
|
560 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
561 |
echo $this->formLabel($element);
|
|
|
562 |
echo $this->formSelect($element);
|
|
|
563 |
?>
|
|
|
564 |
</div>
|
|
|
565 |
</div>
|
|
|
566 |
|
16320 |
stevensc |
567 |
|
15443 |
efrain |
568 |
<div class="card-footer">
|
|
|
569 |
<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
|
|
|
570 |
<button type="button" class="btn btn-default btn-evaluation-close">LABEL_CANCEL</button>
|
|
|
571 |
</div>
|
|
|
572 |
<?php echo $this->form()->closeTag($form); ?>
|
16320 |
stevensc |
573 |
</div>
|
15443 |
efrain |
574 |
</div>
|
|
|
575 |
</div>
|
|
|
576 |
</div>
|
16320 |
stevensc |
577 |
</section>
|