Proyectos de Subversion LeadersLinked - Backend

Rev

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