Proyectos de Subversion LeadersLinked - Backend

Rev

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