Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3545 | Rev 3547 | 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
            {
214
                'mDataProp': 'status'
215
            },
216
            {
217
                'mDataProp': 'actions'
218
            },
219
        ],
220
        'columnDefs': [{
221
                'targets': 0,
222
                'className': 'text-vertical-middle',
223
            },
224
            {
225
                'targets': -2,
226
                'orderable': false,
227
                'className': 'text-center',
228
                'render': function(data, type, row) {
229
                    checked = data == 'a' ? ' checked="checked" ' : '';
230
                    return '<div class="checkbox checkbox-success">' +
231
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
232
                        '<label ></label></div>';
233
                }
234
            },
235
            {
236
                'targets': -1,
237
                'orderable': false,
238
                'render': function(data, type, row) {
239
                    s = '';
240
                    if (allowEdit) {
241
                        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;';
242
                    }
243
                    if (allowDelete) {
244
                        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;';
245
                    }
246
                    if (allowReport) {
247
                        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;';
248
                    }
249
                    return s;
250
                }
251
            }
252
        ],
253
    });
254
 
2523 eleazar 255
    function getContent() {
2897 eleazar 256
        return $('[data-competency-behavior]').map(
2523 eleazar 257
            function (idx, td) {
2895 eleazar 258
                const competencyUuid = $(td).data('competency-uuid');
259
                const behaviorUuid = $(td).data('behavior-uuid');
2523 eleazar 260
                const textarea = $(td).find('textarea');
261
                const select = $(td).find('select');
2521 eleazar 262
 
2523 eleazar 263
                return {
2895 eleazar 264
                    competencyUuid: competencyUuid,
3468 eleazar 265
                    behaviorUuid : behaviorUuid,
2523 eleazar 266
                    comment: textarea.val(),
267
                    evaluation: select.val(),
268
                }
269
            }
270
        ).get()
271
    }
272
 
2537 eleazar 273
    var validator = $('#form-interview').validate({
1877 eleazar 274
        debug: true,
275
        onclick: false,
276
        onkeyup: false,
277
        ignore: [],
2534 eleazar 278
        rules: {},
1877 eleazar 279
        submitHandler: function(form) {
280
            $.ajax({
281
                'dataType': 'json',
282
                'accept': 'application/json',
283
                'method': 'post',
2809 eleazar 284
                'url': $('#form-interview').attr('action'),
2523 eleazar 285
                'data': {
2571 eleazar 286
                    content: JSON.stringify(getContent()),
2523 eleazar 287
                    vacancy_uuid: $('#vacancy_uuid').val(),
288
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 289
                    points: $('#points').val(),
2744 eleazar 290
                    comment: $('#comment').val(),
2747 eleazar 291
                    type: $('#type').val(),
2749 eleazar 292
                    status: $('#status').val(),
2523 eleazar 293
                }
1877 eleazar 294
            }).done(function(response) {
295
                NProgress.start();
296
                if (response['success']) {
297
                    $.fn.showSuccess(response['data']);
3468 eleazar 298
                    $('#main').hide();
3454 eleazar 299
                    $('#interview').hide();
3468 eleazar 300
                    gridTable.api().ajax.reload(null, false);
1877 eleazar 301
                } else {
302
                    validator.resetForm();
303
                    if (jQuery.type(response['data']) == 'string') {
304
                        $.fn.showError(response['data']);
305
                    } else {
306
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 307
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 308
                        });
309
                    }
310
                }
311
            }).fail(function(jqXHR, textStatus, errorThrown) {
312
                $.fn.showError(textStatus);
313
            }).always(function() {
314
                NProgress.done();
315
            });
316
            return false;
317
        },
318
        invalidHandler: function(form, validator) {}
319
    });
1709 eleazar 320
 
2015 eleazar 321
    $('body').on('click', 'button.btn-add', function(e) {
2812 eleazar 322
        var url = $(this).data('url');
2015 eleazar 323
        e.preventDefault();
324
        NProgress.start();
325
        $.ajax({
326
            'dataType': 'json',
327
            'accept': 'application/json',
328
            'method': 'get',
2812 eleazar 329
            'url': url,
2015 eleazar 330
        }).done(function(response) {
331
            if (response['success']) {
2237 eleazar 332
                var data = response.data
2785 eleazar 333
                $("#interview #comment").val('');
3468 eleazar 334
                $('#interview #status').val('');
2785 eleazar 335
                $('#interview #type').val('')
3468 eleazar 336
                $("#interview #points").val('$points_0');
337
 
2264 eleazar 338
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2812 eleazar 339
                $("#form-interview").attr('action', url)
3466 eleazar 340
                $("#content").hide();
341
                $("#main").show()
1877 eleazar 342
            } else {
2015 eleazar 343
                $.fn.showError(response['data']);
1877 eleazar 344
            }
2015 eleazar 345
        }).fail(function(jqXHR, textStatus, errorThrown) {
346
            $.fn.showError(textStatus);
347
        }).always(function() {
348
            NProgress.done();
1877 eleazar 349
        });
2015 eleazar 350
    });
2785 eleazar 351
 
352
    $('body').on('click', 'button.btn-edit', function(e) {
3468 eleazar 353
        var url = $(this).data('url');
2785 eleazar 354
        e.preventDefault();
355
        NProgress.start();
356
        $.ajax({
357
            'dataType': 'json',
358
            'accept': 'application/json',
359
            'method': 'get',
2807 eleazar 360
            'url': url,
2785 eleazar 361
        }).done(function(response) {
362
            if (response['success']) {
363
                var data = response.data
2798 eleazar 364
                $("#interview #comment").val(data['interview']['comment']);
3468 eleazar 365
                $('#interview #status').val(data['interview']['status']);
2798 eleazar 366
                $('#interview #type').val(data['interview']['type']);
367
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 368
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 369
                data.interview.content.forEach(obj => {
2896 eleazar 370
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
371
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 372
                })
2808 eleazar 373
                $("#form-interview").attr('action', url)
3468 eleazar 374
                $("#content").hide();
375
                $("#main").show()
2785 eleazar 376
            } else {
377
                $.fn.showError(response['data']);
378
            }
379
        }).fail(function(jqXHR, textStatus, errorThrown) {
380
            $.fn.showError(textStatus);
381
        }).always(function() {
382
            NProgress.done();
383
        });
384
    });
2788 eleazar 385
 
386
    $('button.btn-delete').confirmation({
2887 eleazar 387
        rootSelector: 'button.btn-delete',
388
        title: 'LABEL_ARE_YOU_SURE',
389
        singleton: true,
390
        btnOkLabel: 'LABEL_YES',
391
        btnCancelLabel: 'LABEL_NO',
392
        onConfirm: function (value) {
393
            action = $(this).data('href');
394
            NProgress.start();
395
            $.ajax({
396
                'dataType': 'json',
397
                'accept': 'application/json',
398
                'method': 'post',
399
                'url': $(this).data('url'),
400
            }).done(function (response) {
401
                if (response['success']) {
402
                    $.fn.showSuccess(response['data']);
3468 eleazar 403
                    gridTable.api().ajax.reload(null, false);
2887 eleazar 404
                } else {
405
                    $.fn.showError(response['data']);
406
                }
407
            }).fail(function (jqXHR, textStatus, errorThrown) {
408
                $.fn.showError(textStatus);
409
            }).always(function () {
410
                NProgress.done();
2788 eleazar 411
            });
2887 eleazar 412
        },
413
    });
3468 eleazar 414
 
2015 eleazar 415
    $('body').on('click', 'button.btn-cancel', function(e) {
416
        e.preventDefault();
2521 eleazar 417
        $('#main').show();
2015 eleazar 418
        $('#row-form').hide();
419
        $('#div-listing').show();
420
    });
3468 eleazar 421
 
2015 eleazar 422
    $('#form-filter #vacancy_uuid').change(function(e) {
423
        e.preventDefault();
3468 eleazar 424
        gridTable.api().ajax.reload(null, false);
2015 eleazar 425
    })
3468 eleazar 426
 
2525 eleazar 427
     /**
428
     * Clicked cancel new/edit Form
429
     */
430
    $('button.btn-edit-cancel').click(function(e) {
431
        e.preventDefault();
3468 eleazar 432
        $("#content").show();
433
        $("#main").hide();
2525 eleazar 434
    });
435
    /**
436
     * Clicked save and continue new Form
437
     */
438
    $('button.btn-form-save-continue').click(function(e) {
439
        e.preventDefault();
440
        $('#interview #form-continue').val('1')
2540 eleazar 441
        $('#form-interview').submit();
2525 eleazar 442
    });
443
    /**
444
     * Clicked save and close new/edit Form
445
     */
446
    $('button.btn-form-save-close').click(function(e) {
447
        e.preventDefault();
448
        $('#interview #form-continue').val('0')
3468 eleazar 449
        $("#content").show();
450
        $("#main").hide();
2540 eleazar 451
        $('#form-interview').submit();
2525 eleazar 452
    });
3120 eleazar 453
 
3538 eleazar 454
    // $('#vacancy_uuid').on('change', function (event) {
455
    //     $('#candidate_uuid').html('');
2042 eleazar 456
 
3538 eleazar 457
    //     var uuid = event.target.value;
3463 eleazar 458
 
3538 eleazar 459
    //     $("#add-button").data('url', String('$routeAdd').replaceAll('UUID_PLACEHOLDER', uuid))
3463 eleazar 460
 
3538 eleazar 461
    //     $.ajax({
462
    //         'dataType': 'json',
463
    //         'accept': 'application/json',
464
    //         'method': 'get',
465
    //         'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
466
    //     }).done(function (response) {
467
    //         var data = response.data
2038 eleazar 468
 
3538 eleazar 469
    //         data.candidates.forEach(function (candidate) {
470
    //             var option = $('<option />')
471
    //                 .val(candidate.uuid)
472
    //                 .text(candidate.first_name)
473
    //                 .data('addUrl', candidate.add_url)
474
    //                 .data('editUrl', candidate.edit_url)
475
    //                 .data('deleteUrl', candidate.delete_url)
476
    //                 .data('reportUrl', candidate.report_url)
3468 eleazar 477
 
3538 eleazar 478
    //             $('#candidate_uuid').append(option);
479
    //         });
2052 eleazar 480
 
3538 eleazar 481
    //         $('#job-description').html($('#job-description-template').render(response.data));
482
    //     })
483
    // });
2785 eleazar 484
 
3538 eleazar 485
//    $('#vacancy_uuid').change();
2032 eleazar 486
 
3341 eleazar 487
});
1709 eleazar 488
JS;
489
$this->inlineScript()->captureEnd();
490
?>
491
 
3468 eleazar 492
 
3460 eleazar 493
<!-- Content Header (Page header) -->
494
<section class="main-header">
495
	<div class="container-fluid">
496
    	<div class="row mb-2">
497
        	<div class="col-sm-12">
498
            	<h1>LABEL_INTERVIEW</h1>
499
			</div>
500
		</div>
501
	</div><!-- /.container-fluid -->
502
</section>
1709 eleazar 503
 
3460 eleazar 504
<section id="content">
505
    <div class="container-fluid">
506
        <div class="row">
507
            <div class="col-12">
508
                <div class="card">
509
                    <div class="card-header">
510
 
511
                        <?php echo $this->form()->closeTag($form); ?>
512
                    </div>
513
                    <div class="card-body">
514
                        <table id="gridTable" class="table   table-hover">
515
                            <thead>
516
                            <tr>
517
                                <th>LABEL_FIRST_NAME</th>
518
                                <th>LABEL_EMAIL</th>
3546 eleazar 519
                                <th>LABEL_TYPE</th>
3460 eleazar 520
                                <th>LABEL_ACTIONS</th>
521
                            </tr>
522
                            </thead>
523
                            <tbody>
524
                            </tbody>
525
                        </table>
526
                    </div>
527
                    <div class="card-footer clearfix">
528
                        <div style="float:right;">
529
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
530
                        </div>
531
                    </div>
532
                </div>
533
            </div>
534
        </div>
535
    </div>
536
</section>
537
 
3459 eleazar 538
<section id="main" style="display: none;">
3451 eleazar 539
	<div class="container-fluid">
3459 eleazar 540
    	<div class="row p-2">
3454 eleazar 541
        	<div class="col-12">
3459 eleazar 542
                <?php
543
                    $form->setAttributes([
544
                        'method' => 'post',
545
                        'name' => 'form-interview',
546
                        'id' => 'form-interview'
547
                    ]);
548
                    $form->prepare();
549
                    echo $this->form()->openTag($form);
550
                ?>
551
			    	<div class="card">
552
                        <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
553
                            <li class="nav-item" role="presentation">
554
                                <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>
555
                            </li>
556
                            <li class="nav-item" role="presentation">
557
                                <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>
558
                            </li>
559
                            <li class="nav-item" role="presentation">
560
                                <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>
561
                            </li>
562
                        </ul>
563
 
564
			    		<div class="tab-content">
565
                            <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
566
                            <div class="row">
567
                                <div class="col-md-6 col-sm-12">
568
                                    <div class="form-group">
3451 eleazar 569
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
3459 eleazar 570
                                        <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
571
                                            <?php foreach($this->vacancies as $vacancy): ?>
572
                                                <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
573
                                            <?php endforeach; ?>
574
                                        </select>
575
                                    </div>
576
                                </div>
3481 eleazar 577
                                <div class="col-md-6 col-sm-12">
3482 eleazar 578
                                    <div class="form-group">
579
                                        <label for="candidate_uuid">LABEL_CANDIDATES</label>
580
                                        <select id="candidate_uuid" name="candidate_uuid" class="form-control">
581
                                        </select>
582
                                    </div>
3481 eleazar 583
                                </div>
584
 
585
                            </div>
586
 
587
                            <div class="row p-2">
588
 
3459 eleazar 589
                                    <div id="job-description"></div>
590
                                </div>
3451 eleazar 591
                            </div>
3459 eleazar 592
                            <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
593
                                <div class="row p-2">
594
                                   <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
595
                                   </div>
596
                                </div>
3451 eleazar 597
                            </div>
3459 eleazar 598
                            <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
599
                                <div class="row p-2">
600
                                    <div class="col-12">
601
                                        <div class="form-group">
602
                                            <?php
603
                                            $element = $form->get('comment');
604
                                            $element->setOptions(['label' => 'LABEL_COMMENT']);
605
                                            $element->setAttributes(['class' => 'form-control']);
606
                                            echo $this->formLabel($element);
607
                                            echo $this->formText($element);
608
                                            ?>
609
                                        </div>
610
                                        <div class="form-group">
611
                                            <?php
612
                                            $element = $form->get('points');
613
                                            $element->setAttributes(['class' => 'form-control']);
614
                                            $element->setOptions(['label' => 'LABEL_EVALUATION']);
615
                                            echo $this->formLabel($element);
616
                                            echo $this->formSelect($element);
617
                                            ?>
618
                                        </div>
619
                                        <div class="form-group">
620
                                            <?php
621
                                            $element = $form->get('status');
622
                                            $element->setAttributes(['class' => 'form-control']);
623
                                            $element->setOptions(['label' => 'LABEL_STATUS']);
624
                                            echo $this->formLabel($element);
625
                                            echo $this->formSelect($element);
626
                                            ?>
627
                                        </div>
628
                                        <div class="form-group">
629
                                            <?php
630
                                            $element = $form->get('type');
631
                                            $element->setAttributes(['class' => 'form-control']);
632
                                            $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
633
                                            echo $this->formLabel($element);
634
                                            echo $this->formSelect($element);
635
                                            ?>
636
                                        </div>
637
                                    </div>
638
                                </div>
639
                            </div>
640
                            <div class="card-footer clearfix">
641
                                <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
642
                                <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
643
                                <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
644
                            </div>
645
                       	</div>
3062 eleazar 646
                    </div>
3459 eleazar 647
                <?php echo $this->form()->closeTag($form); ?>
3062 eleazar 648
            </div>
649
        </div>
2015 eleazar 650
 	</div>
651
</section>
2052 eleazar 652
 
653
<script id="job-description-template" type="text/x-jsrender">
654
    <div class="card">
655
        <div class="card-body">
656
            <h5 class="card-title">{{:job_description.name}}</h5>
657
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 658
            <p class="card-text">{{:job_description.objectives}}</p>
659
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 660
        </div>
661
    </div>
2061 eleazar 662
</script>
663
 
3459 eleazar 664
<script id="competenciesTemplata" type="text/x-jsrender">
665
<table class="table table-bordered" id="panel-{{:slug_section}}">
2293 eleazar 666
    <thead>
667
        <tr>
2306 eleazar 668
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 669
           <th style="width: 50%;">LABEL_TITLE</th>
670
        </tr>
3459 eleazar 671
    </thead>
2300 eleazar 672
    <tbody>
673
        {{for job_description.competencies}}
674
            <tr>
675
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 676
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 677
            </tr>
3459 eleazar 678
 
2302 eleazar 679
            {{for behaviors}}
2308 eleazar 680
                <tr>
2302 eleazar 681
                   <td class="text-left">--LABEL_CONDUCT</td>
682
                   <td class="text-left">
2303 eleazar 683
                      {{:description}}
3459 eleazar 684
                   </td>
3393 eleazar 685
                </tr>
686
                <tr>
687
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
3391 eleazar 688
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
3459 eleazar 689
 
2519 eleazar 690
                        <textarea
2851 eleazar 691
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 692
                            class="form-control"
693
                        ></textarea>
3459 eleazar 694
 
2888 eleazar 695
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 696
 
2889 eleazar 697
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 698
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
699
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
700
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
701
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
702
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
703
                        </select>
3392 eleazar 704
                    </td>
2506 eleazar 705
                </tr>
706
            {{/for}}
707
 
2300 eleazar 708
        {{/for}}
709
    </tbody>
2293 eleazar 710
</table>
2241 eleazar 711
</script>
3459 eleazar 712
 
713
<script id="competenciesTemplate" type="text/x-jsrender">
714
<table class="table table-bordered" id="panel-{{:slug_section}}">
715
    <thead>
716
        <tr>
717
           <th style="width: 50%;">LABEL_ELEMENT</th>
718
           <th style="width: 50%;">LABEL_TITLE</th>
719
        </tr>
720
    </thead>
721
    <tbody>
722
        {{for job_description.competencies}}
723
            <tr>
724
               <td class="text-left">LABEL_COMPETENCY</td>
725
               <td class="text-left">{{:competency_name}}</td>
726
            </tr>
727
 
728
            {{for behaviors}}
729
                <tr>
730
                    <td colspan="2">
731
                        <table class="table table-borderless">
732
                            <tr>
3477 eleazar 733
 
3459 eleazar 734
                                <td class="text-left">
735
                                    {{:description}}
736
                                </td>
3474 eleazar 737
                                <td colspan="3" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
3459 eleazar 738
                                    <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
739
 
740
                                    <textarea
741
                                        id="textarea-{{:competency_uuid}}-{{:uuid}}"
742
                                        class="form-control"
743
                                    ></textarea>
3473 eleazar 744
                                </td>
745
                                <td>
3459 eleazar 746
                                    <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
747
 
748
                                    <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
749
                                        <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
750
                                        <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
751
                                        <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
752
                                        <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
753
                                        <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
754
                                    </select>
755
                                </td>
756
                            </tr>
757
                        </table>
758
                    </td>
759
                </tr>
760
            {{/for}}
761
        {{/for}}
762
    </tbody>
763
</table>
3468 eleazar 764
</script>