Proyectos de Subversion LeadersLinked - Backend

Rev

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