Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 4346 | Rev 4363 | 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');
3573 eleazar 8
$routeVacancy = $this->url('recruitment-and-selection/interview/vacancy', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
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
 
4158 eleazar 58
$status_acepted = \LeadersLinked\Model\RecruitmentSelectionInterview::STATUS_ACCEPTED;
4157 eleazar 59
$status_rejected = \LeadersLinked\Model\RecruitmentSelectionInterview::STATUS_REJECTED;
2510 eleazar 60
 
61
$points_0 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_0;
62
$points_1 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_1;
63
$points_2 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_2;
64
$points_3 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_3;
65
$points_4 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_4;
66
 
67
 
68
 
1709 eleazar 69
$this->headStyle()->captureStart();
70
echo <<<CSS
71
 
72
CSS;
73
$this->headStyle()->captureEnd();
74
 
75
$this->inlineScript()->captureStart();
76
echo <<<JS
77
 
78
jQuery( document ).ready(function( $ ) {
3535 eleazar 79
    var allowDelete = $allowDelete;
80
    var allowEdit = $allowEdit;
81
    var allowReport = $allowReport;
1877 eleazar 82
    $.validator.setDefaults({
2015 eleazar 83
        debug: true,
84
        highlight: function(element) {
85
            $(element).addClass('is-invalid');
86
        },
87
        unhighlight: function(element) {
88
            $(element).removeClass('is-invalid');
89
        },
90
        errorElement: 'span',
91
        errorClass: 'error invalid-feedback',
92
        errorPlacement: function(error, element) {
93
            if(element.parent('.btn-file').length) {
94
                error.insertAfter(element.parent().parent());
95
            } else if(element.parent('.toggle').length) {
96
                error.insertAfter(element.parent().parent());
97
            } else {
98
                error.insertAfter(element.parent());
1709 eleazar 99
            }
2015 eleazar 100
        }
101
    });
3468 eleazar 102
 
2015 eleazar 103
    $.fn.showFormErrorValidator = function(fieldname, errors) {
104
        var field = $(fieldname);
105
        if(field) {
106
            $(field).addClass('is-invalid');
1709 eleazar 107
 
2015 eleazar 108
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
3468 eleazar 109
 
2015 eleazar 110
            if(element.parent('.btn-file').length) {
111
                error.insertAfter(element.parent().parent());
112
            } else if(element.parent('.toggle').length) {
113
                error.insertAfter(element.parent().parent());
114
            } else {
115
                error.insertAfter(element.parent());
1709 eleazar 116
            }
2015 eleazar 117
        }
118
    };
1827 eleazar 119
 
3468 eleazar 120
    var gridTable = $('#gridTable').dataTable({
121
        'processing': true,
122
        'serverSide': true,
123
        'searching': true,
124
        'order': [
125
            [0, 'asc']
126
        ],
127
        'ordering': true,
128
        'ordenable': true,
129
        'responsive': true,
130
        'select': false,
131
        'paging': true,
132
        'pagingType': 'simple_numbers',
133
        'ajax': {
134
            'url': '$routeIndex',
135
            'type': 'get',
136
            'beforeSend': function(request) {
137
                NProgress.start();
138
            },
139
            'dataFilter': function(response) {
140
                var response = jQuery.parseJSON(response);
141
                var json = {};
142
                json.recordsTotal = 0;
143
                json.recordsFiltered = 0;
144
                json.data = [];
145
                if (response.success) {
146
                    json.recordsTotal = response.data.total;
147
                    json.recordsFiltered = response.data.total;
148
                    json.data = response.data.items;
149
                } else {
150
                    $.fn.showError(response.data)
151
                }
152
                return JSON.stringify(json);
153
                gridTable.api().ajax.reload(null, false);
154
            }
155
        },
156
        'language': {
157
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
158
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
159
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
160
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
161
            'sInfo': 'LABEL_DATATABLE_SINFO',
162
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
163
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
164
            'sInfoPostFix': '',
165
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
166
            'sUrl': '',
167
            'sInfoThousands': ',',
168
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
169
            'oPaginate': {
170
                'sFirst': 'LABEL_DATATABLE_SFIRST',
171
                'sLast': 'LABEL_DATATABLE_SLAST',
172
                'sNext': 'LABEL_DATATABLE_SNEXT',
173
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
174
            },
175
            'oAria': {
176
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
177
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
178
            },
179
        },
180
        'drawCallback': function(settings) {
181
            NProgress.done();
182
            $('button.btn-delete').confirmation({
183
                rootSelector: 'button.btn-delete',
184
                title: 'LABEL_ARE_YOU_SURE',
185
                singleton: true,
186
                btnOkLabel: 'LABEL_YES',
187
                btnCancelLabel: 'LABEL_NO',
188
                onConfirm: function(value) {
189
                    action = $(this).data('href');
190
                    NProgress.start();
191
                    $.ajax({
192
                        'dataType': 'json',
193
                        'accept': 'application/json',
194
                        'method': 'post',
195
                        'url': action,
196
                    }).done(function(response) {
197
                        if (response['success']) {
198
                            $.fn.showSuccess(response['data']);
199
                            gridTable.api().ajax.reload(null, false);
200
                        } else {
201
                            $.fn.showError(response['data']);
202
                        }
203
                    }).fail(function(jqXHR, textStatus, errorThrown) {
204
                        $.fn.showError(textStatus);
205
                    }).always(function() {
206
                        NProgress.done();
207
                    });
208
                },
209
            });
210
        },
3551 eleazar 211
        'aoColumns': [
212
            {
3544 eleazar 213
                'mDataProp': function(data, type, row) {
214
                    return data.first_name + ' ' + data.last_name
215
                }
3468 eleazar 216
            },
3552 eleazar 217
            {
218
                'mDataProp': 'email'
219
            },
3468 eleazar 220
            {
4032 eleazar 221
                'mDataProp': function(data, type, row){
222
                    switch(data.type) {
4033 eleazar 223
                        case 'r':
4032 eleazar 224
                            return 'LABEL_HUMAN_RESOURCE'
225
                        case 'b':
4034 eleazar 226
                            return 'LABEL_BOSS_INTERVIEW'
4032 eleazar 227
                        default:
228
                            return data.type
229
                    }
230
                }
3561 eleazar 231
            },
232
            {
3888 eleazar 233
                'mDataProp': 'vacancy'
3882 eleazar 234
            },
235
            {
3956 eleazar 236
                'mDataProp': function(data, type, row) {
3965 eleazar 237
                    let ldate = new Date(Date.parse(data.last_date + " 00:00:00")) ;
3967 eleazar 238
                    return ldate.getDate() + "/" + String(ldate.getMonth() + 1).padStart(2, '0') + "/" + ldate.getFullYear();
3956 eleazar 239
                }
3953 eleazar 240
            },
241
            {
3468 eleazar 242
                'mDataProp': 'actions'
243
            },
244
        ],
3558 eleazar 245
        'columnDefs': [
246
            {
3468 eleazar 247
                'targets': 0,
248
                'className': 'text-vertical-middle',
249
            },
3957 eleazar 250
 
3468 eleazar 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(),
2749 eleazar 307
                    status: $('#status').val(),
2523 eleazar 308
                }
1877 eleazar 309
            }).done(function(response) {
310
                NProgress.start();
311
                if (response['success']) {
312
                    $.fn.showSuccess(response['data']);
3468 eleazar 313
                    $('#main').hide();
3454 eleazar 314
                    $('#interview').hide();
3468 eleazar 315
                    gridTable.api().ajax.reload(null, false);
1877 eleazar 316
                } else {
317
                    validator.resetForm();
318
                    if (jQuery.type(response['data']) == 'string') {
319
                        $.fn.showError(response['data']);
320
                    } else {
321
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 322
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 323
                        });
324
                    }
325
                }
326
            }).fail(function(jqXHR, textStatus, errorThrown) {
327
                $.fn.showError(textStatus);
328
            }).always(function() {
329
                NProgress.done();
330
            });
331
            return false;
332
        },
333
        invalidHandler: function(form, validator) {}
334
    });
1709 eleazar 335
 
2015 eleazar 336
    $('body').on('click', 'button.btn-add', function(e) {
3631 eleazar 337
        $('#form-interview').attr('action', "$routeAdd")
3644 eleazar 338
        $('#candidate_uuid').prop('disabled', false);
339
        $('#vacancy_uuid').prop('disabled', false);
340
        $('#vacancy_uuid').change();
3631 eleazar 341
 
2015 eleazar 342
        e.preventDefault();
3631 eleazar 343
 
2015 eleazar 344
        NProgress.start();
345
        $.ajax({
346
            'dataType': 'json',
347
            'accept': 'application/json',
348
            'method': 'get',
3631 eleazar 349
            'url': $(this).data('url'),
2015 eleazar 350
        }).done(function(response) {
351
            if (response['success']) {
2237 eleazar 352
                var data = response.data
4159 eleazar 353
                $("#form-interview #comment").val('');
354
                $('#form-interview #status').val('$status_acepted');
355
                $("#form-interview #points").val('$points_0');
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) {
3604 eleazar 369
        var url = $(this).data('href');
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
3635 eleazar 380
                $('#vacancy_uuid').val(data['vacancy']['uuid']);
3642 eleazar 381
                $('#vacancy_uuid').prop('disabled', true);
3640 eleazar 382
                $('#candidate_uuid').html('');
383
                var option = $('<option />')
384
                    .val(data['candidate']['uuid'])
385
                    .text(data['candidate']['first_name'] + ' ' + data['candidate']['last_name']);
386
                $('#candidate_uuid').append(option).prop('disabled', true);
3633 eleazar 387
                $("#form-interview #comment").val(data['interview']['comment']);
388
                $('#form-interview #status').val(data['interview']['status']);
389
                $("#form-interview #points").val(data['interview']['points']);
2785 eleazar 390
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 391
                data.interview.content.forEach(obj => {
2896 eleazar 392
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
393
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 394
                })
2808 eleazar 395
                $("#form-interview").attr('action', url)
3468 eleazar 396
                $("#content").hide();
397
                $("#main").show()
2785 eleazar 398
            } else {
399
                $.fn.showError(response['data']);
400
            }
401
        }).fail(function(jqXHR, textStatus, errorThrown) {
402
            $.fn.showError(textStatus);
403
        }).always(function() {
404
            NProgress.done();
405
        });
406
    });
2788 eleazar 407
 
408
    $('button.btn-delete').confirmation({
2887 eleazar 409
        rootSelector: 'button.btn-delete',
410
        title: 'LABEL_ARE_YOU_SURE',
411
        singleton: true,
412
        btnOkLabel: 'LABEL_YES',
413
        btnCancelLabel: 'LABEL_NO',
414
        onConfirm: function (value) {
415
            action = $(this).data('href');
416
            NProgress.start();
417
            $.ajax({
418
                'dataType': 'json',
419
                'accept': 'application/json',
420
                'method': 'post',
421
                'url': $(this).data('url'),
422
            }).done(function (response) {
423
                if (response['success']) {
424
                    $.fn.showSuccess(response['data']);
3468 eleazar 425
                    gridTable.api().ajax.reload(null, false);
2887 eleazar 426
                } else {
427
                    $.fn.showError(response['data']);
428
                }
429
            }).fail(function (jqXHR, textStatus, errorThrown) {
430
                $.fn.showError(textStatus);
431
            }).always(function () {
432
                NProgress.done();
2788 eleazar 433
            });
2887 eleazar 434
        },
435
    });
3468 eleazar 436
 
2015 eleazar 437
    $('body').on('click', 'button.btn-cancel', function(e) {
438
        e.preventDefault();
2521 eleazar 439
        $('#main').show();
2015 eleazar 440
        $('#row-form').hide();
441
        $('#div-listing').show();
442
    });
3468 eleazar 443
 
2015 eleazar 444
    $('#form-filter #vacancy_uuid').change(function(e) {
445
        e.preventDefault();
3468 eleazar 446
        gridTable.api().ajax.reload(null, false);
2015 eleazar 447
    })
3468 eleazar 448
 
2525 eleazar 449
     /**
450
     * Clicked cancel new/edit Form
451
     */
452
    $('button.btn-edit-cancel').click(function(e) {
453
        e.preventDefault();
3468 eleazar 454
        $("#content").show();
455
        $("#main").hide();
2525 eleazar 456
    });
457
    /**
458
     * Clicked save and continue new Form
459
     */
460
    $('button.btn-form-save-continue').click(function(e) {
461
        e.preventDefault();
4162 eleazar 462
        $('#form-interview #form-continue').val('1')
2540 eleazar 463
        $('#form-interview').submit();
2525 eleazar 464
    });
465
    /**
466
     * Clicked save and close new/edit Form
467
     */
468
    $('button.btn-form-save-close').click(function(e) {
469
        e.preventDefault();
4162 eleazar 470
        $('#form-interview #form-continue').val('0')
3468 eleazar 471
        $("#content").show();
472
        $("#main").hide();
2540 eleazar 473
        $('#form-interview').submit();
4157 eleazar 474
        gridTable.api().ajax.reload(null, false);
2525 eleazar 475
    });
3120 eleazar 476
 
3571 eleazar 477
    $('#vacancy_uuid').on('change', function (event) {
478
        $('#candidate_uuid').html('');
2042 eleazar 479
 
3571 eleazar 480
        var uuid = event.target.value;
3463 eleazar 481
 
3571 eleazar 482
        $.ajax({
483
            'dataType': 'json',
484
            'accept': 'application/json',
485
            'method': 'get',
486
            'url':  String('$routeVacancy').replaceAll('UUID_PLACEHOLDER', uuid),
487
        }).done(function (response) {
488
            var data = response.data
3590 eleazar 489
            $('#job-description').html($('#job-description-template').render(data));
3589 eleazar 490
            $("#competencies-job").html($("#competenciesTemplate").render(data))
3571 eleazar 491
            data.candidates.forEach(function (candidate) {
492
                var option = $('<option />')
493
                    .val(candidate.uuid)
494
                    .text(candidate.first_name)
495
                    .data('addUrl', candidate.add_url)
496
                    .data('editUrl', candidate.edit_url)
497
                    .data('deleteUrl', candidate.delete_url)
498
                    .data('reportUrl', candidate.report_url)
2038 eleazar 499
 
3571 eleazar 500
                $('#candidate_uuid').append(option);
501
            });
502
        })
503
    });
2052 eleazar 504
 
3571 eleazar 505
   $('#vacancy_uuid').change();
2785 eleazar 506
 
3341 eleazar 507
});
1709 eleazar 508
JS;
509
$this->inlineScript()->captureEnd();
510
?>
511
 
3468 eleazar 512
 
3460 eleazar 513
<!-- Content Header (Page header) -->
514
<section class="main-header">
515
	<div class="container-fluid">
516
    	<div class="row mb-2">
517
        	<div class="col-sm-12">
518
            	<h1>LABEL_INTERVIEW</h1>
519
			</div>
520
		</div>
521
	</div><!-- /.container-fluid -->
522
</section>
1709 eleazar 523
 
3460 eleazar 524
<section id="content">
525
    <div class="container-fluid">
526
        <div class="row">
527
            <div class="col-12">
528
                <div class="card">
529
                    <div class="card-header">
4346 eleazar 530
                    <div class="col-md-6 col-sm-12">
531
                                        <div class="form-group">
532
                                        <label for="vacancy_uuid">LABEL_VACANCIES</label>
4347 eleazar 533
                                            <select id="filter_vacancy_uuid" name="vacancy_uuid" class="form-control">
4346 eleazar 534
                                                <?php foreach($this->vacancies as $vacancy): ?>
535
                                                    <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
536
                                                <?php endforeach; ?>
537
                                            </select>
538
                                        </div>
539
                                    </div>
3460 eleazar 540
                        <?php echo $this->form()->closeTag($form); ?>
541
                    </div>
542
                    <div class="card-body">
543
                        <table id="gridTable" class="table   table-hover">
544
                            <thead>
545
                            <tr>
546
                                <th>LABEL_FIRST_NAME</th>
547
                                <th>LABEL_EMAIL</th>
3547 eleazar 548
                                <th>LABEL_TYPE_INTERVIEW</th>
3882 eleazar 549
                                <th>LABEL_VACANCIES</th>
3953 eleazar 550
                                <th>LABEL_LAST_DATE</th>
3460 eleazar 551
                                <th>LABEL_ACTIONS</th>
552
                            </tr>
553
                            </thead>
554
                            <tbody>
555
                            </tbody>
556
                        </table>
557
                    </div>
558
                    <div class="card-footer clearfix">
559
                        <div style="float:right;">
560
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
561
                        </div>
562
                    </div>
563
                </div>
564
            </div>
565
        </div>
566
    </div>
567
</section>
568
 
3459 eleazar 569
<section id="main" style="display: none;">
3451 eleazar 570
	<div class="container-fluid">
4165 eleazar 571
 
4162 eleazar 572
        	<div class="row p-2">
573
            	<div class="col-12">
574
                    <?php
575
                        $form->setAttributes([
576
                            'method' => 'post',
577
                            'name' => 'form-interview',
578
                            'id' => 'form-interview',
579
                            'action' => $routeAdd
580
                        ]);
581
                        $form->prepare();
582
                        echo $this->form()->openTag($form);
583
                    ?>
584
	    		    	<div class="card">
585
                            <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
586
                                <li class="nav-item" role="presentation">
587
                                    <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>
588
                                </li>
589
                                <li class="nav-item" role="presentation">
590
                                    <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>
591
                                </li>
592
                                <li class="nav-item" role="presentation">
593
                                    <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>
594
                                </li>
595
                            </ul>
3459 eleazar 596
 
4162 eleazar 597
	    		    		<div class="tab-content">
598
                                <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
599
                                <div class="row">
600
                                    <div class="col-md-6 col-sm-12">
601
                                        <div class="form-group">
602
                                        <label for="vacancy_uuid">LABEL_VACANCIES</label>
603
                                            <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
604
                                                <?php foreach($this->vacancies as $vacancy): ?>
605
                                                    <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
606
                                                <?php endforeach; ?>
607
                                            </select>
608
                                        </div>
3459 eleazar 609
                                    </div>
4162 eleazar 610
                                    <div class="col-md-6 col-sm-12">
611
                                        <div class="form-group">
612
                                            <label for="candidate_uuid">LABEL_CANDIDATES</label>
613
                                            <select id="candidate_uuid" name="candidate_uuid" class="form-control">
614
                                            </select>
615
                                        </div>
3482 eleazar 616
                                    </div>
4162 eleazar 617
 
3481 eleazar 618
                                </div>
619
 
3459 eleazar 620
                                <div class="row p-2">
4162 eleazar 621
 
622
                                        <div id="job-description"></div>
623
                                    </div>
3459 eleazar 624
                                </div>
4162 eleazar 625
                                <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
626
                                    <div class="row p-2">
627
                                       <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
628
                                       </div>
629
                                    </div>
630
                                </div>
631
                                <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
632
                                    <div class="row p-2">
633
                                        <div class="col-12">
634
                                            <div class="form-group">
635
                                                <?php
636
                                                $element = $form->get('comment');
637
                                                $element->setOptions(['label' => 'LABEL_COMMENT']);
638
                                                $element->setAttributes(['class' => 'form-control']);
639
                                                echo $this->formLabel($element);
640
                                                echo $this->formText($element);
641
                                                ?>
642
                                            </div>
643
                                            <div class="form-group">
644
                                                <?php
645
                                                $element = $form->get('points');
646
                                                $element->setAttributes(['class' => 'form-control']);
647
                                                $element->setOptions(['label' => 'LABEL_EVALUATION']);
648
                                                echo $this->formLabel($element);
649
                                                echo $this->formSelect($element);
650
                                                ?>
651
                                            </div>
652
                                            <div class="form-group">
653
                                                <?php
654
                                                $element = $form->get('status');
655
                                                $element->setAttributes(['class' => 'form-control']);
656
                                                $element->setOptions(['label' => 'LABEL_STATUS']);
657
                                                echo $this->formLabel($element);
658
                                                echo $this->formSelect($element);
659
                                                ?>
660
                                            </div>
3459 eleazar 661
                                        </div>
662
                                    </div>
663
                                </div>
4162 eleazar 664
                                <div class="card-footer clearfix">
665
                                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
666
                                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
667
                                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
668
                                </div>
669
                           	</div>
670
                        </div>
671
                    <?php echo $this->form()->closeTag($form); ?>
672
                </div>
3062 eleazar 673
            </div>
4165 eleazar 674
 
2015 eleazar 675
 	</div>
676
</section>
2052 eleazar 677
 
678
<script id="job-description-template" type="text/x-jsrender">
679
    <div class="card">
680
        <div class="card-body">
681
            <h5 class="card-title">{{:job_description.name}}</h5>
682
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 683
            <p class="card-text">{{:job_description.objectives}}</p>
684
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 685
        </div>
686
    </div>
2061 eleazar 687
</script>
688
 
3459 eleazar 689
<script id="competenciesTemplate" type="text/x-jsrender">
690
<table class="table table-bordered" id="panel-{{:slug_section}}">
3649 eleazar 691
 
3459 eleazar 692
    <tbody>
693
        {{for job_description.competencies}}
694
            <tr>
3651 eleazar 695
               <td colspan="2" class="text-left">{{:competency_name}}</td>
3459 eleazar 696
            </tr>
697
 
698
            {{for behaviors}}
699
                <tr>
700
                    <td colspan="2">
3649 eleazar 701
                        <table class="table table-bordered">
702
                        <thead>
3459 eleazar 703
                            <tr>
3652 eleazar 704
                               <th style="width: 20%;">LABEL_CONDUCT</th>
3649 eleazar 705
                               <th style="width: 60%;">LABEL_COMMENT</th>
706
                               <th style="width: 20%;">LABEL_EVALUATION</th>
707
                            </tr>
708
                        </thead>
4090 eleazar 709
                            <tr data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
710
                                <td class="text-left" style="width: 20%;">
3459 eleazar 711
                                    {{:description}}
712
                                </td>
4089 eleazar 713
                                <td style="width: 60%;">
3459 eleazar 714
 
715
                                    <textarea
716
                                        id="textarea-{{:competency_uuid}}-{{:uuid}}"
717
                                        class="form-control"
718
                                    ></textarea>
3473 eleazar 719
                                </td>
4090 eleazar 720
                                <td style="width: 20%;">
721
 
4069 eleazar 722
                                    <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
4219 eleazar 723
                                        <option value="<?= $points_0 ?>"><?= '0%' ?></option>
724
                                        <option value="<?= $points_1 ?>"><?= '25%' ?></option>
725
                                        <option value="<?= $points_2 ?>"><?= '50%' ?></option>
726
                                        <option value="<?= $points_3 ?>"><?= '75%' ?></option>
727
                                        <option value="<?= $points_4 ?>"><?= '100%' ?></option>
4090 eleazar 728
                                    </select>
3459 eleazar 729
                                </td>
730
                            </tr>
731
                        </table>
732
                    </td>
733
                </tr>
734
            {{/for}}
735
        {{/for}}
736
    </tbody>
737
</table>
3468 eleazar 738
</script>