Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3964 | Rev 3967 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3468 eleazar 1
<?php
1709 eleazar 2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
2029 eleazar 6
$routeIndex = $this->url('recruitment-and-selection/interview/form');
3563 eleazar 7
$routeAdd = $this->url('recruitment-and-selection/interview/form/add');
3573 eleazar 8
$routeVacancy = $this->url('recruitment-and-selection/interview/vacancy', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
1877 eleazar 9
 
1827 eleazar 10
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/add') ? 1 : 0;
3533 eleazar 11
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/edit') ? 1 : 0;
12
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/delete') ? 1 : 0;
3534 eleazar 13
$allowReport = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/report') ? 1 : 0;
1709 eleazar 14
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
15
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
16
 
17
 
18
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
19
 
20
 
1885 eleazar 21
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
1709 eleazar 22
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
25
 
26
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
28
 
29
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
33
 
34
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
37
 
38
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
39
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
42
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
43
 
44
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
45
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
47
 
1887 eleazar 48
 
2746 eleazar 49
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
50
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
51
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
52
 
1887 eleazar 53
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
1709 eleazar 54
 
2052 eleazar 55
// JsRender //
56
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
1709 eleazar 57
 
2510 eleazar 58
 
59
$points_0 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_0;
60
$points_1 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_1;
61
$points_2 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_2;
62
$points_3 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_3;
63
$points_4 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_4;
64
 
65
 
66
 
1709 eleazar 67
$this->headStyle()->captureStart();
68
echo <<<CSS
69
 
70
CSS;
71
$this->headStyle()->captureEnd();
72
 
73
$this->inlineScript()->captureStart();
74
echo <<<JS
75
 
76
jQuery( document ).ready(function( $ ) {
3535 eleazar 77
    var allowDelete = $allowDelete;
78
    var allowEdit = $allowEdit;
79
    var allowReport = $allowReport;
1877 eleazar 80
    $.validator.setDefaults({
2015 eleazar 81
        debug: true,
82
        highlight: function(element) {
83
            $(element).addClass('is-invalid');
84
        },
85
        unhighlight: function(element) {
86
            $(element).removeClass('is-invalid');
87
        },
88
        errorElement: 'span',
89
        errorClass: 'error invalid-feedback',
90
        errorPlacement: function(error, element) {
91
            if(element.parent('.btn-file').length) {
92
                error.insertAfter(element.parent().parent());
93
            } else if(element.parent('.toggle').length) {
94
                error.insertAfter(element.parent().parent());
95
            } else {
96
                error.insertAfter(element.parent());
1709 eleazar 97
            }
2015 eleazar 98
        }
99
    });
3468 eleazar 100
 
2015 eleazar 101
    $.fn.showFormErrorValidator = function(fieldname, errors) {
102
        var field = $(fieldname);
103
        if(field) {
104
            $(field).addClass('is-invalid');
1709 eleazar 105
 
2015 eleazar 106
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
3468 eleazar 107
 
2015 eleazar 108
            if(element.parent('.btn-file').length) {
109
                error.insertAfter(element.parent().parent());
110
            } else if(element.parent('.toggle').length) {
111
                error.insertAfter(element.parent().parent());
112
            } else {
113
                error.insertAfter(element.parent());
1709 eleazar 114
            }
2015 eleazar 115
        }
116
    };
1827 eleazar 117
 
3468 eleazar 118
    var gridTable = $('#gridTable').dataTable({
119
        'processing': true,
120
        'serverSide': true,
121
        'searching': true,
122
        'order': [
123
            [0, 'asc']
124
        ],
125
        'ordering': true,
126
        'ordenable': true,
127
        'responsive': true,
128
        'select': false,
129
        'paging': true,
130
        'pagingType': 'simple_numbers',
131
        'ajax': {
132
            'url': '$routeIndex',
133
            'type': 'get',
134
            'beforeSend': function(request) {
135
                NProgress.start();
136
            },
137
            'dataFilter': function(response) {
138
                var response = jQuery.parseJSON(response);
139
                var json = {};
140
                json.recordsTotal = 0;
141
                json.recordsFiltered = 0;
142
                json.data = [];
143
                if (response.success) {
144
                    json.recordsTotal = response.data.total;
145
                    json.recordsFiltered = response.data.total;
146
                    json.data = response.data.items;
147
                } else {
148
                    $.fn.showError(response.data)
149
                }
150
                return JSON.stringify(json);
151
                gridTable.api().ajax.reload(null, false);
152
            }
153
        },
154
        'language': {
155
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
156
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
157
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
158
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
159
            'sInfo': 'LABEL_DATATABLE_SINFO',
160
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
161
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
162
            'sInfoPostFix': '',
163
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
164
            'sUrl': '',
165
            'sInfoThousands': ',',
166
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
167
            'oPaginate': {
168
                'sFirst': 'LABEL_DATATABLE_SFIRST',
169
                'sLast': 'LABEL_DATATABLE_SLAST',
170
                'sNext': 'LABEL_DATATABLE_SNEXT',
171
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
172
            },
173
            'oAria': {
174
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
175
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
176
            },
177
        },
178
        'drawCallback': function(settings) {
179
            NProgress.done();
180
            $('button.btn-delete').confirmation({
181
                rootSelector: 'button.btn-delete',
182
                title: 'LABEL_ARE_YOU_SURE',
183
                singleton: true,
184
                btnOkLabel: 'LABEL_YES',
185
                btnCancelLabel: 'LABEL_NO',
186
                onConfirm: function(value) {
187
                    action = $(this).data('href');
188
                    NProgress.start();
189
                    $.ajax({
190
                        'dataType': 'json',
191
                        'accept': 'application/json',
192
                        'method': 'post',
193
                        'url': action,
194
                    }).done(function(response) {
195
                        if (response['success']) {
196
                            $.fn.showSuccess(response['data']);
197
                            gridTable.api().ajax.reload(null, false);
198
                        } else {
199
                            $.fn.showError(response['data']);
200
                        }
201
                    }).fail(function(jqXHR, textStatus, errorThrown) {
202
                        $.fn.showError(textStatus);
203
                    }).always(function() {
204
                        NProgress.done();
205
                    });
206
                },
207
            });
208
        },
3551 eleazar 209
        'aoColumns': [
210
            {
3544 eleazar 211
                'mDataProp': function(data, type, row) {
212
                    return data.first_name + ' ' + data.last_name
213
                }
3468 eleazar 214
            },
3552 eleazar 215
            {
216
                'mDataProp': 'email'
217
            },
3468 eleazar 218
            {
3911 eleazar 219
                'mDataProp': 'type'
220
 
221
                //function(data, type, row){
222
                // data.type=='p' ? 'type="LABEL_PRE_SELECTION"'  : '';
223
                // data.type=='h' ? 'type="LABEL_HUMAN_RESOURCE"' : '';
224
                // data.type=='b' ? 'type="LABEL_BOSS"' : '';
225
                // return data.type
226
                //}
3561 eleazar 227
            },
228
            {
3888 eleazar 229
                'mDataProp': 'vacancy'
3882 eleazar 230
            },
231
            {
3956 eleazar 232
                'mDataProp': function(data, type, row) {
3965 eleazar 233
                    let ldate = new Date(Date.parse(data.last_date + " 00:00:00")) ;
234
                    return ldate.getDate() + "/" + String(lastDate.getMonth() + 1).padStart(2, '0') + "/" + lastDate.getFullYear();
3956 eleazar 235
                }
3953 eleazar 236
            },
237
            {
3468 eleazar 238
                'mDataProp': 'actions'
239
            },
240
        ],
3558 eleazar 241
        'columnDefs': [
242
            {
3468 eleazar 243
                'targets': 0,
244
                'className': 'text-vertical-middle',
245
            },
3957 eleazar 246
 
3468 eleazar 247
            {
248
                'targets': -1,
249
                'orderable': false,
250
                'render': function(data, type, row) {
251
                    s = '';
252
                    if (allowEdit) {
253
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
254
                    }
255
                    if (allowDelete) {
256
                        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;';
257
                    }
258
                    if (allowReport) {
259
                        s = s + '<a class="btn btn-default btn-pdf" href="' + data['link_report'] + '" target="_blank" data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-file-o"></i> LABEL_PDF </button>&nbsp;';
260
                    }
261
                    return s;
262
                }
263
            }
264
        ],
265
    });
266
 
2523 eleazar 267
    function getContent() {
2897 eleazar 268
        return $('[data-competency-behavior]').map(
2523 eleazar 269
            function (idx, td) {
2895 eleazar 270
                const competencyUuid = $(td).data('competency-uuid');
271
                const behaviorUuid = $(td).data('behavior-uuid');
2523 eleazar 272
                const textarea = $(td).find('textarea');
273
                const select = $(td).find('select');
2521 eleazar 274
 
2523 eleazar 275
                return {
2895 eleazar 276
                    competencyUuid: competencyUuid,
3468 eleazar 277
                    behaviorUuid : behaviorUuid,
2523 eleazar 278
                    comment: textarea.val(),
279
                    evaluation: select.val(),
280
                }
281
            }
282
        ).get()
283
    }
284
 
2537 eleazar 285
    var validator = $('#form-interview').validate({
1877 eleazar 286
        debug: true,
287
        onclick: false,
288
        onkeyup: false,
289
        ignore: [],
2534 eleazar 290
        rules: {},
1877 eleazar 291
        submitHandler: function(form) {
292
            $.ajax({
293
                'dataType': 'json',
294
                'accept': 'application/json',
295
                'method': 'post',
2809 eleazar 296
                'url': $('#form-interview').attr('action'),
2523 eleazar 297
                'data': {
2571 eleazar 298
                    content: JSON.stringify(getContent()),
2523 eleazar 299
                    vacancy_uuid: $('#vacancy_uuid').val(),
300
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 301
                    points: $('#points').val(),
2744 eleazar 302
                    comment: $('#comment').val(),
2749 eleazar 303
                    status: $('#status').val(),
2523 eleazar 304
                }
1877 eleazar 305
            }).done(function(response) {
306
                NProgress.start();
307
                if (response['success']) {
308
                    $.fn.showSuccess(response['data']);
3468 eleazar 309
                    $('#main').hide();
3454 eleazar 310
                    $('#interview').hide();
3468 eleazar 311
                    gridTable.api().ajax.reload(null, false);
1877 eleazar 312
                } else {
313
                    validator.resetForm();
314
                    if (jQuery.type(response['data']) == 'string') {
315
                        $.fn.showError(response['data']);
316
                    } else {
317
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 318
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 319
                        });
320
                    }
321
                }
322
            }).fail(function(jqXHR, textStatus, errorThrown) {
323
                $.fn.showError(textStatus);
324
            }).always(function() {
325
                NProgress.done();
326
            });
327
            return false;
328
        },
329
        invalidHandler: function(form, validator) {}
330
    });
1709 eleazar 331
 
2015 eleazar 332
    $('body').on('click', 'button.btn-add', function(e) {
3631 eleazar 333
        $('#form-interview').attr('action', "$routeAdd")
3644 eleazar 334
        $('#candidate_uuid').prop('disabled', false);
335
        $('#vacancy_uuid').prop('disabled', false);
336
        $('#vacancy_uuid').change();
3631 eleazar 337
 
2015 eleazar 338
        e.preventDefault();
3631 eleazar 339
 
2015 eleazar 340
        NProgress.start();
341
        $.ajax({
342
            'dataType': 'json',
343
            'accept': 'application/json',
344
            'method': 'get',
3631 eleazar 345
            'url': $(this).data('url'),
2015 eleazar 346
        }).done(function(response) {
347
            if (response['success']) {
2237 eleazar 348
                var data = response.data
2785 eleazar 349
                $("#interview #comment").val('');
3468 eleazar 350
                $('#interview #status').val('');
351
                $("#interview #points").val('$points_0');
3466 eleazar 352
                $("#content").hide();
353
                $("#main").show()
1877 eleazar 354
            } else {
2015 eleazar 355
                $.fn.showError(response['data']);
1877 eleazar 356
            }
2015 eleazar 357
        }).fail(function(jqXHR, textStatus, errorThrown) {
358
            $.fn.showError(textStatus);
359
        }).always(function() {
360
            NProgress.done();
1877 eleazar 361
        });
2015 eleazar 362
    });
2785 eleazar 363
 
364
    $('body').on('click', 'button.btn-edit', function(e) {
3604 eleazar 365
        var url = $(this).data('href');
2785 eleazar 366
        e.preventDefault();
367
        NProgress.start();
368
        $.ajax({
369
            'dataType': 'json',
370
            'accept': 'application/json',
371
            'method': 'get',
2807 eleazar 372
            'url': url,
2785 eleazar 373
        }).done(function(response) {
374
            if (response['success']) {
375
                var data = response.data
3635 eleazar 376
                $('#vacancy_uuid').val(data['vacancy']['uuid']);
3642 eleazar 377
                $('#vacancy_uuid').prop('disabled', true);
3640 eleazar 378
                $('#candidate_uuid').html('');
379
                var option = $('<option />')
380
                    .val(data['candidate']['uuid'])
381
                    .text(data['candidate']['first_name'] + ' ' + data['candidate']['last_name']);
382
                $('#candidate_uuid').append(option).prop('disabled', true);
3633 eleazar 383
                $("#form-interview #comment").val(data['interview']['comment']);
384
                $('#form-interview #status').val(data['interview']['status']);
385
                $("#form-interview #points").val(data['interview']['points']);
2785 eleazar 386
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 387
                data.interview.content.forEach(obj => {
2896 eleazar 388
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
389
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 390
                })
2808 eleazar 391
                $("#form-interview").attr('action', url)
3468 eleazar 392
                $("#content").hide();
393
                $("#main").show()
2785 eleazar 394
            } else {
395
                $.fn.showError(response['data']);
396
            }
397
        }).fail(function(jqXHR, textStatus, errorThrown) {
398
            $.fn.showError(textStatus);
399
        }).always(function() {
400
            NProgress.done();
401
        });
402
    });
2788 eleazar 403
 
404
    $('button.btn-delete').confirmation({
2887 eleazar 405
        rootSelector: 'button.btn-delete',
406
        title: 'LABEL_ARE_YOU_SURE',
407
        singleton: true,
408
        btnOkLabel: 'LABEL_YES',
409
        btnCancelLabel: 'LABEL_NO',
410
        onConfirm: function (value) {
411
            action = $(this).data('href');
412
            NProgress.start();
413
            $.ajax({
414
                'dataType': 'json',
415
                'accept': 'application/json',
416
                'method': 'post',
417
                'url': $(this).data('url'),
418
            }).done(function (response) {
419
                if (response['success']) {
420
                    $.fn.showSuccess(response['data']);
3468 eleazar 421
                    gridTable.api().ajax.reload(null, false);
2887 eleazar 422
                } else {
423
                    $.fn.showError(response['data']);
424
                }
425
            }).fail(function (jqXHR, textStatus, errorThrown) {
426
                $.fn.showError(textStatus);
427
            }).always(function () {
428
                NProgress.done();
2788 eleazar 429
            });
2887 eleazar 430
        },
431
    });
3468 eleazar 432
 
2015 eleazar 433
    $('body').on('click', 'button.btn-cancel', function(e) {
434
        e.preventDefault();
2521 eleazar 435
        $('#main').show();
2015 eleazar 436
        $('#row-form').hide();
437
        $('#div-listing').show();
438
    });
3468 eleazar 439
 
2015 eleazar 440
    $('#form-filter #vacancy_uuid').change(function(e) {
441
        e.preventDefault();
3468 eleazar 442
        gridTable.api().ajax.reload(null, false);
2015 eleazar 443
    })
3468 eleazar 444
 
2525 eleazar 445
     /**
446
     * Clicked cancel new/edit Form
447
     */
448
    $('button.btn-edit-cancel').click(function(e) {
449
        e.preventDefault();
3468 eleazar 450
        $("#content").show();
451
        $("#main").hide();
2525 eleazar 452
    });
453
    /**
454
     * Clicked save and continue new Form
455
     */
456
    $('button.btn-form-save-continue').click(function(e) {
457
        e.preventDefault();
458
        $('#interview #form-continue').val('1')
2540 eleazar 459
        $('#form-interview').submit();
2525 eleazar 460
    });
461
    /**
462
     * Clicked save and close new/edit Form
463
     */
464
    $('button.btn-form-save-close').click(function(e) {
465
        e.preventDefault();
466
        $('#interview #form-continue').val('0')
3468 eleazar 467
        $("#content").show();
468
        $("#main").hide();
2540 eleazar 469
        $('#form-interview').submit();
2525 eleazar 470
    });
3120 eleazar 471
 
3571 eleazar 472
    $('#vacancy_uuid').on('change', function (event) {
473
        $('#candidate_uuid').html('');
2042 eleazar 474
 
3571 eleazar 475
        var uuid = event.target.value;
3463 eleazar 476
 
3571 eleazar 477
        $.ajax({
478
            'dataType': 'json',
479
            'accept': 'application/json',
480
            'method': 'get',
481
            'url':  String('$routeVacancy').replaceAll('UUID_PLACEHOLDER', uuid),
482
        }).done(function (response) {
483
            var data = response.data
3590 eleazar 484
            $('#job-description').html($('#job-description-template').render(data));
3589 eleazar 485
            $("#competencies-job").html($("#competenciesTemplate").render(data))
3571 eleazar 486
            data.candidates.forEach(function (candidate) {
487
                var option = $('<option />')
488
                    .val(candidate.uuid)
489
                    .text(candidate.first_name)
490
                    .data('addUrl', candidate.add_url)
491
                    .data('editUrl', candidate.edit_url)
492
                    .data('deleteUrl', candidate.delete_url)
493
                    .data('reportUrl', candidate.report_url)
2038 eleazar 494
 
3571 eleazar 495
                $('#candidate_uuid').append(option);
496
            });
497
        })
498
    });
2052 eleazar 499
 
3571 eleazar 500
   $('#vacancy_uuid').change();
2785 eleazar 501
 
3341 eleazar 502
});
1709 eleazar 503
JS;
504
$this->inlineScript()->captureEnd();
505
?>
506
 
3468 eleazar 507
 
3460 eleazar 508
<!-- Content Header (Page header) -->
509
<section class="main-header">
510
	<div class="container-fluid">
511
    	<div class="row mb-2">
512
        	<div class="col-sm-12">
513
            	<h1>LABEL_INTERVIEW</h1>
514
			</div>
515
		</div>
516
	</div><!-- /.container-fluid -->
517
</section>
1709 eleazar 518
 
3460 eleazar 519
<section id="content">
520
    <div class="container-fluid">
521
        <div class="row">
522
            <div class="col-12">
523
                <div class="card">
524
                    <div class="card-header">
525
 
526
                        <?php echo $this->form()->closeTag($form); ?>
527
                    </div>
528
                    <div class="card-body">
529
                        <table id="gridTable" class="table   table-hover">
530
                            <thead>
531
                            <tr>
532
                                <th>LABEL_FIRST_NAME</th>
533
                                <th>LABEL_EMAIL</th>
3547 eleazar 534
                                <th>LABEL_TYPE_INTERVIEW</th>
3882 eleazar 535
                                <th>LABEL_VACANCIES</th>
3953 eleazar 536
                                <th>LABEL_LAST_DATE</th>
3460 eleazar 537
                                <th>LABEL_ACTIONS</th>
538
                            </tr>
539
                            </thead>
540
                            <tbody>
541
                            </tbody>
542
                        </table>
543
                    </div>
544
                    <div class="card-footer clearfix">
545
                        <div style="float:right;">
546
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
547
                        </div>
548
                    </div>
549
                </div>
550
            </div>
551
        </div>
552
    </div>
553
</section>
554
 
3459 eleazar 555
<section id="main" style="display: none;">
3451 eleazar 556
	<div class="container-fluid">
3459 eleazar 557
    	<div class="row p-2">
3454 eleazar 558
        	<div class="col-12">
3459 eleazar 559
                <?php
560
                    $form->setAttributes([
561
                        'method' => 'post',
562
                        'name' => 'form-interview',
3608 eleazar 563
                        'id' => 'form-interview',
564
                        'action' => $routeAdd
3459 eleazar 565
                    ]);
566
                    $form->prepare();
567
                    echo $this->form()->openTag($form);
568
                ?>
569
			    	<div class="card">
570
                        <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
571
                            <li class="nav-item" role="presentation">
572
                                <a class="nav-link active" id="custom-tabs-general-tab" data-toggle="tab" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
573
                            </li>
574
                            <li class="nav-item" role="presentation">
575
                                <a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="tab" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
576
                            </li>
577
                            <li class="nav-item" role="presentation">
578
                                <a class="nav-link" id="custom-tabs-evaluation-tab" data-toggle="tab" href="#custom-tabs-evaluation" role="tab" aria-controls="custom-tabs-evaluation" aria-selected="false">LABEL_CONCLUTION</a>
579
                            </li>
580
                        </ul>
581
 
582
			    		<div class="tab-content">
583
                            <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
584
                            <div class="row">
585
                                <div class="col-md-6 col-sm-12">
586
                                    <div class="form-group">
3652 eleazar 587
                                    <label for="vacancy_uuid">LABEL_VACANCIES</label>
3459 eleazar 588
                                        <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
589
                                            <?php foreach($this->vacancies as $vacancy): ?>
590
                                                <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
591
                                            <?php endforeach; ?>
592
                                        </select>
593
                                    </div>
594
                                </div>
3481 eleazar 595
                                <div class="col-md-6 col-sm-12">
3482 eleazar 596
                                    <div class="form-group">
597
                                        <label for="candidate_uuid">LABEL_CANDIDATES</label>
598
                                        <select id="candidate_uuid" name="candidate_uuid" class="form-control">
599
                                        </select>
600
                                    </div>
3481 eleazar 601
                                </div>
602
 
603
                            </div>
604
 
605
                            <div class="row p-2">
606
 
3459 eleazar 607
                                    <div id="job-description"></div>
608
                                </div>
3451 eleazar 609
                            </div>
3459 eleazar 610
                            <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
611
                                <div class="row p-2">
612
                                   <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
613
                                   </div>
614
                                </div>
3451 eleazar 615
                            </div>
3459 eleazar 616
                            <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
617
                                <div class="row p-2">
618
                                    <div class="col-12">
619
                                        <div class="form-group">
620
                                            <?php
621
                                            $element = $form->get('comment');
622
                                            $element->setOptions(['label' => 'LABEL_COMMENT']);
623
                                            $element->setAttributes(['class' => 'form-control']);
624
                                            echo $this->formLabel($element);
625
                                            echo $this->formText($element);
626
                                            ?>
627
                                        </div>
628
                                        <div class="form-group">
629
                                            <?php
630
                                            $element = $form->get('points');
631
                                            $element->setAttributes(['class' => 'form-control']);
632
                                            $element->setOptions(['label' => 'LABEL_EVALUATION']);
633
                                            echo $this->formLabel($element);
634
                                            echo $this->formSelect($element);
635
                                            ?>
636
                                        </div>
637
                                        <div class="form-group">
638
                                            <?php
639
                                            $element = $form->get('status');
640
                                            $element->setAttributes(['class' => 'form-control']);
641
                                            $element->setOptions(['label' => 'LABEL_STATUS']);
642
                                            echo $this->formLabel($element);
643
                                            echo $this->formSelect($element);
644
                                            ?>
645
                                        </div>
646
                                    </div>
647
                                </div>
648
                            </div>
649
                            <div class="card-footer clearfix">
650
                                <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
651
                                <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
652
                                <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
653
                            </div>
654
                       	</div>
3062 eleazar 655
                    </div>
3459 eleazar 656
                <?php echo $this->form()->closeTag($form); ?>
3062 eleazar 657
            </div>
658
        </div>
2015 eleazar 659
 	</div>
660
</section>
2052 eleazar 661
 
662
<script id="job-description-template" type="text/x-jsrender">
663
    <div class="card">
664
        <div class="card-body">
665
            <h5 class="card-title">{{:job_description.name}}</h5>
666
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 667
            <p class="card-text">{{:job_description.objectives}}</p>
668
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 669
        </div>
670
    </div>
2061 eleazar 671
</script>
672
 
3459 eleazar 673
<script id="competenciesTemplate" type="text/x-jsrender">
674
<table class="table table-bordered" id="panel-{{:slug_section}}">
3649 eleazar 675
 
3459 eleazar 676
    <tbody>
677
        {{for job_description.competencies}}
678
            <tr>
3651 eleazar 679
               <td colspan="2" class="text-left">{{:competency_name}}</td>
3459 eleazar 680
            </tr>
681
 
682
            {{for behaviors}}
683
                <tr>
684
                    <td colspan="2">
3649 eleazar 685
                        <table class="table table-bordered">
686
                        <thead>
3459 eleazar 687
                            <tr>
3652 eleazar 688
                               <th style="width: 20%;">LABEL_CONDUCT</th>
3649 eleazar 689
                               <th style="width: 60%;">LABEL_COMMENT</th>
690
                               <th style="width: 20%;">LABEL_EVALUATION</th>
691
                            </tr>
692
                        </thead>
693
                            <tr>
3459 eleazar 694
                                <td class="text-left">
695
                                    {{:description}}
696
                                </td>
3649 eleazar 697
                                <td style="width: 60%;" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
3459 eleazar 698
 
699
                                    <textarea
700
                                        id="textarea-{{:competency_uuid}}-{{:uuid}}"
701
                                        class="form-control"
702
                                    ></textarea>
3473 eleazar 703
                                </td>
704
                                <td>
3459 eleazar 705
 
706
                                    <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
707
                                        <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
708
                                        <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
709
                                        <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
710
                                        <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
711
                                        <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
712
                                    </select>
713
                                </td>
714
                            </tr>
715
                        </table>
716
                    </td>
717
                </tr>
718
            {{/for}}
719
        {{/for}}
720
    </tbody>
721
</table>
3468 eleazar 722
</script>