Proyectos de Subversion LeadersLinked - Backend

Rev

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