Proyectos de Subversion LeadersLinked - Backend

Rev

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

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