Proyectos de Subversion LeadersLinked - Backend

Rev

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

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