Proyectos de Subversion LeadersLinked - Backend

Rev

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