Proyectos de Subversion LeadersLinked - Backend

Rev

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