Proyectos de Subversion LeadersLinked - Backend

Rev

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