Proyectos de Subversion LeadersLinked - Backend

Rev

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

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