Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3361 | Rev 3381 | 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');
3344 eleazar 7
$routeAdd = $this->url('recruitment-and-selection/interview/form/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
1877 eleazar 8
 
1827 eleazar 9
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/add') ? 1 : 0;
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);
3169 eleazar 144
                gridTable.api().ajax.reload(null, false);
3094 eleazar 145
            }
146
        },
147
        'language': {
148
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
149
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
150
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
151
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
152
            'sInfo': 'LABEL_DATATABLE_SINFO',
153
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
154
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
155
            'sInfoPostFix': '',
156
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
157
            'sUrl': '',
158
            'sInfoThousands': ',',
159
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
160
            'oPaginate': {
161
                'sFirst': 'LABEL_DATATABLE_SFIRST',
162
                'sLast': 'LABEL_DATATABLE_SLAST',
163
                'sNext': 'LABEL_DATATABLE_SNEXT',
164
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
165
            },
166
            'oAria': {
167
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
168
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
169
            },
170
        },
171
        'drawCallback': function(settings) {
172
            NProgress.done();
173
            $('button.btn-delete').confirmation({
174
                rootSelector: 'button.btn-delete',
175
                title: 'LABEL_ARE_YOU_SURE',
176
                singleton: true,
177
                btnOkLabel: 'LABEL_YES',
178
                btnCancelLabel: 'LABEL_NO',
179
                onConfirm: function(value) {
180
                    action = $(this).data('href');
181
                    NProgress.start();
182
                    $.ajax({
183
                        'dataType': 'json',
184
                        'accept': 'application/json',
185
                        'method': 'post',
186
                        'url': action,
187
                    }).done(function(response) {
188
                        if (response['success']) {
189
                            $.fn.showSuccess(response['data']);
190
                            gridTable.api().ajax.reload(null, false);
191
                        } else {
192
                            $.fn.showError(response['data']);
193
                        }
194
                    }).fail(function(jqXHR, textStatus, errorThrown) {
195
                        $.fn.showError(textStatus);
196
                    }).always(function() {
197
                        NProgress.done();
198
                    });
199
                },
200
            });
201
        },
202
        'aoColumns': [{
203
                'mDataProp': 'name'
204
            },
205
            {
206
                'mDataProp': 'status'
207
            },
208
            {
209
                'mDataProp': 'actions'
210
            },
211
        ],
212
        'columnDefs': [{
213
                'targets': 0,
214
                'className': 'text-vertical-middle',
215
            },
3113 eleazar 216
            {
217
                'targets': -2,
218
                'orderable': false,
219
                'className': 'text-center',
220
                'render': function(data, type, row) {
221
                    checked = data == 'a' ? ' checked="checked" ' : '';
222
                    return '<div class="checkbox checkbox-success">' +
223
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
224
                        '<label ></label></div>';
225
                }
226
            },
227
            {
228
                'targets': -1,
229
                'orderable': false,
230
                'render': function(data, type, row) {
231
                    s = '';
232
                    if (allowEdit) {
233
                        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;';
234
                    }
235
                    if (allowDelete) {
236
                        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;';
237
                    }
238
                    if (allowReport) {
239
                        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;';
240
                    }
241
                    return s;
242
                }
243
            }
3094 eleazar 244
        ],
245
    });
246
 
2523 eleazar 247
    function getContent() {
2897 eleazar 248
        return $('[data-competency-behavior]').map(
2523 eleazar 249
            function (idx, td) {
2895 eleazar 250
                const competencyUuid = $(td).data('competency-uuid');
251
                const behaviorUuid = $(td).data('behavior-uuid');
2523 eleazar 252
                const textarea = $(td).find('textarea');
253
                const select = $(td).find('select');
2521 eleazar 254
 
2523 eleazar 255
                return {
2895 eleazar 256
                    competencyUuid: competencyUuid,
257
                    behaviorUuid : behaviorUuid,
2523 eleazar 258
                    comment: textarea.val(),
259
                    evaluation: select.val(),
260
                }
261
            }
262
        ).get()
263
    }
264
 
2537 eleazar 265
    var validator = $('#form-interview').validate({
1877 eleazar 266
        debug: true,
267
        onclick: false,
268
        onkeyup: false,
269
        ignore: [],
2534 eleazar 270
        rules: {},
1877 eleazar 271
        submitHandler: function(form) {
272
            $.ajax({
273
                'dataType': 'json',
274
                'accept': 'application/json',
275
                'method': 'post',
2809 eleazar 276
                'url': $('#form-interview').attr('action'),
2523 eleazar 277
                'data': {
2571 eleazar 278
                    content: JSON.stringify(getContent()),
2523 eleazar 279
                    vacancy_uuid: $('#vacancy_uuid').val(),
280
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 281
                    points: $('#points').val(),
2744 eleazar 282
                    comment: $('#comment').val(),
2747 eleazar 283
                    type: $('#type').val(),
2749 eleazar 284
                    status: $('#status').val(),
2523 eleazar 285
                }
1877 eleazar 286
            }).done(function(response) {
287
                NProgress.start();
288
                if (response['success']) {
289
                    $.fn.showSuccess(response['data']);
3071 eleazar 290
                    $('#main').hide();
3118 eleazar 291
                    $('#interview').hide();
292
                    gridTable.api().ajax.reload(null, false);
1877 eleazar 293
                } else {
294
                    validator.resetForm();
295
                    if (jQuery.type(response['data']) == 'string') {
296
                        $.fn.showError(response['data']);
297
                    } else {
298
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 299
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 300
                        });
301
                    }
302
                }
303
            }).fail(function(jqXHR, textStatus, errorThrown) {
304
                $.fn.showError(textStatus);
305
            }).always(function() {
306
                NProgress.done();
307
            });
308
            return false;
309
        },
310
        invalidHandler: function(form, validator) {}
311
    });
1709 eleazar 312
 
2015 eleazar 313
    $('body').on('click', 'button.btn-add', function(e) {
2812 eleazar 314
        var url = $(this).data('url');
2015 eleazar 315
        e.preventDefault();
316
        NProgress.start();
317
        $.ajax({
318
            'dataType': 'json',
319
            'accept': 'application/json',
320
            'method': 'get',
2812 eleazar 321
            'url': url,
2015 eleazar 322
        }).done(function(response) {
323
            if (response['success']) {
2237 eleazar 324
                var data = response.data
2785 eleazar 325
                $("#interview #comment").val('');
326
                $('#interview #status').val('');
327
                $('#interview #type').val('')
2960 eleazar 328
                $("#interview #points").val('$points_0');
2785 eleazar 329
 
2264 eleazar 330
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2812 eleazar 331
                $("#form-interview").attr('action', url)
3342 eleazar 332
                $("#content").hide();
333
                $("#main").show()
1877 eleazar 334
            } else {
2015 eleazar 335
                $.fn.showError(response['data']);
1877 eleazar 336
            }
2015 eleazar 337
        }).fail(function(jqXHR, textStatus, errorThrown) {
338
            $.fn.showError(textStatus);
339
        }).always(function() {
340
            NProgress.done();
1877 eleazar 341
        });
2015 eleazar 342
    });
2785 eleazar 343
 
344
    $('body').on('click', 'button.btn-edit', function(e) {
2807 eleazar 345
        var url = $(this).data('url');
2785 eleazar 346
        e.preventDefault();
347
        NProgress.start();
348
        $.ajax({
349
            'dataType': 'json',
350
            'accept': 'application/json',
351
            'method': 'get',
2807 eleazar 352
            'url': url,
2785 eleazar 353
        }).done(function(response) {
354
            if (response['success']) {
355
                var data = response.data
2798 eleazar 356
                $("#interview #comment").val(data['interview']['comment']);
357
                $('#interview #status').val(data['interview']['status']);
358
                $('#interview #type').val(data['interview']['type']);
359
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 360
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 361
                data.interview.content.forEach(obj => {
2896 eleazar 362
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
363
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 364
                })
2808 eleazar 365
                $("#form-interview").attr('action', url)
3342 eleazar 366
                $("#content").hide();
367
                $("#main").show()
2785 eleazar 368
            } else {
369
                $.fn.showError(response['data']);
370
            }
371
        }).fail(function(jqXHR, textStatus, errorThrown) {
372
            $.fn.showError(textStatus);
373
        }).always(function() {
374
            NProgress.done();
375
        });
376
    });
2788 eleazar 377
 
378
    $('button.btn-delete').confirmation({
2887 eleazar 379
        rootSelector: 'button.btn-delete',
380
        title: 'LABEL_ARE_YOU_SURE',
381
        singleton: true,
382
        btnOkLabel: 'LABEL_YES',
383
        btnCancelLabel: 'LABEL_NO',
384
        onConfirm: function (value) {
385
            action = $(this).data('href');
386
            NProgress.start();
387
            $.ajax({
388
                'dataType': 'json',
389
                'accept': 'application/json',
390
                'method': 'post',
391
                'url': $(this).data('url'),
392
            }).done(function (response) {
393
                if (response['success']) {
394
                    $.fn.showSuccess(response['data']);
3118 eleazar 395
                    gridTable.api().ajax.reload(null, false);
2887 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();
2788 eleazar 403
            });
2887 eleazar 404
        },
405
    });
2015 eleazar 406
 
407
    $('body').on('click', 'button.btn-cancel', function(e) {
408
        e.preventDefault();
2521 eleazar 409
        $('#main').show();
2015 eleazar 410
        $('#row-form').hide();
411
        $('#div-listing').show();
412
    });
413
 
414
    $('#form-filter #vacancy_uuid').change(function(e) {
415
        e.preventDefault();
3117 eleazar 416
        gridTable.api().ajax.reload(null, false);
2015 eleazar 417
    })
2118 eleazar 418
 
2577 eleazar 419
    $('#form-filter #candidate_uuid').change(function(e) {
2015 eleazar 420
        e.preventDefault();
3126 eleazar 421
        gridTable.api().ajax.reload(null, false);
2015 eleazar 422
    })
2525 eleazar 423
     /**
424
     * Clicked cancel new/edit Form
425
     */
426
    $('button.btn-edit-cancel').click(function(e) {
427
        e.preventDefault();
3361 eleazar 428
        $("#content").show();
429
        $("#main").hide();
2525 eleazar 430
    });
431
    /**
432
     * Clicked save and continue new Form
433
     */
434
    $('button.btn-form-save-continue').click(function(e) {
435
        e.preventDefault();
436
        $('#interview #form-continue').val('1')
2540 eleazar 437
        $('#form-interview').submit();
2525 eleazar 438
    });
439
    /**
440
     * Clicked save and close new/edit Form
441
     */
442
    $('button.btn-form-save-close').click(function(e) {
443
        e.preventDefault();
444
        $('#interview #form-continue').val('0')
3361 eleazar 445
        $("#content").show();
446
        $("#main").hide();
2540 eleazar 447
        $('#form-interview').submit();
2525 eleazar 448
    });
3120 eleazar 449
 
3345 eleazar 450
    $('#vacancy_uuid').on('change', function (event) {
3124 eleazar 451
        $('#candidate_uuid').html('');
2042 eleazar 452
 
3345 eleazar 453
        var uuid = event.target.value;
454
 
455
        $("#add-button").data('url', String('$routeAdd').replaceAll('UUID_PLACEHOLDER', uuid))
456
 
2029 eleazar 457
        $.ajax({
458
            'dataType': 'json',
459
            'accept': 'application/json',
460
            'method': 'get',
3125 eleazar 461
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 462
        }).done(function (response) {
463
            var data = response.data
464
 
2036 eleazar 465
            data.candidates.forEach(function (candidate) {
2761 eleazar 466
                var option = $('<option />')
467
                    .val(candidate.uuid)
2777 eleazar 468
                    .text(candidate.first_name)
469
                    .data('addUrl', candidate.add_url)
470
                    .data('editUrl', candidate.edit_url)
471
                    .data('deleteUrl', candidate.delete_url)
2879 eleazar 472
                    .data('reportUrl', candidate.report_url)
2041 eleazar 473
 
474
                $('#candidate_uuid').append(option);
2036 eleazar 475
            });
2052 eleazar 476
 
2785 eleazar 477
            $('#candidate_uuid').change();
478
 
2244 eleazar 479
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 480
        })
3120 eleazar 481
    });
2032 eleazar 482
 
3123 eleazar 483
   $('#vacancy_uuid').change();
2785 eleazar 484
 
3341 eleazar 485
});
1709 eleazar 486
JS;
487
$this->inlineScript()->captureEnd();
488
?>
489
 
490
 
491
<!-- Content Header (Page header) -->
2521 eleazar 492
<section class="main-header">
1709 eleazar 493
	<div class="container-fluid">
494
    	<div class="row mb-2">
495
        	<div class="col-sm-12">
496
            	<h1>LABEL_INTERVIEW</h1>
497
			</div>
498
		</div>
499
	</div><!-- /.container-fluid -->
500
</section>
501
 
3359 eleazar 502
<section id="content">
3062 eleazar 503
    <div class="container-fluid">
504
        <div class="row">
505
            <div class="col-12">
506
                <div class="card">
507
                    <div class="card-header">
3131 eleazar 508
 
509
                        <div class="row">
510
                            <div class="col-md-6 col-sm-12">
511
                                <div class="form-group">
512
                                <label for="vacancy_uuid">LABEL_VACANCY</label>
513
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
514
                                        <?php foreach($this->vacancies as $vacancy): ?>
515
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
516
                                        <?php endforeach; ?>
517
                                    </select>
3062 eleazar 518
                                </div>
519
                            </div>
3131 eleazar 520
 
521
                        </div>
3062 eleazar 522
                        <?php echo $this->form()->closeTag($form); ?>
523
                    </div>
524
                    <div class="card-body">
525
                        <table id="gridTable" class="table   table-hover">
526
                            <thead>
527
                            <tr>
528
                                <th>LABEL_FIRST_NAME</th>
529
                                <th>LABEL_LAST_NAME</th>
530
                                <th>LABEL_EMAIL</th>
531
                                <th>LABEL_ACTIONS</th>
532
                            </tr>
533
                            </thead>
534
                            <tbody>
535
                            </tbody>
536
                        </table>
537
                    </div>
538
                    <div class="card-footer clearfix">
3105 eleazar 539
                        <div style="float:right;">
3344 eleazar 540
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
3105 eleazar 541
                        </div>
3062 eleazar 542
                    </div>
543
                </div>
544
            </div>
545
        </div>
546
    </div>
547
</section>
548
 
3348 eleazar 549
<section id="main" style="display: none;">
1709 eleazar 550
	<div class="container-fluid">
551
    	<div class="row">
3361 eleazar 552
        	<div class="col-12">
553
                <form action="#" name="form-interview" id="form-interview">
554
			    	<div class="card">
555
			    		<div class="card-header">
556
                            <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
3380 eleazar 557
                                <li class="nav-item" role="presentation">
558
                                    <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>
559
                                </li>
560
                                <li class="nav-item" role="presentation">
561
                                    <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>
562
                                </li>
563
                                <li class="nav-item" role="presentation">
564
                                    <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_SUBORDINATES</a>
565
                                </li>
566
                            </ul>
567
			    		</div>
568
 
569
			    		<div class="card-body tab-content">
3361 eleazar 570
                            <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
571
                                <div class="row">
572
                                    <div class="col-md-6 col-sm-12">
3152 eleazar 573
                                        <div class="form-group">
3361 eleazar 574
                                            <label for="candidate_uuid">LABEL_CANDIDATES</label>
575
                                            <select id="candidate_uuid" name="candidate_uuid" class="form-control">
576
                                            </select>
577
                                        </div>
578
                                    </div>
579
                                        <div id="job-description"></div>
580
                                    </div>
581
                                </div>
3152 eleazar 582
                            </div>
3361 eleazar 583
                            <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
584
                                <div class="row" >
585
                                   <br>
586
                                   <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
587
                                   </div>
588
                                </div>
589
                            </div>
590
                            <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
591
                              <div class="row">
592
                                    <?php
593
                                     $form->setAttributes([
594
                                         'method' => 'post',
595
                                         'name' => 'form-add',
596
                                         'id' => 'form-add'
597
                                     ]);
598
                                     $form->prepare();
599
                                     echo $this->form()->openTag($form);
600
                                     ?>
601
                                       <div class="form-group">
602
                                                <?php
603
                                                $element = $form->get('comment');
604
                                                $element->setOptions(['label' => 'LABEL_COMMENT']);
605
                                                $element->setAttributes(['class' => 'form-control']);
606
                                                echo $this->formLabel($element);
607
                                                echo $this->formText($element);
608
                                                ?>
609
                                            </div>
610
                                            <div class="form-group">
611
                                                <?php
612
                                                $element = $form->get('points');
613
                                                $element->setAttributes(['class' => 'form-control']);
614
                                                $element->setOptions(['label' => 'LABEL_EVALUATION']);
615
                                                echo $this->formLabel($element);
616
                                                echo $this->formSelect($element);
617
                                                ?>
618
                                            </div>
619
                                            <div class="form-group">
620
                                                <?php
621
                                                $element = $form->get('status');
622
                                                $element->setAttributes(['class' => 'form-control']);
623
                                                $element->setOptions(['label' => 'LABEL_STATUS']);
624
                                                echo $this->formLabel($element);
625
                                                echo $this->formSelect($element);
626
                                                ?>
627
                                            </div>
628
                                            <div class="form-group">
629
                                                <?php
630
                                                $element = $form->get('type');
631
                                                $element->setAttributes(['class' => 'form-control']);
632
                                                $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
633
                                                echo $this->formLabel($element);
634
                                                echo $this->formSelect($element);
635
                                                ?>
636
                                            </div>
637
                                        </div>
638
                                </div>
639
                                <div class="card-footer clearfix">
640
                                    <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
641
                                    <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
642
                                    <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
643
                                </div>
644
                            </div>
645
                       	</div>
646
                    </div>
647
                </form>
1876 eleazar 648
            </div>
2015 eleazar 649
        </div>
650
 	</div>
651
</section>
2052 eleazar 652
 
653
<script id="job-description-template" type="text/x-jsrender">
654
    <div class="card">
655
        <div class="card-body">
656
            <h5 class="card-title">{{:job_description.name}}</h5>
657
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 658
            <p class="card-text">{{:job_description.objectives}}</p>
659
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 660
        </div>
661
    </div>
2061 eleazar 662
</script>
663
 
3169 eleazar 664
<section id="interview" style="display: none;">
665
	<div class="container-fluid">
666
    	<div class="row">
667
        	<div class="col-12">
668
                <form action="#" name="form-interview" id="form-interview">
669
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
670
			    	<div class="card">
671
                    <?php
672
                         $form->setAttributes([
673
                             'method' => 'post',
674
                             'name' => 'form-add',
675
                             'id' => 'form-add'
676
                         ]);
677
                         $form->prepare();
678
                         echo $this->form()->openTag($form);
679
                         ?>
680
			    		<div class="card-header">
681
                            <label>interview</label>
682
			    		</div>
683
			    		<div class="card-body">
684
                            <div id="competencies-job"></div>
685
                                <div class="form-group">
686
                                    <?php
687
                                    $element = $form->get('comment');
688
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
689
                                    $element->setAttributes(['class' => 'form-control']);
690
                                    echo $this->formLabel($element);
691
                                    echo $this->formText($element);
692
                                    ?>
693
                                </div>
694
                                <div class="form-group">
695
                                    <?php
696
                                    $element = $form->get('points');
697
                                    $element->setAttributes(['class' => 'form-control']);
698
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
699
                                    echo $this->formLabel($element);
700
                                    echo $this->formSelect($element);
701
                                    ?>
702
                                </div>
703
                                <div class="form-group">
704
                                    <?php
705
                                    $element = $form->get('status');
706
                                    $element->setAttributes(['class' => 'form-control']);
707
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
708
                                    echo $this->formLabel($element);
709
                                    echo $this->formSelect($element);
710
                                    ?>
711
                                </div>
712
                                <div class="form-group">
713
                                    <?php
714
                                    $element = $form->get('type');
715
                                    $element->setAttributes(['class' => 'form-control']);
716
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
717
                                    echo $this->formLabel($element);
718
                                    echo $this->formSelect($element);
719
                                    ?>
720
                                </div>
721
                            </div>
722
                       	</div>
723
                        <div class="card-footer clearfix">
724
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
725
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
726
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
727
                        </div>
728
                    </div>
729
                </form>
730
            </div>
731
        </div>
732
 	</div>
733
</section>
3162 eleazar 734
 
2264 eleazar 735
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 736
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 737
    <thead>
738
        <tr>
2306 eleazar 739
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 740
           <th style="width: 50%;">LABEL_TITLE</th>
741
        </tr>
742
    </thead>
2300 eleazar 743
    <tbody>
744
        {{for job_description.competencies}}
745
            <tr>
746
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 747
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 748
            </tr>
2302 eleazar 749
 
750
            {{for behaviors}}
2308 eleazar 751
                <tr>
2302 eleazar 752
                   <td class="text-left">--LABEL_CONDUCT</td>
753
                   <td class="text-left">
2303 eleazar 754
                      {{:description}}
2849 eleazar 755
                   </td>
2507 eleazar 756
                </tr>
757
                <tr>
2897 eleazar 758
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
2895 eleazar 759
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
2519 eleazar 760
 
761
                        <textarea
2851 eleazar 762
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 763
                            class="form-control"
764
                        ></textarea>
765
 
2888 eleazar 766
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 767
 
2889 eleazar 768
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 769
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
770
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
771
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
772
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
773
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
774
                        </select>
775
                    </td>
2506 eleazar 776
                </tr>
777
            {{/for}}
778
 
2300 eleazar 779
        {{/for}}
780
    </tbody>
2293 eleazar 781
</table>
2241 eleazar 782
</script>