Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15461 | Rev 15464 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
15461 efrain 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
$routeDatatable     = $this->url('recruitment-and-selection/applications');
8
$routeUserByEmail   = $this->url('recruitment-and-selection/applications/user-by-email');
9
 
10
$allowAdd           = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/add') ? 1 : 0;
11
$allowDelete        = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/delete') ? 1 : 0;
12
$allowView          = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/view') ? 1 : 0;
13
$allowUserByEmail   = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/user-by-email') ? 1 : 0;
14
$allowLevel         = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/level') ? 1 : 0;
15
$allowStatus        = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/status') ? 1 : 0;
16
$allowComment       = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/comment') ? 1 : 0;
17
 
18
$allowFileAdd       = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/files/add') ? 1 : 0;
19
$allowInterviewAdd  = $acl->isAllowed($roleName, 'recruitment-and-selection/applications/interviews/add') ? 1 : 0;
20
 
21
 
22
 
23
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
25
 
26
 
27
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
30
 
31
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
32
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
33
 
34
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
37
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
38
 
39
 
40
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
41
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fa/theme.css'));
42
 
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
44
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
45
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fa/theme.js'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fa/theme.js'));
49
 
50
 
51
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
52
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
53
 
54
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
55
 
56
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
57
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
58
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
59
 
60
 
61
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
62
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
63
 
64
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
65
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
66
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
67
 
68
// bootbox Alert //
69
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
70
 
71
// JsRender //
72
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
73
 
74
 
75
$this->inlineScript()->captureStart();
76
echo <<<JS
77
jQuery(document).ready(function($) {
78
 
79
    var allowDelete   = $allowDelete  ;
80
    var allowView   = $allowView  ;
81
 
82
    $.validator.setDefaults({
83
            debug: true,
84
            highlight: function(element) {
85
                $(element).addClass('is-invalid');
86
            },
87
            unhighlight: function(element) {
88
                $(element).removeClass('is-invalid');
89
            },
90
            errorElement: 'span',
91
            errorClass: 'error invalid-feedback',
92
            errorPlacement: function(error, element) {
93
                if(element.parent('.form-group').length) {
94
                    error.insertAfter(element);
95
                } else if(element.parent('.toggle').length) {
96
                    error.insertAfter(element.parent().parent());
97
                } else {
98
                    error.insertAfter(element.parent());
99
                }
100
            }
101
        });
102
 
103
 
104
        $.fn.showFormErrorValidator = function(fieldname, errors) {
105
            var field = $(fieldname);
106
            if(field) {
107
                $(field).addClass('is-invalid');
108
 
109
 
110
                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
111
                if(field.parent('.form-group').length) {
112
                    error.insertAfter(field);
113
                } else  if(field.parent('.toggle').length) {
114
                    error.insertAfter(field.parent().parent());
115
                } else {
116
                    error.insertAfter(field.parent());
117
                }
118
            }
119
        };
120
 
121
 
122
 
123
 
124
    var gridTable = $('#gridTable').dataTable({
125
        'processing': true,
126
        'serverSide': true,
127
        'searching': true,
128
        'order': [
129
            [0, 'asc']
130
        ],
131
        'ordering': true,
132
        'ordenable': true,
133
        'responsive': true,
134
        'select': false,
135
        'paging': true,
136
        'pagingType': 'simple_numbers',
137
        'ajax': {
138
            'url': '$routeDatatable',
139
            'type': 'get',
140
            'data': function(d) {
141
                d.vacancy_id = $('#form-filter #vacancy_id').val();
142
            },
143
            'beforeSend': function(request) {
144
                NProgress.start();
145
            },
146
            'dataFilter': function(response) {
147
                var response = jQuery.parseJSON(response);
148
                var json = {};
149
                json.recordsTotal = 0;
150
                json.recordsFiltered = 0;
151
                json.data = [];
152
                if (response.success) {
153
 
154
 
155
                    $('#form-add').attr('action', response.data.link_add);
156
                    if(response.data.link_add.length == 0) {
157
                        $('btn.btn-add').hide();
158
                    } else {
159
                        $('btn.btn-add').show();
160
                    }
161
 
162
 
163
                    json.recordsTotal = response.data.total;
164
                    json.recordsFiltered = response.data.total;
165
                    json.data = response.data.items;
166
                } else {
167
                    $('btn.btn-add').hide();
168
                    $.fn.showError(response.data)
169
                }
170
                return JSON.stringify(json);
171
            }
172
        },
173
        'language': {
174
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
175
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
176
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
177
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
178
            'sInfo': 'LABEL_DATATABLE_SINFO',
179
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
180
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
181
            'sInfoPostFix': '',
182
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
183
            'sUrl': '',
184
            'sInfoThousands': ',',
185
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
186
            'oPaginate': {
187
                'sFirst': 'LABEL_DATATABLE_SFIRST',
188
                'sLast': 'LABEL_DATATABLE_SLAST',
189
                'sNext': 'LABEL_DATATABLE_SNEXT',
190
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
191
            },
192
            'oAria': {
193
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
194
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
195
            },
196
        },
197
        'drawCallback': function(settings) {
198
            NProgress.done();
199
            $('button.btn-delete').confirmation({
200
                rootSelector: 'button.btn-delete',
201
                title: 'LABEL_ARE_YOU_SURE',
202
                singleton: true,
203
                btnOkLabel: 'LABEL_YES',
204
                btnCancelLabel: 'LABEL_NO',
205
                onConfirm: function(value) {
206
                    action = $(this).data('href');
207
                    NProgress.start();
208
                    $.ajax({
209
                        'dataType': 'json',
210
                        'accept': 'application/json',
211
                        'method': 'post',
212
                        'url': action,
213
                    }).done(function(response) {
214
                        if (response['success']) {
215
                            $.fn.showSuccess(response['data']);
216
                            gridTable.api().ajax.reload(null, false);
217
                        } else {
218
                            $.fn.showError(response['data']);
219
                        }
220
                    }).fail(function(jqXHR, textStatus, errorThrown) {
221
                        $.fn.showError(textStatus);
222
                    }).always(function() {
223
                        NProgress.done();
224
                    });
225
                },
226
            });
227
        },
228
         'aoColumns': [
229
                { 'mDataProp': 'first_name' },
230
                { 'mDataProp': 'last_name' },
231
                { 'mDataProp': 'email' },
232
                { 'mDataProp': 'status' },
233
                { 'mDataProp': 'level' },
234
                { 'mDataProp': 'actions' },
235
            ],
236
        'columnDefs': [
237
            {
238
                'targets': -1,
239
                'orderable': false,
240
                'render': function(data, type, row) {
241
                    s = '';
242
                    if (allowView) {
243
                        s = s + '<button class="btn btn-default btn-view" data-href="' + data['link_view'] + '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link"></i> LABEL_VIEW </button>&nbsp;';
244
                    }
245
                    if (allowDelete) {
246
                        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>&nbsp;';
247
                    }
248
 
249
                    return s;
250
                }
251
            }
252
        ],
253
    });
254
 
255
    var validatorAdd = $('#form-add').validate({
256
            debug: true,
257
            onclick: false,
258
            onkeyup: false,
259
            ignore: [],
260
            rules: {
261
                'email': {
262
                    required: true,
263
                    maxlength: 250,
264
                    email: true,
265
                },
266
                'first_name': {
267
                    required: true,
268
                    maxlength: 128,
269
                },
270
                'last_name': {
271
                    required: true,
272
                    maxlength: 128,
273
                },
274
            },
275
            submitHandler: function(form)
276
            {
277
               $.ajax({
278
                    'dataType'  : 'json',
279
                    'accept'    : 'application/json',
280
                    'method'    : 'post',
281
                    'url'       :  $('#form-add').attr('action'),
282
                    'data'      :  $('#form-add').serialize()
283
                }).done(function(response) {
284
                    NProgress.start();
285
                    if(response['success']) {
286
                        $.fn.showSuccess(response['data']);
287
 
288
                        $('#modal-add-application').modal('hide');
289
 
290
 
291
                        gridTable.api().ajax.reload(null, false);
292
                    } else {
293
                        validatorAdd.resetForm();
294
                        if(jQuery.type(response['data']) == 'string') {
295
                            $.fn.showError(response['data']);
296
                        } else  {
297
                            $.each(response['data'], function( fieldname, errors ) {
298
                                $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
299
                            });
300
                        }
301
                    }
302
                }).fail(function( jqXHR, textStatus, errorThrown) {
303
                    $.fn.showError(textStatus);
304
                }).always(function() {
305
                    NProgress.done();
306
 
307
                });
308
                return false;
309
 
310
            },
311
            invalidHandler: function(form, validator) {
312
 
313
                return false;
314
            }
315
        });
316
 
317
 
318
 
319
 
320
    var validatorFile = $('#form-file').validate({
321
            debug: true,
322
            onclick: false,
323
            onkeyup: false,
324
            ignore: [],
325
            rules: {
326
 
327
                'name': {
328
                    required: true,
329
                    maxlength: 128,
330
                },
331
                'file': {
332
                    required: true,
333
                    extension: 'pdf|doc|docx',
334
 
335
                },
336
            },
337
            submitHandler: function(form)
338
            {
339
                var formdata = false;
340
                if (window.FormData){
341
                    formdata = new FormData(form); //form[0]);
342
                }
343
 
344
 
345
               $.ajax({
346
                    'dataType'  : 'json',
347
                    'accept'    : 'application/json',
348
                    'method'    : 'post',
349
                    'url'       :  $('#form-file').attr('action'),
350
                    'data'      :  formdata ? formdata : $('#form-file').serialize(),
351
                    'processData' : false,
352
                    'contentType' : false,
353
                }).done(function(response) {
354
                    NProgress.start();
355
                    if(response['success']) {
356
                        $.fn.showSuccess(response['data']['message']);
357
                        $('#fileTable tbody').html(
358
                            $('#fileTemplate').render( response['data']['files'] )
359
                        );
360
 
361
                        $('#modal-add-file').modal('hide');
362
 
363
 
364
                    } else {
365
                        validatorFile.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-file #' + 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
            },
383
            invalidHandler: function(form, validator) {
384
 
385
                return false;
386
            }
387
        });
388
 
389
       var validatorStatus = $('#form-status').validate({
390
            debug: true,
391
            onclick: false,
392
            onkeyup: false,
393
            ignore: [],
394
            rules: {
395
                'status': {
396
                    required: true,
397
                },
398
            },
399
            submitHandler: function(form)
400
            {
401
 
402
               $.ajax({
403
                    'dataType'  : 'json',
404
                    'accept'    : 'application/json',
405
                    'method'    : 'post',
406
                    'url'       :  $('#form-status').attr('action'),
407
                    'data'      :  $('#form-status').serialize(),
408
 
409
                }).done(function(response) {
410
                    NProgress.start();
411
                    if(response['success']) {
412
                        $.fn.showSuccess(response['data']['message']);
413
 
414
                        $('#view_application_status').html(response['data']['status']);
415
                        $('#modal-status').modal('hide');
416
 
417
 
418
                    } else {
419
                        validatorFile.resetForm();
420
                        if(jQuery.type(response['data']) == 'string') {
421
                            $.fn.showError(response['data']);
422
                        } else  {
423
                            $.each(response['data'], function( fieldname, errors ) {
424
                                $.fn.showFormErrorValidator('#form-status #' + fieldname, errors);
425
                            });
426
                        }
427
                    }
428
                }).fail(function( jqXHR, textStatus, errorThrown) {
429
                    $.fn.showError(textStatus);
430
                }).always(function() {
431
                    NProgress.done();
432
 
433
                });
434
                return false;
435
 
436
            },
437
            invalidHandler: function(form, validator) {
438
 
439
                return false;
440
            }
441
        });
442
 
443
       var validatorLevel = $('#form-level').validate({
444
            debug: true,
445
            onclick: false,
446
            onkeyup: false,
447
            ignore: [],
448
            rules: {
449
                'level': {
450
                    required: true,
451
                },
452
            },
453
            submitHandler: function(form)
454
            {
455
 
456
               $.ajax({
457
                    'dataType'  : 'json',
458
                    'accept'    : 'application/json',
459
                    'method'    : 'post',
460
                    'url'       :  $('#form-level').attr('action'),
461
                    'data'      :  $('#form-level').serialize(),
462
 
463
                }).done(function(response) {
464
                    NProgress.start();
465
                    if(response['success']) {
466
                        $.fn.showSuccess(response['data']['message']);
467
 
468
                        $('#view_application_level').html(response['data']['level']);
469
                        $('#modal-level').modal('hide');
470
 
471
 
472
                    } else {
473
                        validatorFile.resetForm();
474
                        if(jQuery.type(response['data']) == 'string') {
475
                            $.fn.showError(response['data']);
476
                        } else  {
477
                            $.each(response['data'], function( fieldname, errors ) {
478
                                $.fn.showFormErrorValidator('#form-level #' + fieldname, errors);
479
                            });
480
                        }
481
                    }
482
                }).fail(function( jqXHR, textStatus, errorThrown) {
483
                    $.fn.showError(textStatus);
484
                }).always(function() {
485
                    NProgress.done();
486
 
487
                });
488
                return false;
489
 
490
            },
491
            invalidHandler: function(form, validator) {
492
 
493
                return false;
494
            }
495
        });
496
 
497
       var validatorComment = $('#form-comment').validate({
498
            debug: true,
499
            onclick: false,
500
            onkeyup: false,
501
            ignore: [],
502
            rules: {
503
                'points': {
504
                    required: true,
505
                    min: 0,
506
                    max: 100,
507
                },
508
                'comment': {
509
                    updateCkeditor:function() {
510
                            CKEDITOR.instances.comment.updateElement();
511
                    },
512
                    required: false,
513
                },
514
 
515
            },
516
            submitHandler: function(form)
517
            {
518
 
519
               $.ajax({
520
                    'dataType'  : 'json',
521
                    'accept'    : 'application/json',
522
                    'method'    : 'post',
523
                    'url'       :  $('#form-comment').attr('action'),
524
                    'data'      :  $('#form-comment').serialize(),
525
 
526
                }).done(function(response) {
527
                    NProgress.start();
528
                    if(response['success']) {
529
                        $.fn.showSuccess(response['data']['message']);
530
 
531
 
532
                        $('#view_application_points').html(response['data']['points']);
533
                        $('#view_application_comment').html(response['data']['comment']);
534
 
535
                        $('#modal-comment').modal('hide');
536
 
537
 
538
                    } else {
539
                        validatorFile.resetForm();
540
                        if(jQuery.type(response['data']) == 'string') {
541
                            $.fn.showError(response['data']);
542
                        } else  {
543
                            $.each(response['data'], function( fieldname, errors ) {
544
                                $.fn.showFormErrorValidator('#form-comment #' + fieldname, errors);
545
                            });
546
                        }
547
                    }
548
                }).fail(function( jqXHR, textStatus, errorThrown) {
549
                    $.fn.showError(textStatus);
550
                }).always(function() {
551
                    NProgress.done();
552
 
553
                });
554
                return false;
555
 
556
            },
557
            invalidHandler: function(form, validator) {
558
 
559
                return false;
560
            }
561
        });
562
 
563
    var validatorInterview = $('#form-interview').validate({
564
            debug: true,
565
            onclick: false,
566
            onkeyup: false,
567
            ignore: [],
568
            rules: {
569
                'user_id': {
570
                    required: true,
571
                },
572
                'type': {
573
                    required: true,
574
                },
575
                'last_date': {
576
                    required: true,
577
                },
578
 
579
 
580
            },
581
            submitHandler: function(form)
582
            {
583
 
584
               $.ajax({
585
                    'dataType'  : 'json',
586
                    'accept'    : 'application/json',
587
                    'method'    : 'post',
588
                    'url'       :  $('#form-interview').attr('action'),
589
                    'data'      :  $('#form-interview').serialize(),
590
 
591
                }).done(function(response) {
592
                    NProgress.start();
593
                    if(response['success']) {
594
                        $.fn.showSuccess(response['data']['message']);
595
 
596
                        $('#interviewTable tbody').html(
597
                            $('#interviewTemplate').render( response['data']['interviews'] )
598
                        );
599
 
600
 
601
                        $('#modal-interview').modal('hide');
602
 
603
 
604
                    } else {
605
                        validatorInterview.resetForm();
606
                        if(jQuery.type(response['data']) == 'string') {
607
                            $.fn.showError(response['data']);
608
                        } else  {
609
                            $.each(response['data'], function( fieldname, errors ) {
610
                                $.fn.showFormErrorValidator('#form-interview #' + fieldname, errors);
611
                            });
612
                        }
613
                    }
614
                }).fail(function( jqXHR, textStatus, errorThrown) {
615
                    $.fn.showError(textStatus);
616
                }).always(function() {
617
                    NProgress.done();
618
 
619
                });
620
                return false;
621
 
622
            },
623
            invalidHandler: function(form, validator) {
624
 
625
                return false;
626
            }
627
        });
628
 
629
 
630
 
631
    $('body').on('click', 'button.btn-refresh', function (e) {
632
        e.preventDefault();
633
        gridTable.api().ajax.reload(null, false);
634
 
635
    });
636
 
637
 
638
 
639
 
640
 
641
    $('body').on('click', 'button.btn-search-email', function(e) {
642
        e.preventDefault();
643
        NProgress.start();
644
 
645
 
646
        $.ajax({
647
            'dataType'  : 'json',
648
            'accept'    : 'application/json',
649
            'method'    : 'get',
650
            'url'       : '$routeUserByEmail',
651
            'data'      : {
652
                email:  $('#form-add #email').val()
653
            }
654
        }).done(function(response) {
655
 
656
            NProgress.done();
657
            if(response['success']) {
658
 
659
                $('#form-add #user_id').val(response['data']['uuid']);
660
                $('#form-add #first_name').val(response['data']['first_name']);
661
                $('#form-add #last_name').val(response['data']['last_name']);
662
 
663
 
664
            } else {
665
                $('#form-add #user_id').val('');
666
                $('#form-add #first_name').val('');
667
                $('#form-add #last_name').val('');
668
 
669
                $.fn.showError(response['data']);
670
            }
671
        }).fail(function( jqXHR, textStatus, errorThrown) {
672
        $.fn.showError(textStatus);
673
        }).always(function() {
674
            NProgress.done();
675
        });
676
        return false;
677
    });
678
 
679
 
680
 
681
 
682
 
683
 
684
 
685
    $('body').on('click', 'button.btn-add', function (e) {
686
        e.preventDefault();
687
 
688
        $('#form-add #user_id').val('');
689
        $('#form-add #email').val('');
690
        $('#form-add #first_name').val('');
691
        $('#form-add #last_name').val('');
692
        validatorAdd.resetForm();
693
 
694
        $('#modal-add-application').modal('show');
695
 
696
 
697
 
698
 
699
 
700
    });
701
 
702
    $('body').on('click', 'button.btn-cancel-modal-interview', function(e) {
703
        e.preventDefault();
704
 
705
 
706
        $('#modal-interview').modal('hide');
707
 
708
    });
709
 
710
 
711
    $('body').on('click', 'button.btn-cancel-modal-application', function(e) {
712
        e.preventDefault();
713
 
714
 
715
        $('#modal-add-application').modal('hide');
716
 
717
    });
718
 
719
 
720
    $('body').on('click', 'button.btn-close-application', function(e) {
721
        e.preventDefault();
722
 
723
        $('#row-view').hide();
724
        $('#row-list').show();
725
    });
726
 
727
    $('body').on('click', 'button.btn-view', function(e) {
728
        e.preventDefault();
729
         NProgress.start();
730
 
731
 
732
        $.ajax({
733
            'dataType'  : 'json',
734
            'accept'    : 'application/json',
735
            'method'    : 'get',
736
            'url'       : $(this).data('href'),
737
        }).done(function(response) {
738
           NProgress.done();
739
 
740
            $('#row-list').hide();
741
 
742
            $('#view_title_name').html(response['data']['vacancy']['name']);
743
            $('#view_title_last_date').html(response['data']['vacancy']['last_date']);
744
 
745
 
746
            $('#view_vacancy_name').html(response['data']['vacancy']['name']);
747
            $('#view_vacancy_last_date').html(response['data']['vacancy']['last_date']);
748
            $('#view_vacancy_job_description').html(response['data']['vacancy']['job_description']);
749
            $('#view_vacancy_industry').html(response['data']['vacancy']['industry']);
750
            $('#view_vacancy_job_category').html(response['data']['vacancy']['job_category']);
751
 
752
            $('#view_candidate_first_name').html(response['data']['application']['first_name']);
753
            $('#view_candidate_last_name').html(response['data']['application']['last_name']);
754
            $('#view_vacancy_email').html(response['data']['application']['email']);
755
 
756
            $('#view_application_level').html(response['data']['application']['level']);
757
            $('#view_application_status').html(response['data']['application']['status']);
758
            $('#view_application_points').html(response['data']['application']['points']);
759
            $('#view_application_comment').html(response['data']['application']['comment']);
760
 
761
 
762
            $('#form-level').attr('action', response['data']['link_level']);
763
            $('#form-status').attr('action', response['data']['link_status']);
764
            $('#form-comment').attr('action', response['data']['link_comment']);
765
 
766
 
767
            $('#form-file').attr('action', response['data']['link_files_add']);
768
            $('#fileTable').data('route', response['data']['link_files']);
769
 
770
 
771
            $('#form-interview').attr('action', response['data']['link_interviews_add']);
772
            $('#interviewTable').data('route', response['data']['link_interviews']);
773
 
774
 
775
            $('#fileTable tbody').html(
776
               $('#fileTemplate').render( response['data']['files'] )
777
            );
778
 
779
            $('#interviewTable tbody').html(
780
               $('#interviewTemplate').render( response['data']['interviews'] )
781
            );
782
 
783
 
784
 
785
            $('#row-view').show();
786
 
787
 
788
        }).fail(function( jqXHR, textStatus, errorThrown) {
789
            $.fn.showError(textStatus);
790
        }).always(function() {
791
            NProgress.done();
792
        });
793
        return false;
794
    });
795
 
796
    $('body').on('click', 'button.btn-delete-file', function(e) {
797
        e.preventDefault();
798
        var action = $(this).data('href');
799
 
800
        $.ajax({
801
            'dataType': 'json',
802
            'accept': 'application/json',
803
            'method': 'post',
804
            'url': action,
805
        }).done(function(response) {
806
            if (response['success']) {
807
                $.fn.showSuccess(response['data']['message']);
808
                $('#fileTable tbody').html(
809
                    $('#fileTemplate').render( response['data']['files'] )
810
                );
811
            } else {
812
                $.fn.showError(response['data']);
813
            }
814
        }).fail(function(jqXHR, textStatus, errorThrown) {
815
            $.fn.showError(textStatus);
816
        }).always(function() {
817
            NProgress.done();
818
        });
819
 
820
    });
821
 
822
 
823
    $('body').on('click', 'button.btn-delete-interview', function(e) {
824
        e.preventDefault();
825
        var action = $(this).data('href');
826
 
827
        $.ajax({
828
            'dataType': 'json',
829
            'accept': 'application/json',
830
            'method': 'post',
831
            'url': action,
832
        }).done(function(response) {
833
            if (response['success']) {
834
                $.fn.showSuccess(response['data']['message']);
835
                $('#interviewTable tbody').html(
15462 efrain 836
                    $('#interviewTemplate').render( response['data']['interviews'] )
15461 efrain 837
                );
838
            } else {
839
                $.fn.showError(response['data']);
840
            }
841
        }).fail(function(jqXHR, textStatus, errorThrown) {
842
            $.fn.showError(textStatus);
843
        }).always(function() {
844
            NProgress.done();
845
        });
846
 
847
    });
848
 
849
    $('body').on('click', 'button.btn-edit-interview', function(e) {
850
        e.preventDefault();
851
        var action = $(this).data('href');
852
 
853
        $.ajax({
854
            'dataType': 'json',
855
            'accept': 'application/json',
856
            'method': 'get',
857
            'url': action,
858
        }).done(function(response) {
859
            if (response['success']) {
860
 
861
                $('#form-interview').attr('action',action);
862
                $('#form-interview #user_id').val(response['data']['user_id']).trigger('change');
863
                $('#form-interview #type').val(response['data']['type']).trigger('change');
864
                $('#form-interview #last_date').val(response['data']['last_date']);
865
 
866
                $('#modal-interview').modal('show');
867
 
868
 
869
            } else {
870
                $.fn.showError(response['data']);
871
            }
872
        }).fail(function(jqXHR, textStatus, errorThrown) {
873
            $.fn.showError(textStatus);
874
        }).always(function() {
875
            NProgress.done();
876
        });
877
 
878
    });
879
 
880
 
881
    $('body').on('click', 'button.btn-add-interview', function(e) {
882
        e.preventDefault();
883
        var action = $(this).data('href');
884
 
885
        $('#form-interview').attr('action',action);
886
        $('#form-interview #user_id').val('').trigger('change');
887
        $('#form-interview #type').val('').trigger('change');
888
        $('#form-interview #last_date').val('');
889
        $('#modal-interview').modal('show');
890
 
891
 
892
    });
893
 
894
 
895
 
896
    $('body').on('click', 'button.btn-change-level', function(e) {
897
        e.preventDefault();
898
        var action = $('#form-level').attr('action');
899
 
900
        $.ajax({
901
            'dataType': 'json',
902
            'accept': 'application/json',
903
            'method': 'get',
904
            'url': action,
905
        }).done(function(response) {
906
            if (response['success']) {
907
 
908
                $('#form-level #level').val(response['data']['level']).trigger('change');
909
                $('#modal-level').modal('show');
910
 
911
 
912
            } else {
913
                $.fn.showError(response['data']);
914
            }
915
        }).fail(function(jqXHR, textStatus, errorThrown) {
916
            $.fn.showError(textStatus);
917
        }).always(function() {
918
            NProgress.done();
919
        });
920
 
921
    });
922
 
923
 
924
    $('body').on('click', 'button.btn-change-status', function(e) {
925
        e.preventDefault();
926
        var action = $('#form-status').attr('action');
927
 
928
        $.ajax({
929
            'dataType': 'json',
930
            'accept': 'application/json',
931
            'method': 'get',
932
            'url': action,
933
        }).done(function(response) {
934
            if (response['success']) {
935
 
936
                $('#form-status #status').val(response['data']['status']).trigger('change');
937
                $('#modal-status').modal('show');
938
 
939
 
940
            } else {
941
                $.fn.showError(response['data']);
942
            }
943
        }).fail(function(jqXHR, textStatus, errorThrown) {
944
            $.fn.showError(textStatus);
945
        }).always(function() {
946
            NProgress.done();
947
        });
948
 
949
    });
950
 
951
 
952
    $('body').on('click', 'button.btn-change-comment', function(e) {
953
        e.preventDefault();
954
        var action = $('#form-comment').attr('action');
955
 
956
        $.ajax({
957
            'dataType': 'json',
958
            'accept': 'application/json',
959
            'method': 'get',
960
            'url': action,
961
        }).done(function(response) {
962
            if (response['success']) {
963
 
964
 
965
                CKEDITOR.instances.comment.setData(response['data']['comment']);
966
                $('#form-comment #points').val(response['data']['points']);
967
                $('#modal-comment').modal('show');
968
 
969
 
970
            } else {
971
                $.fn.showError(response['data']);
972
            }
973
        }).fail(function(jqXHR, textStatus, errorThrown) {
974
            $.fn.showError(textStatus);
975
        }).always(function() {
976
            NProgress.done();
977
        });
978
 
979
    });
980
 
981
 
982
    $('#form-file #file').fileinput({
983
        theme: 'fa',
984
        language: 'es',
985
        showUpload: false,
986
        dropZoneEnabled: false,
987
        maxFileCount: 1,
988
        allowedFileExtensions: ['pdf','doc','docx'],
989
        msgPlaceholder: '',
990
    });
991
 
992
 
993
    $('body').on('click', 'button.btn-add-file', function(e) {
994
        e.preventDefault();
995
 
996
 
997
        $('#form-file #name').val('');
998
        $('#form-file #file').fileinput('reset');
999
        $('#form-file #file').val('');
1000
 
1001
 
1002
        validatorFile.resetForm();
1003
        $('#modal-add-file').modal('show');
1004
    });
1005
 
1006
    $('body').on('click', 'button.btn-cancel-modal-file', function(e) {
1007
        e.preventDefault();
1008
 
1009
 
1010
         $('#modal-add-file').modal('hide');
1011
    });
1012
 
1013
    $('body').on('click', 'button.btn-cancel-modal-comment', function(e) {
1014
        e.preventDefault();
1015
 
1016
 
1017
         $('#modal-comment').modal('hide');
1018
    });
1019
 
1020
    $('body').on('click', 'button.btn-cancel-modal-level', function(e) {
1021
        e.preventDefault();
1022
 
1023
 
1024
         $('#modal-level').modal('hide');
1025
    });
1026
 
1027
    $('body').on('click', 'button.btn-cancel-modal-status', function(e) {
1028
        e.preventDefault();
1029
 
1030
 
1031
         $('#modal-status').modal('hide');
1032
    });
1033
 
1034
 
1035
 
1036
    $('body').on('click', 'button.btn-report-interview', function(e) {
1037
        e.preventDefault();
1038
        var action   = $(this).data('href');
1039
 
1040
 
1041
        NProgress.start();
1042
        $.ajax({
1043
            'dataType'  : 'json',
1044
            'method'    : 'get',
1045
            'url'       :  action,
1046
        }).done(function(response) {
1047
            if(response['success']) {
1048
                var anchor = window.document.createElement("a");
1049
                anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
1050
                anchor.download = response['data']['basename'];
1051
                document.body.appendChild(anchor);
1052
                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
1053
                document.body.removeChild(anchor);
1054
            } else {
1055
                $.fn.showError(response['data']);
1056
            }
1057
        }).fail(function( jqXHR, textStatus, errorThrown) {
1058
            $.fn.showError(textStatus);
1059
        }).always(function() {
1060
            NProgress.done();
1061
        });
1062
    });
1063
 
1064
    $('#form-level #level').select2({
1065
        theme: 'bootstrap4',
1066
        width: '100%',
1067
    });
1068
 
1069
    $('#form-status #status').select2({
1070
        theme: 'bootstrap4',
1071
        width: '100%',
1072
    });
1073
 
1074
 
1075
    $('#form-interview #type').select2({
1076
        theme: 'bootstrap4',
1077
        width: '100%',
1078
    });
1079
 
1080
 
1081
    $('#form-interview #user_id').select2({
1082
        theme: 'bootstrap4',
1083
        width: '100%',
1084
    });
1085
 
1086
    $('#form-interview #last_date').datetimepicker({
1087
        locale: 'es',
1088
        format: 'DD/MM/YYYY'
1089
    });
1090
 
1091
 
1092
 
1093
    $('#form-comment #points').inputNumberFormat({decimal: 0});
1094
 
1095
 
1096
    CKEDITOR.replace('comment');
1097
 
1098
 
1099
  });
1100
JS;
1101
 
1102
$this->inlineScript()->captureEnd();
1103
 
1104
?>
1105
<!-- Content Header (Page header) -->
1106
 
1107
 
1108
<section class="content-header">
1109
   <div class="container-fluid">
1110
      <div class="row mb-2">
1111
         <div class="col-sm-12">
1112
            <h1 id="section-title">LABEL_APPLICATIONS</h1>
1113
         </div>
1114
      </div>
1115
   </div>
1116
   <!-- /.container-fluid -->
1117
</section>
1118
<section class="content">
1119
    <div class="container-fluid">
1120
    	<div class="row" id="row-view" style="display: none">
1121
 
1122
    	<div class="col-12">
1123
 
1124
            <!-- Main content -->
1125
            <div class="invoice p-3 mb-3">
1126
              <!-- title row -->
1127
              <div class="row">
1128
                <div class="col-12">
1129
                  <h4>
1130
                    <span id="view_title_name"></span>
1131
                    <small class="float-right">LABEL_LAST_DATE: <span id="view_title_last_date"></span></small>
1132
                  </h4>
1133
                </div>
1134
                <!-- /.col -->
1135
              </div>
1136
              <!-- info row -->
1137
              <div class="row invoice-info">
1138
                <div class="col-sm-6 invoice-col">
1139
                  <strong>LABEL_VACANCY</strong>
1140
                  <address>
1141
                    <span id="view_vacancy_name"></span><br>
1142
                    LABEL_LAST_DATE : <span id="view_vacancy_last_date"></span><br>
1143
                    LABEL_JOB_DESCRIPTION : <span id="view_vacancy_job_description"></span><br>
1144
                    LABEL_INDUSTRY : <span id="view_vacancy_industry"></span><br>
1145
                    LABEL_JOB_CATEGORY : <span id="view_vacancy_job_category"></span>
1146
            	</address>
1147
                </div>
1148
                <!-- /.col -->
1149
                <div class="col-sm-3 invoice-col">
1150
                  <strong>LABEL_CANDIDATE</strong>
1151
                  <address>
1152
                    LABEL_FIRST_NAME : <strong id="view_candidate_first_name"></strong><br>
1153
                    LABEL_LAST_NAME : <strong id="view_candidate_last_name"></strong><br>
1154
                    LABEL_EMAIL : <span id="view_vacancy_email"></span><br>
1155
                  </address>
1156
                </div>
1157
                <!-- /.col -->
1158
                <div class="col-sm-3 invoice-col">
1159
                	<strong> LABEL_APPLICATION</strong><br>
1160
                  	<address>
1161
                  	LABEL_LEVEL : <span id="view_application_level"></span>
1162
                  	<?php if($allowLevel) : ?>
1163
                  	<button class="btn btn-default btn-change-level"><i class="fa fa-external-link"></i></button>
1164
                  	<?php endif; ?>
1165
                  	<br>
1166
                  	LABEL_STATUS : <span id="view_application_status"></span>
1167
                  	<?php if($allowStatus) : ?>
1168
                  	<button class="btn btn-default btn-change-status"><i class="fa fa-external-link"></i></button>
1169
                  	<?php endif; ?>
1170
                  	<br>
1171
                  	LABEL_POINTS : <span id="view_application_points"></span>
1172
                  	<?php if($allowComment) : ?>
1173
                  	<button class="btn btn-default btn-change-comment"><i class="fa fa-external-link"></i></button>
1174
                  	<?php endif; ?>
1175
                  	<br>
1176
                   </address>
1177
                </div>
1178
                <!-- /.col -->
1179
              </div>
1180
              <div class="row invoice-info" >
1181
              	<div class="col-sm-12 invoice-col" >
1182
              		<strong>LABEL_COMMENT</strong><br/>
1183
              		<div id="view_application_comment">
1184
              		</div>
1185
              	</div>
1186
              </div>
1187
              <!-- /.row -->
1188
 
1189
              <!-- Table row -->
1190
              <div class="row">
1191
                <div class="col-12 table-responsive">
1192
                  <table class="table table-striped" id="fileTable">
1193
                    <thead>
1194
                    <tr>
1195
                      <th>LABEL_NAME</th>
1196
                      <th>LABEL_FILE</th>
1197
                      <th>LABEL_ACTIONS</th>
1198
                    </tr>
1199
                    </thead>
1200
                    <tbody>
1201
 
1202
                    </tbody>
1203
 
1204
                    <tfoot>
1205
                    	<tr>
1206
                    		<td colspan="3" class="text-right">
1207
                        	 <?php if($allowFileAdd) : ?>
1208
                        	<button type="button" class="btn btn-primary btn-add-file"><i class="fa fa-plus"></i> LABEL_ADD </button>
1209
                        	<?php endif; ?>
1210
                        	</td>
1211
                        </tr>
1212
                    </tfoot>
1213
 
1214
                  </table>
1215
                </div>
1216
                <!-- /.col -->
1217
              </div>
1218
              <!-- /.row -->
1219
 
1220
 
1221
             <!-- Table row -->
1222
              <div class="row">
1223
                <div class="col-12 table-responsive">
1224
                  <table class="table table-striped" id="interviewTable">
1225
                    <thead>
1226
                    <tr>
1227
                    	<th>LABEL_TYPE</th>
1228
                      	<th>LABEL_LAST_DATE</th>
1229
                      	<th>LABEL_INTERVIEWED_BY</th>
1230
                      	<th>LABEL_STATUS</th>
1231
                      	<th>LABEL_ACTIONS</th>
1232
                    </tr>
1233
                    </thead>
1234
                    <tbody>
1235
 
1236
                    </tbody>
1237
 
1238
                    <tfoot>
1239
                    	<tr>
1240
                    		<td colspan="5" class="text-right">
1241
                        	 <?php if($allowInterviewAdd) : ?>
1242
                        	<button type="button" class="btn btn-primary  btn-add-interview"><i class="fa fa-plus"></i> LABEL_ADD </button>
1243
                        	<?php endif; ?>
1244
                        	</td>
1245
                        </tr>
1246
                    </tfoot>
1247
 
1248
                  </table>
1249
                </div>
1250
                <!-- /.col -->
1251
              </div>
1252
              <!-- /.row -->
1253
 
1254
 
1255
 
1256
              <!-- this row will not appear when printing -->
1257
              <div class="row no-print">
1258
                <div class="col-12"">
1259
                  <button type="button" class="btn btn-default btn-close-application"><i class="far fa-time"></i> LABEL_CLOSE </button>
1260
                </div>
1261
              </div>
1262
            </div>
1263
            <!-- /.invoice -->
1264
          </div><!-- /.col -->
1265
 
1266
 
1267
 
1268
    	</div>
1269
 
1270
 
1271
		<div class="row" id="row-list">
1272
        	<div class="col-12">
1273
            	<div class="card">
1274
            		<div class="card-header">
1275
            			<?php
1276
                        $form = $this->formFilter;
1277
                        $form->setAttributes([
1278
                            'method'    => 'post',
1279
                            'name'      => 'form-filter',
1280
                            'id'        => 'form-filter'
1281
                        ]);
1282
 
1283
                        $form->prepare();
1284
                        echo $this->form()->openTag($form);
1285
 
1286
 
1287
                        $element = $form->get('vacancy_id');
1288
                        $element->setAttributes(['class' => 'form-control']);
1289
                        $element->setOptions(['label' => 'LABEL_VACANCY']);
1290
                        ?>
1291
                   		<table class="table">
1292
                   			<tbody>
1293
                   				<tr>
1294
                   					<td>
1295
                   						<?php echo $this->formLabel($element); ?>
1296
                   					</td>
1297
                   					<td>
1298
                   						<?php echo $this->formSelect($element); ?>
1299
                   					</td>
1300
                   				</tr>
1301
                   			</tbody>
1302
                  		</table>
1303
            			<?php echo $this->form()->closeTag($form); ?>
1304
            		</div>
1305
                	<div class="card-body">
1306
                   		<table id="gridTable" class="table   table-hover">
1307
                      		<thead>
1308
                         		<tr>
1309
                            		<th>LABEL_FIRST_NAME</th>
1310
                            		<th>LABEL_LAST_NAME</th>
1311
                            		<th>LABEL_EMAIL</th>
1312
                            		<th>LABEL_STATUS</th>
1313
                            		<th>LABEL_LEVEL</th>
1314
                            		<th>LABEL_ACTIONS</th>
1315
                         		</tr>
1316
                      		</thead>
1317
                      		<tbody>
1318
                      		</tbody>
1319
                   		</table>
1320
                	</div>
1321
                	<div class="card-footer clearfix">
1322
                   		<div style="float:right;">
1323
                      		<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1324
                      		<?php if ($allowAdd) : ?>
1325
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1326
                            <?php endif; ?>
1327
                   		</div>
1328
                	</div>
1329
             	</div>
1330
			</div>
1331
		</div>
1332
	</div>
1333
 
1334
 
1335
 
1336
 
1337
 
1338
 
1339
 
1340
 
1341
 
1342
 
1343
 
1344
<!-- The Modal -->
1345
<div class="modal" id="modal-add-application">
1346
    <div class="modal-dialog  modal-xl">
1347
        <div class="modal-content">
1348
 
1349
            <!-- Modal Header -->
1350
            <div class="modal-header">
1351
                <h4>LABEL_ADD_APPLICATION</h4>
1352
            </div>
1353
 
1354
            <!-- Modal body -->
1355
            <div class="modal-body">
1356
                <?php
1357
                $form = $this->formAdd;
1358
                $form->setAttributes([
1359
                    'method'    => 'post',
1360
                    'name'      => 'form-add',
1361
                    'id'        => 'form-add'
1362
                ]);
1363
 
1364
                $form->prepare();
1365
                echo $this->form()->openTag($form);
1366
 
1367
                $element = $form->get('user_id');
1368
                echo $this->formHidden($element);
1369
 
1370
                ?>
1371
                <div class="form-group">
1372
 
1373
                    <?php
1374
                    $element = $form->get('email');
1375
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
1376
                    $element->setAttributes(['class' => 'form-control']);
1377
 
1378
                    echo $this->formLabel($element);
1379
                    ?>
1380
                    <?php if($allowUserByEmail) : ?>
1381
                   	<div class="input-group-append">
1382
                   <?php endif; ?>
1383
                    <?php
1384
                    echo $this->formText($element);
1385
                    ?>
1386
                    <?php if($allowUserByEmail) : ?>
1387
                   <button class="input-group-text btn-search-email" style="margin-left: 5px">
1388
                   		<i class="fa fa-search" aria-hidden="true"></i>
1389
                   </button>
1390
                   <?php endif; ?>
1391
                    </div>
1392
                </div>
1393
                <div class="form-group">
1394
                    <?php
1395
                    $element = $form->get('first_name');
1396
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
1397
                    $element->setAttributes(['class' => 'form-control']);
1398
 
1399
                    echo $this->formLabel($element);
1400
                    echo $this->formText($element);
1401
                    ?>
1402
                </div>
1403
           		<div class="form-group">
1404
                    <?php
1405
                    $element = $form->get('last_name');
1406
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
1407
                    $element->setAttributes(['class' => 'form-control']);
1408
 
1409
                    echo $this->formLabel($element);
1410
                    echo $this->formText($element);
1411
                    ?>
1412
                </div>
1413
 
1414
                <div class="text-right">
1415
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1416
                    <button type="button" class="btn btn-light btn-cancel-modal-application">LABEL_CANCEL</button>
1417
                </div>
1418
                <?php echo $this->form()->closeTag($form); ?>
1419
            </div>
1420
 
1421
 
1422
        </div>
1423
    </div>
1424
</div>
1425
 
1426
 
1427
<!-- The Modal -->
1428
<div class="modal" id="modal-add-file">
1429
    <div class="modal-dialog  modal-xl">
1430
        <div class="modal-content">
1431
 
1432
            <!-- Modal Header -->
1433
            <div class="modal-header">
1434
                <h4>LABEL_ADD_FILE</h4>
1435
            </div>
1436
 
1437
            <!-- Modal body -->
1438
            <div class="modal-body">
1439
                <?php
1440
                $form = $this->formFile;
1441
                $form->setAttributes([
1442
                    'method'    => 'post',
1443
                    'name'      => 'form-file',
1444
                    'id'        => 'form-file'
1445
                ]);
1446
 
1447
                $form->prepare();
1448
                echo $this->form()->openTag($form);
1449
 
1450
 
1451
 
1452
                ?>
1453
 
1454
                <div class="form-group">
1455
                    <?php
1456
                    $element = $form->get('name');
1457
                    $element->setOptions(['label' => 'LABEL_NAME']);
1458
                    $element->setAttributes(['class' => 'form-control']);
1459
 
1460
                    echo $this->formLabel($element);
1461
                    echo $this->formText($element);
1462
                    ?>
1463
                </div>
1464
           		<div class="form-group">
1465
                    <?php
1466
                    $element = $form->get('file');
1467
                    $element->setOptions(['label' => 'LABEL_FILE']);
1468
                    $element->setAttributes(['class' => 'form-control']);
1469
 
1470
                    echo $this->formLabel($element);
1471
                    echo $this->formFile($element);
1472
                    ?>
1473
                </div>
1474
 
1475
                <div class="text-right">
1476
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1477
                    <button type="button" class="btn btn-light btn-cancel-modal-file">LABEL_CANCEL</button>
1478
                </div>
1479
                <?php echo $this->form()->closeTag($form); ?>
1480
            </div>
1481
 
1482
 
1483
        </div>
1484
    </div>
1485
</div>
1486
 
1487
 
1488
<!-- The Modal -->
1489
<div class="modal" id="modal-comment">
1490
    <div class="modal-dialog  modal-xl">
1491
        <div class="modal-content">
1492
 
1493
            <!-- Modal Header -->
1494
            <div class="modal-header">
1495
                <h4>LABEL_EVALUATION</h4>
1496
            </div>
1497
 
1498
            <!-- Modal body -->
1499
            <div class="modal-body">
1500
                <?php
1501
                $form = $this->formComment;
1502
                $form->setAttributes([
1503
                    'method'    => 'post',
1504
                    'name'      => 'form-comment',
1505
                    'id'        => 'form-comment'
1506
                ]);
1507
 
1508
                $form->prepare();
1509
                echo $this->form()->openTag($form);
1510
 
1511
 
1512
 
1513
                ?>
1514
 
1515
                <div class="form-group">
1516
                    <?php
1517
                    $element = $form->get('points');
1518
                    $element->setOptions(['label' => 'LABEL_POINTS']);
1519
                    $element->setAttributes(['class' => 'form-control']);
1520
 
1521
                    echo $this->formLabel($element);
1522
                    echo $this->formText($element);
1523
                    ?>
1524
                </div>
1525
           		<div class="form-group">
1526
                    <?php
1527
                    $element = $form->get('comment');
1528
                    $element->setOptions(['label' => 'LABEL_COMMENT']);
1529
                    $element->setAttributes(['class' => 'form-control']);
1530
 
1531
                    echo $this->formLabel($element);
1532
                    echo $this->formTextArea($element);
1533
                    ?>
1534
                </div>
1535
 
1536
                <div class="text-right">
1537
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1538
                    <button type="button" class="btn btn-light btn-cancel-modal-comment">LABEL_CANCEL</button>
1539
                </div>
1540
                <?php echo $this->form()->closeTag($form); ?>
1541
            </div>
1542
 
1543
 
1544
        </div>
1545
    </div>
1546
</div>
1547
 
1548
 
1549
 
1550
<!-- The Modal -->
1551
<div class="modal" id="modal-level">
1552
    <div class="modal-dialog  modal-xl">
1553
        <div class="modal-content">
1554
 
1555
            <!-- Modal Header -->
1556
            <div class="modal-header">
1557
                <h4>LABEL_LEVEL</h4>
1558
            </div>
1559
 
1560
            <!-- Modal body -->
1561
            <div class="modal-body">
1562
                <?php
1563
                $form = $this->formLevel;
1564
                $form->setAttributes([
1565
                    'method'    => 'post',
1566
                    'name'      => 'form-level',
1567
                    'id'        => 'form-level'
1568
                ]);
1569
 
1570
                $form->prepare();
1571
                echo $this->form()->openTag($form);
1572
 
1573
 
1574
 
1575
                ?>
1576
 
1577
                <div class="form-group">
1578
                    <?php
1579
                    $element = $form->get('level');
1580
                    $element->setOptions(['label' => 'LABEL_LEVEL']);
1581
                    $element->setAttributes(['class' => 'form-control']);
1582
 
1583
                    echo $this->formLabel($element);
1584
                    echo $this->formSelect($element);
1585
                    ?>
1586
                </div>
1587
 
1588
 
1589
                <div class="text-right">
1590
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1591
                    <button type="button" class="btn btn-light btn-cancel-modal-level">LABEL_CANCEL</button>
1592
                </div>
1593
                <?php echo $this->form()->closeTag($form); ?>
1594
            </div>
1595
 
1596
 
1597
        </div>
1598
    </div>
1599
</div>
1600
 
1601
 
1602
<!-- The Modal -->
1603
<div class="modal" id="modal-status">
1604
    <div class="modal-dialog  modal-xl">
1605
        <div class="modal-content">
1606
 
1607
            <!-- Modal Header -->
1608
            <div class="modal-header">
1609
                <h4>LABEL_STATUS</h4>
1610
            </div>
1611
 
1612
            <!-- Modal body -->
1613
            <div class="modal-body">
1614
                <?php
1615
                $form = $this->formStatus;
1616
                $form->setAttributes([
1617
                    'method'    => 'post',
1618
                    'name'      => 'form-status',
1619
                    'id'        => 'form-status'
1620
                ]);
1621
 
1622
                $form->prepare();
1623
                echo $this->form()->openTag($form);
1624
 
1625
 
1626
 
1627
                ?>
1628
 
1629
                <div class="form-group">
1630
                    <?php
1631
                    $element = $form->get('status');
1632
                    $element->setOptions(['label' => 'LABEL_STATUS']);
1633
                    $element->setAttributes(['class' => 'form-control']);
1634
 
1635
                    echo $this->formLabel($element);
1636
                    echo $this->formSelect($element);
1637
                    ?>
1638
                </div>
1639
 
1640
 
1641
                <div class="text-right">
1642
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1643
                    <button type="button" class="btn btn-light btn-cancel-modal-status">LABEL_CANCEL</button>
1644
                </div>
1645
                <?php echo $this->form()->closeTag($form); ?>
1646
            </div>
1647
 
1648
 
1649
        </div>
1650
    </div>
1651
</div>
1652
 
1653
 
1654
<div class="modal" id="modal-interview">
1655
    <div class="modal-dialog  modal-xl">
1656
        <div class="modal-content">
1657
 
1658
            <!-- Modal Header -->
1659
            <div class="modal-header">
1660
                <h4>LABEL_INTERVIEW</h4>
1661
            </div>
1662
 
1663
            <!-- Modal body -->
1664
            <div class="modal-body">
1665
                <?php
1666
                $form = $this->formInterview;
1667
                $form->setAttributes([
1668
                    'method'    => 'post',
1669
                    'name'      => 'form-interview',
1670
                    'id'        => 'form-interview'
1671
                ]);
1672
 
1673
                $form->prepare();
1674
                echo $this->form()->openTag($form);
1675
 
1676
 
1677
 
1678
                ?>
1679
 
1680
         		<div class="form-group">
1681
                    <?php
1682
                    $element = $form->get('user_id');
1683
                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
1684
                    $element->setAttributes(['class' => 'form-control']);
1685
 
1686
                    echo $this->formLabel($element);
1687
                    echo $this->formSelect($element);
1688
                    ?>
1689
                </div>
1690
 
1691
                <div class="form-group">
1692
                    <?php
1693
                    $element = $form->get('type');
1694
                    $element->setOptions(['label' => 'LABEL_TYPE']);
1695
                    $element->setAttributes(['class' => 'form-control']);
1696
 
1697
                    echo $this->formLabel($element);
1698
                    echo $this->formSelect($element);
1699
                    ?>
1700
                </div>
1701
 
1702
                 <div class="form-group">
1703
                    <?php
1704
                    $element = $form->get('last_date');
1705
                    $element->setOptions(['label' => 'LABEL_LAST_DATE']);
1706
                    $element->setAttributes(['class' => 'form-control']);
1707
 
1708
                    echo $this->formLabel($element);
1709
                    echo $this->formText($element);
1710
                    ?>
1711
                </div>
1712
 
1713
 
1714
                <div class="text-right">
1715
                    <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1716
                    <button type="button" class="btn btn-light btn-cancel-modal-interview">LABEL_CANCEL</button>
1717
                </div>
1718
                <?php echo $this->form()->closeTag($form); ?>
1719
            </div>
1720
 
1721
 
1722
        </div>
1723
    </div>
1724
</div>
1725
 
1726
</section>
1727
 
1728
 
1729
<script id="fileTemplate" type="text/x-jsrender">
1730
    <tr>
1731
        <td>{{>name}}</td>
1732
        <td>{{>filename}}</td>
1733
        <td>
1734
            {{if link_view}}
1735
            <button class="btn btn-default btn-view-file" data-href="{{>link_view}}" data-toggle="tooltip" title="LABEL_DOWNLOAD"><i class="fa fa-download"></i> LABEL_DOWNLOAD </button>
1736
            {{/if}}
1737
            {{if link_delete}}
1738
            <button class="btn btn-danger btn-delete-file" data-href="{{>link_delete}}" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>
1739
            {{/if}}
1740
        </td>
1741
    </tr>
1742
</script>
1743
 
1744
 
1745
 
1746
 
1747
 
1748
<script id="interviewTemplate" type="text/x-jsrender">
1749
    <tr>
1750
        <td>{{>type}}</td>
1751
        <td>{{>last_date}}</td>
1752
        <td>{{>interviewer}}</td>
1753
        <td>{{>status}}</td>
1754
        <td>
1755
            {{if link_report}}
1756
            <button class="btn btn-default btn-report-interview" data-href="{{>link_report}}" data-toggle="tooltip" title="LABEL_DOWNLOAD"><i class="fa fa-download"></i> LABEL_DOWNLOAD </button>
1757
            {{/if}}
1758
            {{if link_edit}}
1759
            <button class="btn btn-default btn-edit-interview" data-href="{{>link_edit}}" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>
1760
            {{/if}}
1761
            {{if link_delete}}
1762
            <button class="btn btn-danger btn-delete-interview" data-href="{{>link_delete}}" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>
1763
            {{/if}}
1764
        </td>
1765
    </tr>
1766
</script>
1767