Proyectos de Subversion LeadersLinked - Backend

Rev

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

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