Proyectos de Subversion LeadersLinked - Backend

Rev

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