Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16932 | Rev 16953 | 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) {
16932 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-alt"></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%',
16941 stevensc 1060
        dropdownParent: $('#modal-level'),
15461 efrain 1061
    });
1062
 
1063
    $('#form-status #status').select2({
16918 efrain 1064
        theme: 'bootstrap-5',
15461 efrain 1065
        width: '100%',
16941 stevensc 1066
        dropdownParent: $('#modal-status'),
15461 efrain 1067
    });
1068
 
1069
 
1070
    $('#form-interview #type').select2({
16918 efrain 1071
        theme: 'bootstrap-5',
15461 efrain 1072
        width: '100%',
16941 stevensc 1073
        dropdownParent: $('#modal-interview'),
15461 efrain 1074
    });
1075
 
16941 stevensc 1076
 
15461 efrain 1077
    $('#form-interview #user_id').select2({
16918 efrain 1078
        theme: 'bootstrap-5',
15461 efrain 1079
        width: '100%',
16941 stevensc 1080
        dropdownParent: $('#modal-interview'),
15461 efrain 1081
    });
16941 stevensc 1082
 
15461 efrain 1083
    $('#form-interview #last_date').datetimepicker({
1084
        locale: 'es',
1085
        format: 'DD/MM/YYYY'
16941 stevensc 1086
        dropdownParent: $('#modal-interview'),
15461 efrain 1087
    });
1088
 
1089
 
1090
 
1091
    $('#form-comment #points').inputNumberFormat({decimal: 0});
1092
 
1093
 
1094
    CKEDITOR.replace('comment');
1095
 
1096
 
1097
  });
1098
JS;
1099
 
1100
$this->inlineScript()->captureEnd();
1101
 
1102
?>
1103
<!-- Content Header (Page header) -->
1104
 
16845 efrain 1105
<div class="container">
16941 stevensc 1106
    <div class="card" id="row-list">
1107
        <div class="card-header">
1108
            <h6 class="card-title">LABEL_APPLICATIONS</h6>
1109
        </div>
15461 efrain 1110
 
16941 stevensc 1111
 
1112
        <div class="card-body">
1113
            <div class="row">
1114
                <div class="col-12 mt-3">
1115
                    <?php
1116
                    $form = $this->formFilter;
1117
                    $form->setAttributes([
1118
                        'method'    => 'post',
1119
                        'name'      => 'form-filter',
1120
                        'id'        => 'form-filter'
1121
                    ]);
1122
 
1123
                    $form->prepare();
1124
                    echo $this->form()->openTag($form);
1125
 
16845 efrain 1126
                    $element = $form->get('vacancy_id');
1127
                    $element->setAttributes(['class' => 'form-control']);
1128
                    $element->setOptions(['label' => 'LABEL_VACANCY']);
1129
                    ?>
16941 stevensc 1130
                    <table class="table">
1131
                        <tbody>
1132
                            <tr>
1133
                                <td><?php echo $this->formLabel($element); ?></td>
1134
                                <td><?php echo $this->formSelect($element); ?></td>
1135
                            </tr>
1136
                        </tbody>
1137
                    </table>
1138
                    <?php echo $this->form()->closeTag($form); ?>
1139
                </div>
1140
            </div>
1141
            <div class="row">
1142
                <div class="col-12 mt-3">
1143
 
1144
                    <table id="gridTable" class="table   table-bordered">
1145
                        <thead>
1146
                            <tr>
1147
                                <th>LABEL_FIRST_NAME</th>
1148
                                <th>LABEL_LAST_NAME</th>
1149
                                <th>LABEL_EMAIL</th>
1150
                                <th>LABEL_STATUS</th>
1151
                                <th>LABEL_LEVEL</th>
1152
                                <th>LABEL_ACTIONS</th>
1153
                            </tr>
1154
                        </thead>
1155
                        <tbody>
1156
                        </tbody>
1157
                    </table>
1158
 
1159
                </div>
1160
            </div>
1161
        </div>
1162
        <div class="card-footer text-right">
1163
            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1164
            <?php if ($allowAdd) : ?>
1165
                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1166
            <?php endif; ?>
1167
        </div>
1168
    </div>
1169
 
1170
 
1171
    <div class="card" id="row-view" style="display: none">
1172
        <div class="card-header">
1173
            <h6 class="card-title">
1174
                <span id="view_title_name"></span>
16845 efrain 1175
                <small class="float-right">LABEL_LAST_DATE: <span id="view_title_last_date"></span></small>
16941 stevensc 1176
            </h6>
1177
        </div>
1178
        <div class="card-body">
1179
            <div class="row invoice-info">
15461 efrain 1180
                <div class="col-sm-6 invoice-col">
16941 stevensc 1181
                    <strong>LABEL_VACANCY</strong>
1182
                    <address>
1183
                        <span id="view_vacancy_name"></span><br>
1184
                        LABEL_LAST_DATE : <span id="view_vacancy_last_date"></span><br>
1185
                        LABEL_JOB_DESCRIPTION : <span id="view_vacancy_job_description"></span><br>
1186
                        LABEL_INDUSTRY : <span id="view_vacancy_industry"></span><br>
1187
                        LABEL_JOB_CATEGORY : <span id="view_vacancy_job_category"></span>
1188
                    </address>
15461 efrain 1189
                </div>
1190
                <!-- /.col -->
1191
                <div class="col-sm-3 invoice-col">
16941 stevensc 1192
                    <strong>LABEL_CANDIDATE</strong>
1193
                    <address>
1194
                        LABEL_FIRST_NAME : <strong id="view_candidate_first_name"></strong><br>
1195
                        LABEL_LAST_NAME : <strong id="view_candidate_last_name"></strong><br>
1196
                        LABEL_EMAIL : <span id="view_vacancy_email"></span><br>
1197
                    </address>
15461 efrain 1198
                </div>
1199
                <!-- /.col -->
1200
                <div class="col-sm-3 invoice-col">
16941 stevensc 1201
                    <strong> LABEL_APPLICATION</strong><br>
1202
                    <address>
1203
                        LABEL_LEVEL : <span id="view_application_level"></span>
1204
                        <?php if ($allowLevel) : ?>
1205
                            <button class="btn btn-default btn-change-level"><i class="fa fa-external-link-alt"></i></button>
1206
                        <?php endif; ?>
1207
                        <br>
1208
                        LABEL_STATUS : <span id="view_application_status"></span>
1209
                        <?php if ($allowStatus) : ?>
1210
                            <button class="btn btn-default btn-change-status"><i class="fa fa-external-link-alt"></i></button>
1211
                        <?php endif; ?>
1212
                        <br>
1213
                        LABEL_POINTS : <span id="view_application_points"></span>
1214
                        <?php if ($allowComment) : ?>
1215
                            <button class="btn btn-default btn-change-comment"><i class="fa fa-external-link-alt"></i></button>
1216
                        <?php endif; ?>
1217
                        <br>
1218
                    </address>
15461 efrain 1219
                </div>
1220
                <!-- /.col -->
16941 stevensc 1221
            </div>
1222
            <div class="row invoice-info">
1223
                <div class="col-sm-12 invoice-col">
1224
                    <strong>LABEL_COMMENT</strong><br />
1225
                    <div id="view_application_comment">
1226
                    </div>
1227
                </div>
1228
            </div>
1229
            <!-- /.row -->
15461 efrain 1230
 
16941 stevensc 1231
            <!-- Table row -->
1232
            <div class="row">
15461 efrain 1233
                <div class="col-12 table-responsive">
16941 stevensc 1234
                    <table class="table " id="fileTable">
1235
                        <thead>
1236
                            <tr>
1237
                                <th>LABEL_NAME</th>
1238
                                <th>LABEL_FILE</th>
1239
                                <th>LABEL_ACTIONS</th>
1240
                            </tr>
1241
                        </thead>
1242
                        <tbody>
1243
 
1244
                        </tbody>
1245
 
1246
                        <tfoot>
1247
                            <tr>
1248
                                <td colspan="3" class="text-right">
1249
                                    <?php if ($allowFileAdd) : ?>
1250
                                        <button type="button" class="btn btn-primary btn-add-file"><i class="fa fa-plus"></i> LABEL_ADD </button>
1251
                                    <?php endif; ?>
1252
                                </td>
1253
                            </tr>
1254
                        </tfoot>
1255
 
1256
                    </table>
15461 efrain 1257
                </div>
1258
                <!-- /.col -->
16941 stevensc 1259
            </div>
1260
            <!-- /.row -->
1261
 
1262
 
1263
            <!-- Table row -->
1264
            <div class="row">
15461 efrain 1265
                <div class="col-12 table-responsive">
16941 stevensc 1266
                    <table class="table " id="interviewTable">
1267
                        <thead>
1268
                            <tr>
1269
                                <th>LABEL_TYPE</th>
1270
                                <th>LABEL_LAST_DATE</th>
1271
                                <th>LABEL_INTERVIEWED_BY</th>
1272
                                <th>LABEL_STATUS</th>
1273
                                <th>LABEL_ACTIONS</th>
1274
                            </tr>
1275
                        </thead>
1276
                        <tbody>
1277
 
1278
                        </tbody>
1279
 
1280
                        <tfoot>
1281
                            <tr>
1282
                                <td colspan="5" class="text-right">
1283
                                    <?php if ($allowInterviewAdd) : ?>
1284
                                        <button type="button" class="btn btn-primary  btn-add-interview"><i class="fa fa-plus"></i> LABEL_ADD </button>
1285
                                    <?php endif; ?>
1286
                                </td>
1287
                            </tr>
1288
                        </tfoot>
1289
 
1290
                    </table>
15461 efrain 1291
                </div>
1292
                <!-- /.col -->
16941 stevensc 1293
            </div>
1294
            <!-- /.row -->
1295
        </div>
1296
        <div class="card-footer text-right">
1297
            <button type="button" class="btn btn-primary btn-close-application"><i class="far fa-time"></i> LABEL_CLOSE </button>
1298
        </div>
1299
    </div>
1300
 
16845 efrain 1301
</div>
15461 efrain 1302
 
1303
 
1304
 
1305
 
1306
 
1307
 
1308
 
1309
 
1310
 
1311
 
16941 stevensc 1312
 
1313
 
1314
 
1315
 
15461 efrain 1316
<!-- The Modal -->
1317
<div class="modal" id="modal-add-application">
1318
    <div class="modal-dialog  modal-xl">
1319
        <div class="modal-content">
1320
 
1321
            <!-- Modal Header -->
1322
            <div class="modal-header">
16845 efrain 1323
                <h6>LABEL_ADD_APPLICATION</h6>
15461 efrain 1324
            </div>
1325
 
16941 stevensc 1326
            <?php
1327
            $form = $this->formAdd;
1328
            $form->setAttributes([
1329
                'method'    => 'post',
1330
                'name'      => 'form-add',
1331
                'id'        => 'form-add'
1332
            ]);
15461 efrain 1333
 
16941 stevensc 1334
            $form->prepare();
1335
            echo $this->form()->openTag($form);
16845 efrain 1336
 
16941 stevensc 1337
            $element = $form->get('user_id');
1338
            echo $this->formHidden($element);
1339
 
1340
            ?>
1341
 
16845 efrain 1342
            <!-- Modal body -->
1343
            <div class="modal-body">
15461 efrain 1344
 
16941 stevensc 1345
                <div class="row">
1346
                    <div class="col-12 mt-3">
1347
                        <?php
1348
                        $element = $form->get('email');
1349
                        $element->setOptions(['label' => 'LABEL_EMAIL']);
1350
                        $element->setAttributes(['class' => 'form-control']);
16845 efrain 1351
 
16941 stevensc 1352
                        echo $this->formLabel($element);
1353
                        ?>
1354
 
1355
 
1356
                        <?php if ($allowUserByEmail) : ?>
1357
 
1358
                            <div class="input-group mb-3">
1359
                                <?php echo  $this->formText($element); ?>
1360
                                <span class="input-group-text btn-search-email">
1361
 
1362
                                    <i class="fa fa-search" aria-hidden="true"></i></span>
1363
 
1364
                            </div>
1365
 
1366
 
1367
                        <?php
1368
                        else :
1369
                            echo $this->formText($element);
1370
                        endif; ?>
1371
 
16845 efrain 1372
                    </div>
15461 efrain 1373
                </div>
16941 stevensc 1374
                <div class="row">
1375
                    <div class="col-12 mt-3">
1376
                        <?php
1377
                        $element = $form->get('first_name');
1378
                        $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
1379
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1380
 
16941 stevensc 1381
                        echo $this->formLabel($element);
1382
                        echo $this->formText($element);
1383
                        ?>
16845 efrain 1384
                    </div>
15461 efrain 1385
                </div>
16941 stevensc 1386
                <div class="row">
1387
                    <div class="col-12 mt-3">
1388
                        <?php
1389
                        $element = $form->get('last_name');
1390
                        $element->setOptions(['label' => 'LABEL_LAST_NAME']);
1391
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1392
 
16941 stevensc 1393
                        echo $this->formLabel($element);
1394
                        echo $this->formText($element);
1395
                        ?>
16845 efrain 1396
                    </div>
15461 efrain 1397
                </div>
1398
 
16941 stevensc 1399
 
16845 efrain 1400
            </div>
16941 stevensc 1401
            <div class="modal-footer text-right">
1402
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1403
                <button type="button" class="btn btn-light btn-cancel-modal-application">LABEL_CANCEL</button>
1404
            </div>
1405
            <?php echo $this->form()->closeTag($form); ?>
15461 efrain 1406
        </div>
1407
    </div>
1408
</div>
1409
 
1410
 
1411
<!-- The Modal -->
1412
<div class="modal" id="modal-add-file">
1413
    <div class="modal-dialog  modal-xl">
1414
        <div class="modal-content">
1415
 
1416
            <!-- Modal Header -->
1417
            <div class="modal-header">
16845 efrain 1418
                <h6>LABEL_ADD_FILE</h6>
15461 efrain 1419
            </div>
1420
 
16941 stevensc 1421
            <?php
1422
            $form = $this->formFile;
1423
            $form->setAttributes([
1424
                'method'    => 'post',
1425
                'name'      => 'form-file',
1426
                'id'        => 'form-file'
1427
            ]);
15461 efrain 1428
 
16941 stevensc 1429
            $form->prepare();
1430
            echo $this->form()->openTag($form);
15461 efrain 1431
 
1432
 
16941 stevensc 1433
 
1434
            ?>
16845 efrain 1435
            <div class="modal-body">
15461 efrain 1436
 
16941 stevensc 1437
 
16845 efrain 1438
                <div class="row">
16941 stevensc 1439
                    <div class="col-12 mt-3">
1440
                        <?php
1441
                        $element = $form->get('name');
1442
                        $element->setOptions(['label' => 'LABEL_NAME']);
1443
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1444
 
16941 stevensc 1445
                        echo $this->formLabel($element);
1446
                        echo $this->formText($element);
1447
                        ?>
16845 efrain 1448
                    </div>
15461 efrain 1449
                </div>
16941 stevensc 1450
                <div class="row">
1451
                    <div class="col-12 mt-3">
1452
                        <?php
1453
                        $element = $form->get('file');
1454
                        $element->setOptions(['label' => 'LABEL_FILE']);
1455
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1456
 
16941 stevensc 1457
                        echo $this->formLabel($element);
1458
                        echo $this->formFile($element);
1459
                        ?>
16845 efrain 1460
                    </div>
15461 efrain 1461
                </div>
1462
 
16845 efrain 1463
 
1464
            </div>
16941 stevensc 1465
            <div class="modal-footer text-right">
1466
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1467
                <button type="button" class="btn btn-light btn-cancel-modal-file">LABEL_CANCEL</button>
1468
            </div>
1469
            <?php echo $this->form()->closeTag($form); ?>
15461 efrain 1470
 
1471
        </div>
1472
    </div>
1473
</div>
1474
 
1475
 
1476
<!-- The Modal -->
1477
<div class="modal" id="modal-comment">
1478
    <div class="modal-dialog  modal-xl">
1479
        <div class="modal-content">
1480
 
1481
            <!-- Modal Header -->
1482
            <div class="modal-header">
16845 efrain 1483
                <h6>LABEL_EVALUATION</h6>
15461 efrain 1484
            </div>
1485
 
16941 stevensc 1486
            <?php
1487
            $form = $this->formComment;
1488
            $form->setAttributes([
1489
                'method'    => 'post',
1490
                'name'      => 'form-comment',
1491
                'id'        => 'form-comment'
1492
            ]);
15461 efrain 1493
 
16941 stevensc 1494
            $form->prepare();
1495
            echo $this->form()->openTag($form);
15461 efrain 1496
 
1497
 
16941 stevensc 1498
 
1499
            ?>
16845 efrain 1500
            <div class="modal-body">
15461 efrain 1501
 
1502
 
16941 stevensc 1503
                <div class="row">
1504
                    <div class="col-12 mt-3">
1505
                        <?php
1506
                        $element = $form->get('points');
1507
                        $element->setOptions(['label' => 'LABEL_POINTS']);
1508
                        $element->setAttributes(['class' => 'form-control']);
1509
 
1510
                        echo $this->formLabel($element);
1511
                        echo $this->formText($element);
1512
                        ?>
16845 efrain 1513
                    </div>
15461 efrain 1514
                </div>
16941 stevensc 1515
                <div class="row">
1516
                    <div class="col-12 mt-3">
1517
                        <?php
1518
                        $element = $form->get('comment');
1519
                        $element->setOptions(['label' => 'LABEL_COMMENT']);
1520
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1521
 
16941 stevensc 1522
                        echo $this->formLabel($element);
1523
                        echo $this->formTextArea($element);
1524
                        ?>
16845 efrain 1525
                    </div>
15461 efrain 1526
                </div>
1527
 
16845 efrain 1528
 
1529
            </div>
16941 stevensc 1530
            <div class="modal-footer text-right">
1531
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1532
                <button type="button" class="btn btn-light btn-cancel-modal-comment">LABEL_CANCEL</button>
1533
            </div>
1534
            <?php echo $this->form()->closeTag($form); ?>
15461 efrain 1535
 
1536
        </div>
1537
    </div>
1538
</div>
1539
 
1540
 
1541
 
1542
<!-- The Modal -->
1543
<div class="modal" id="modal-level">
1544
    <div class="modal-dialog  modal-xl">
1545
        <div class="modal-content">
1546
 
1547
            <!-- Modal Header -->
1548
            <div class="modal-header">
16845 efrain 1549
                <h6>LABEL_LEVEL</h6>
15461 efrain 1550
            </div>
1551
 
16941 stevensc 1552
            <?php
1553
            $form = $this->formLevel;
1554
            $form->setAttributes([
1555
                'method'    => 'post',
1556
                'name'      => 'form-level',
1557
                'id'        => 'form-level'
1558
            ]);
15461 efrain 1559
 
16941 stevensc 1560
            $form->prepare();
1561
            echo $this->form()->openTag($form);
15461 efrain 1562
 
1563
 
16941 stevensc 1564
 
1565
            ?>
16845 efrain 1566
            <div class="modal-body">
15461 efrain 1567
 
16941 stevensc 1568
 
16845 efrain 1569
                <div class="row">
16941 stevensc 1570
                    <div class="col-12 mt-3">
1571
                        <?php
1572
                        $element = $form->get('level');
1573
                        $element->setOptions(['label' => 'LABEL_LEVEL']);
1574
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1575
 
16941 stevensc 1576
                        echo $this->formLabel($element);
1577
                        echo $this->formSelect($element);
1578
                        ?>
16845 efrain 1579
                    </div>
15461 efrain 1580
                </div>
1581
 
1582
 
16941 stevensc 1583
 
16845 efrain 1584
            </div>
1585
 
16941 stevensc 1586
            <div class="modal-footer text-right">
1587
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1588
                <button type="button" class="btn btn-light btn-cancel-modal-level">LABEL_CANCEL</button>
1589
            </div>
1590
            <?php echo $this->form()->closeTag($form); ?>
15461 efrain 1591
        </div>
1592
    </div>
1593
</div>
1594
 
1595
 
1596
<!-- The Modal -->
1597
<div class="modal" id="modal-status">
1598
    <div class="modal-dialog  modal-xl">
1599
        <div class="modal-content">
1600
 
1601
            <!-- Modal Header -->
1602
            <div class="modal-header">
16845 efrain 1603
                <h6>LABEL_STATUS</h6>
15461 efrain 1604
            </div>
1605
 
16941 stevensc 1606
            <?php
1607
            $form = $this->formStatus;
1608
            $form->setAttributes([
1609
                'method'    => 'post',
1610
                'name'      => 'form-status',
1611
                'id'        => 'form-status'
1612
            ]);
15461 efrain 1613
 
16941 stevensc 1614
            $form->prepare();
1615
            echo $this->form()->openTag($form);
15461 efrain 1616
 
1617
 
16941 stevensc 1618
 
1619
            ?>
1620
 
16845 efrain 1621
            <!-- Modal body -->
1622
            <div class="modal-body">
15461 efrain 1623
 
16941 stevensc 1624
 
16845 efrain 1625
                <div class="row">
16941 stevensc 1626
                    <div class="col-12 mt-3">
1627
                        <?php
1628
                        $element = $form->get('status');
1629
                        $element->setOptions(['label' => 'LABEL_STATUS']);
1630
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1631
 
16941 stevensc 1632
                        echo $this->formLabel($element);
1633
                        echo $this->formSelect($element);
1634
                        ?>
16845 efrain 1635
                    </div>
15461 efrain 1636
                </div>
1637
 
1638
 
1639
            </div>
1640
 
16941 stevensc 1641
            <div class="modal-footer 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); ?>
15461 efrain 1646
        </div>
1647
    </div>
1648
</div>
1649
 
1650
 
1651
<div class="modal" id="modal-interview">
1652
    <div class="modal-dialog  modal-xl">
1653
        <div class="modal-content">
1654
 
1655
            <!-- Modal Header -->
1656
            <div class="modal-header">
16845 efrain 1657
                <h6>LABEL_INTERVIEW</h6>
15461 efrain 1658
            </div>
1659
 
16941 stevensc 1660
            <?php
1661
            $form = $this->formInterview;
1662
            $form->setAttributes([
1663
                'method'    => 'post',
1664
                'name'      => 'form-interview',
1665
                'id'        => 'form-interview'
1666
            ]);
15461 efrain 1667
 
16941 stevensc 1668
            $form->prepare();
1669
            echo $this->form()->openTag($form);
15461 efrain 1670
 
16941 stevensc 1671
 
1672
 
1673
            ?>
1674
 
16845 efrain 1675
            <div class="modal-body">
15461 efrain 1676
 
16941 stevensc 1677
                <div class="row">
1678
                    <div class="col-12 mt-3">
1679
                        <?php
1680
                        $element = $form->get('user_id');
1681
                        $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
1682
                        $element->setAttributes(['class' => 'form-control']);
1683
 
1684
                        echo $this->formLabel($element);
1685
                        echo $this->formSelect($element);
1686
                        ?>
16845 efrain 1687
                    </div>
15461 efrain 1688
                </div>
1689
 
16845 efrain 1690
                <div class="row">
16941 stevensc 1691
                    <div class="col-12 mt-3">
1692
                        <?php
1693
                        $element = $form->get('type');
1694
                        $element->setOptions(['label' => 'LABEL_TYPE']);
1695
                        $element->setAttributes(['class' => 'form-control']);
15461 efrain 1696
 
16941 stevensc 1697
                        echo $this->formLabel($element);
1698
                        echo $this->formSelect($element);
1699
                        ?>
16845 efrain 1700
                    </div>
15461 efrain 1701
                </div>
1702
 
16941 stevensc 1703
                <div class="row">
1704
                    <div class="col-12 mt-3">
1705
                        <?php
1706
                        $element = $form->get('last_date');
1707
                        $element->setOptions(['label' => 'LABEL_LAST_DATE']);
1708
                        $element->setAttributes(['class' => 'form-control']);
1709
 
1710
                        echo $this->formLabel($element);
1711
                        echo $this->formText($element);
1712
                        ?>
16845 efrain 1713
                    </div>
15461 efrain 1714
                </div>
1715
 
1716
 
16845 efrain 1717
 
15461 efrain 1718
            </div>
1719
 
16941 stevensc 1720
            <div class="modal-footer text-right">
1721
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
1722
                <button type="button" class="btn btn-light btn-cancel-modal-interview">LABEL_CANCEL</button>
1723
            </div>
1724
            <?php echo $this->form()->closeTag($form); ?>
15461 efrain 1725
        </div>
1726
    </div>
1727
</div>
1728
 
1729
 
1730
 
1731
<script id="fileTemplate" type="text/x-jsrender">
1732
    <tr>
1733
        <td>{{>name}}</td>
1734
        <td>{{>filename}}</td>
1735
        <td>
1736
            {{if link_view}}
16845 efrain 1737
            <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 1738
            {{/if}}
1739
            {{if link_delete}}
1740
            <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>
1741
            {{/if}}
1742
        </td>
1743
    </tr>
1744
</script>
1745
 
1746
 
1747
 
1748
 
1749
 
1750
<script id="interviewTemplate" type="text/x-jsrender">
1751
    <tr>
1752
        <td>{{>type}}</td>
1753
        <td>{{>last_date}}</td>
1754
        <td>{{>interviewer}}</td>
1755
        <td>{{>status}}</td>
1756
        <td>
1757
            {{if link_report}}
16845 efrain 1758
            <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 1759
            {{/if}}
1760
            {{if link_edit}}
16906 efrain 1761
            <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 1762
            {{/if}}
1763
            {{if link_delete}}
1764
            <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>
1765
            {{/if}}
1766
        </td>
1767
    </tr>
16941 stevensc 1768
</script>