Proyectos de Subversion LeadersLinked - Backend

Rev

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