Proyectos de Subversion LeadersLinked - Backend

Rev

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