Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3163 | Rev 3165 | 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
 
3164 eleazar 474
   $('#candidate_uuid').on('change', function () {
475
        const uuid = $('#candidate_uuid').val();
476
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
477
 
478
        $('#add-button').data('url', data.addUrl)
479
        $("#edit-button").data('url', data.editUrl)
480
        $("#delete-button").data('url', data.deleteUrl)
481
        $("#report-button").attr('href', data.reportUrl)
482
        if (data.addUrl) {
483
            $('#add-button').show();
484
            $('#report-button').show();
485
            $('#edit-button').hide();
486
            $('#delete-button').hide();
487
        } else {
488
            $('#add-button').hide();
489
            $('#edit-button').show();
490
            $('#delete-button').show();
491
            $('#report-button').show();
492
        }
493
 
494
    });
495
 
3160 eleazar 496
 
1709 eleazar 497
});
498
JS;
499
$this->inlineScript()->captureEnd();
500
?>
501
 
502
 
503
<!-- Content Header (Page header) -->
2521 eleazar 504
<section class="main-header">
1709 eleazar 505
	<div class="container-fluid">
506
    	<div class="row mb-2">
507
        	<div class="col-sm-12">
508
            	<h1>LABEL_INTERVIEW</h1>
509
			</div>
510
		</div>
511
	</div><!-- /.container-fluid -->
512
</section>
513
 
3062 eleazar 514
<section class="content">
515
    <div class="container-fluid">
516
        <div class="row">
517
            <div class="col-12">
518
                <div class="card">
519
                    <div class="card-header">
3131 eleazar 520
 
521
                        <div class="row">
522
                            <div class="col-md-6 col-sm-12">
523
                                <div class="form-group">
524
                                <label for="vacancy_uuid">LABEL_VACANCY</label>
525
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
526
                                        <?php foreach($this->vacancies as $vacancy): ?>
527
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
528
                                        <?php endforeach; ?>
529
                                    </select>
3062 eleazar 530
                                </div>
531
                            </div>
3131 eleazar 532
 
533
                        </div>
3062 eleazar 534
                        <?php echo $this->form()->closeTag($form); ?>
535
                    </div>
536
                    <div class="card-body">
537
                        <table id="gridTable" class="table   table-hover">
538
                            <thead>
539
                            <tr>
540
                                <th>LABEL_FIRST_NAME</th>
541
                                <th>LABEL_LAST_NAME</th>
542
                                <th>LABEL_EMAIL</th>
543
                                <th>LABEL_ACTIONS</th>
544
                            </tr>
545
                            </thead>
546
                            <tbody>
547
                            </tbody>
548
                        </table>
549
                    </div>
550
                    <div class="card-footer clearfix">
3105 eleazar 551
                        <div style="float:right;">
552
                        <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
553
                        </div>
3062 eleazar 554
                    </div>
555
                </div>
556
            </div>
557
        </div>
558
    </div>
559
</section>
560
 
3162 eleazar 561
<section class="main">
1709 eleazar 562
	<div class="container-fluid">
563
    	<div class="row">
3152 eleazar 564
        	<div class="col-12">
2537 eleazar 565
				<div class="card">
3131 eleazar 566
					<div class="card-header">
567
                        <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
568
                        <li class="nav-item">
569
                           <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>
570
                        </li>
571
                        <li class="nav-item">
572
                           <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>
573
                        </li>
574
                        <li class="nav-item">
3160 eleazar 575
                           <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 576
                        </li>
577
                        </ul>
3133 eleazar 578
 
2537 eleazar 579
					</div>
3137 eleazar 580
					<div class="card-body">
3133 eleazar 581
                        <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
582
                            <div class="row">
3137 eleazar 583
                                <div class="col-md-6 col-sm-12">
584
                                    <div class="form-group">
585
                                        <label for="candidate_uuid">LABEL_CANDIDATES</label>
586
                                        <select id="candidate_uuid" name="candidate_uuid" class="form-control">
587
                                        </select>
588
                                    </div>
589
                                </div>
3149 eleazar 590
                                    <div id="job-description"></div>
3137 eleazar 591
                                </div>
3133 eleazar 592
                            </div>
593
                        </div>
3137 eleazar 594
                        <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
3147 eleazar 595
                            <div class="row" >
596
                               <br>
3148 eleazar 597
                               <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
3147 eleazar 598
                               </div>
599
                            </div>
3137 eleazar 600
                        </div>
3160 eleazar 601
                        <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
602
                          <div class="row">
3152 eleazar 603
                                <?php
604
                                 $form->setAttributes([
605
                                     'method' => 'post',
606
                                     'name' => 'form-add',
607
                                     'id' => 'form-add'
608
                                 ]);
609
                                 $form->prepare();
610
                                 echo $this->form()->openTag($form);
611
                                 ?>
612
                                   <div class="form-group">
613
                                            <?php
614
                                            $element = $form->get('comment');
615
                                            $element->setOptions(['label' => 'LABEL_COMMENT']);
616
                                            $element->setAttributes(['class' => 'form-control']);
617
                                            echo $this->formLabel($element);
618
                                            echo $this->formText($element);
619
                                            ?>
620
                                        </div>
621
                                        <div class="form-group">
622
                                            <?php
623
                                            $element = $form->get('points');
624
                                            $element->setAttributes(['class' => 'form-control']);
625
                                            $element->setOptions(['label' => 'LABEL_EVALUATION']);
626
                                            echo $this->formLabel($element);
627
                                            echo $this->formSelect($element);
628
                                            ?>
629
                                        </div>
630
                                        <div class="form-group">
631
                                            <?php
632
                                            $element = $form->get('status');
633
                                            $element->setAttributes(['class' => 'form-control']);
634
                                            $element->setOptions(['label' => 'LABEL_STATUS']);
635
                                            echo $this->formLabel($element);
636
                                            echo $this->formSelect($element);
637
                                            ?>
638
                                        </div>
639
                                        <div class="form-group">
640
                                            <?php
641
                                            $element = $form->get('type');
642
                                            $element->setAttributes(['class' => 'form-control']);
643
                                            $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
644
                                            echo $this->formLabel($element);
645
                                            echo $this->formSelect($element);
646
                                            ?>
647
                                        </div>
648
                                    </div>
3145 eleazar 649
 
650
                                      <div class="card-footer clearfix">
651
                                      <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
652
                                      <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
653
                                      <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
3142 eleazar 654
                                    </div>
3152 eleazar 655
                            </div>
3146 eleazar 656
 
3145 eleazar 657
                        </div>
2537 eleazar 658
                   	</div>
659
                 </div>
1876 eleazar 660
            </div>
2015 eleazar 661
        </div>
662
 	</div>
663
</section>
2052 eleazar 664
 
665
<script id="job-description-template" type="text/x-jsrender">
666
    <div class="card">
667
        <div class="card-body">
668
            <h5 class="card-title">{{:job_description.name}}</h5>
669
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 670
            <p class="card-text">{{:job_description.objectives}}</p>
671
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 672
        </div>
673
    </div>
2061 eleazar 674
</script>
675
 
3162 eleazar 676
<section id="interview" style="display: none;">
677
	<div class="container-fluid">
678
    	<div class="row">
679
        	<div class="col-12">
680
                <form action="#" name="form-interview" id="form-interview">
681
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
682
			    	<div class="card">
683
                    <?php
684
                         $form->setAttributes([
685
                             'method' => 'post',
686
                             'name' => 'form-add',
687
                             'id' => 'form-add'
688
                         ]);
689
                         $form->prepare();
690
                         echo $this->form()->openTag($form);
691
                         ?>
692
			    		<div class="card-header">
693
                            <label>interview</label>
694
			    		</div>
695
			    		<div class="card-body">
696
                            <div id="competencies-job"></div>
697
                                <div class="form-group">
698
                                    <?php
699
                                    $element = $form->get('comment');
700
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
701
                                    $element->setAttributes(['class' => 'form-control']);
702
                                    echo $this->formLabel($element);
703
                                    echo $this->formText($element);
704
                                    ?>
705
                                </div>
706
                                <div class="form-group">
707
                                    <?php
708
                                    $element = $form->get('points');
709
                                    $element->setAttributes(['class' => 'form-control']);
710
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
711
                                    echo $this->formLabel($element);
712
                                    echo $this->formSelect($element);
713
                                    ?>
714
                                </div>
715
                                <div class="form-group">
716
                                    <?php
717
                                    $element = $form->get('status');
718
                                    $element->setAttributes(['class' => 'form-control']);
719
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
720
                                    echo $this->formLabel($element);
721
                                    echo $this->formSelect($element);
722
                                    ?>
723
                                </div>
724
                                <div class="form-group">
725
                                    <?php
726
                                    $element = $form->get('type');
727
                                    $element->setAttributes(['class' => 'form-control']);
728
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
729
                                    echo $this->formLabel($element);
730
                                    echo $this->formSelect($element);
731
                                    ?>
732
                                </div>
733
                            </div>
734
                       	</div>
735
                        <div class="card-footer clearfix">
736
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
737
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
738
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
739
                        </div>
740
                    </div>
741
                </form>
742
            </div>
743
        </div>
744
 	</div>
745
</section>
746
 
2264 eleazar 747
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 748
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 749
    <thead>
750
        <tr>
2306 eleazar 751
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 752
           <th style="width: 50%;">LABEL_TITLE</th>
753
        </tr>
754
    </thead>
2300 eleazar 755
    <tbody>
756
        {{for job_description.competencies}}
757
            <tr>
758
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 759
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 760
            </tr>
2302 eleazar 761
 
762
            {{for behaviors}}
2308 eleazar 763
                <tr>
2302 eleazar 764
                   <td class="text-left">--LABEL_CONDUCT</td>
765
                   <td class="text-left">
2303 eleazar 766
                      {{:description}}
2849 eleazar 767
                   </td>
2507 eleazar 768
                </tr>
769
                <tr>
2897 eleazar 770
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
2895 eleazar 771
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
2519 eleazar 772
 
773
                        <textarea
2851 eleazar 774
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 775
                            class="form-control"
776
                        ></textarea>
777
 
2888 eleazar 778
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 779
 
2889 eleazar 780
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 781
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
782
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
783
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
784
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
785
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
786
                        </select>
787
                    </td>
2506 eleazar 788
                </tr>
789
            {{/for}}
790
 
2300 eleazar 791
        {{/for}}
792
    </tbody>
2293 eleazar 793
</table>
2241 eleazar 794
</script>