Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 2987 | Rev 3063 | 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');
2128 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
 
2503 eleazar 72
const classFormGenerator = function() {
73
    this.id = 0,
74
        this.table = '',
75
        this.text = '',
2506 eleazar 76
        this.behaviors = [],
2503 eleazar 77
        this.clear = function() {
2506 eleazar 78
            this.behaviors = [];
2503 eleazar 79
            this.render();
80
        },
81
 
82
        /**
83
         * Add element to section array
84
         */
2506 eleazar 85
        this.addSection = function( text, value) {
2503 eleazar 86
            var d = new Date();
87
            var slug = 'section' + d.getTime();
88
            var position = 0;
2506 eleazar 89
            $.each(this.behaviors, function(index, section) {
2503 eleazar 90
                if (position < section.position) {
91
                    position = section.position;
92
                }
93
            });
94
            position++;
95
            var section = {
2506 eleazar 96
                'slug_behaviors': slug,
2503 eleazar 97
                'text': text,
98
                'value': value,
99
                'position': position,
100
                'questions': [],
101
                'status': 0
102
            }
2506 eleazar 103
            this.behaviors.push(section);
2503 eleazar 104
        },
105
         /**
106
         * Edit element to section array
107
         */
2506 eleazar 108
        this.editSection = function(slug, text, value) {
2503 eleazar 109
            var renderTable = false;
2506 eleazar 110
            for (i = 0; i < this.behaviors.length; i++) {
111
                if (slug == this.behaviors[i].slug_behaviors) {
112
                    this.behaviors[i].text = text;
113
                    this.behaviors[i].value = value;
2503 eleazar 114
                    renderTable = true;
115
                    break;
116
                }
117
            }
118
            if (renderTable) {
119
                this.renderSection(slug);
120
            }
121
        },
122
         /**
123
         * Remove element to section array
124
         */
125
        this.deleteSection = function(slug) {
126
            var renderTable = false;
2506 eleazar 127
            for (i = 0; i < this.behaviors.length; i++) {
128
                if (slug == this.behaviors[i].slug_behaviors) {
129
                    this.behaviors.splice(i, 1);
2503 eleazar 130
                    renderTable = true;
131
                    break;
132
                }
133
            }
134
            if (renderTable) {
135
                $('#panel' + slug).remove();
136
            }
137
        }
138
}
139
 
1709 eleazar 140
jQuery( document ).ready(function( $ ) {
2504 eleazar 141
    var objFormGenerator = new classFormGenerator();
2506 eleazar 142
    //objFormGenerator.render();
1877 eleazar 143
    $.validator.setDefaults({
2015 eleazar 144
        debug: true,
145
        highlight: function(element) {
146
            $(element).addClass('is-invalid');
147
        },
148
        unhighlight: function(element) {
149
            $(element).removeClass('is-invalid');
150
        },
151
        errorElement: 'span',
152
        errorClass: 'error invalid-feedback',
153
        errorPlacement: function(error, element) {
154
            if(element.parent('.btn-file').length) {
155
                error.insertAfter(element.parent().parent());
156
            } else if(element.parent('.toggle').length) {
157
                error.insertAfter(element.parent().parent());
158
            } else {
159
                error.insertAfter(element.parent());
1709 eleazar 160
            }
2015 eleazar 161
        }
162
    });
1709 eleazar 163
 
2015 eleazar 164
    $.fn.showFormErrorValidator = function(fieldname, errors) {
165
        var field = $(fieldname);
166
        if(field) {
167
            $(field).addClass('is-invalid');
1709 eleazar 168
 
2015 eleazar 169
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
170
 
171
            if(element.parent('.btn-file').length) {
172
                error.insertAfter(element.parent().parent());
173
            } else if(element.parent('.toggle').length) {
174
                error.insertAfter(element.parent().parent());
175
            } else {
176
                error.insertAfter(element.parent());
1709 eleazar 177
            }
2015 eleazar 178
        }
179
    };
1827 eleazar 180
 
2523 eleazar 181
    function getContent() {
2897 eleazar 182
        return $('[data-competency-behavior]').map(
2523 eleazar 183
            function (idx, td) {
2895 eleazar 184
                const competencyUuid = $(td).data('competency-uuid');
185
                const behaviorUuid = $(td).data('behavior-uuid');
2523 eleazar 186
                const textarea = $(td).find('textarea');
187
                const select = $(td).find('select');
2521 eleazar 188
 
2523 eleazar 189
                return {
2895 eleazar 190
                    competencyUuid: competencyUuid,
191
                    behaviorUuid : behaviorUuid,
2523 eleazar 192
                    comment: textarea.val(),
193
                    evaluation: select.val(),
194
                }
195
            }
196
        ).get()
197
    }
198
 
2537 eleazar 199
    var validator = $('#form-interview').validate({
1877 eleazar 200
        debug: true,
201
        onclick: false,
202
        onkeyup: false,
203
        ignore: [],
2534 eleazar 204
        rules: {},
1877 eleazar 205
        submitHandler: function(form) {
206
            $.ajax({
207
                'dataType': 'json',
208
                'accept': 'application/json',
209
                'method': 'post',
2809 eleazar 210
                'url': $('#form-interview').attr('action'),
2523 eleazar 211
                'data': {
2571 eleazar 212
                    content: JSON.stringify(getContent()),
2523 eleazar 213
                    vacancy_uuid: $('#vacancy_uuid').val(),
214
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 215
                    points: $('#points').val(),
2744 eleazar 216
                    comment: $('#comment').val(),
2747 eleazar 217
                    type: $('#type').val(),
2749 eleazar 218
                    status: $('#status').val(),
2523 eleazar 219
                }
1877 eleazar 220
            }).done(function(response) {
221
                NProgress.start();
222
                if (response['success']) {
223
                    $.fn.showSuccess(response['data']);
2521 eleazar 224
                    $('#main').show();
2536 eleazar 225
                    $('#interview').hide();
2791 eleazar 226
                    $('#vacancy_uuid').change();
1877 eleazar 227
                } else {
228
                    validator.resetForm();
229
                    if (jQuery.type(response['data']) == 'string') {
230
                        $.fn.showError(response['data']);
231
                    } else {
232
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 233
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 234
                        });
235
                    }
236
                }
237
            }).fail(function(jqXHR, textStatus, errorThrown) {
238
                $.fn.showError(textStatus);
239
            }).always(function() {
240
                NProgress.done();
241
            });
242
            return false;
243
        },
244
        invalidHandler: function(form, validator) {}
245
    });
1709 eleazar 246
 
2015 eleazar 247
    $('body').on('click', 'button.btn-add', function(e) {
2812 eleazar 248
        var url = $(this).data('url');
2015 eleazar 249
        e.preventDefault();
250
        NProgress.start();
251
        $.ajax({
252
            'dataType': 'json',
253
            'accept': 'application/json',
254
            'method': 'get',
2812 eleazar 255
            'url': url,
2015 eleazar 256
        }).done(function(response) {
257
            if (response['success']) {
2237 eleazar 258
                var data = response.data
2785 eleazar 259
                $("#interview #comment").val('');
260
                $('#interview #status').val('');
261
                $('#interview #type').val('')
2960 eleazar 262
                $("#interview #points").val('$points_0');
2785 eleazar 263
 
2264 eleazar 264
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2313 eleazar 265
                $("#interview").show()
2812 eleazar 266
                $("#form-interview").attr('action', url)
1877 eleazar 267
            } else {
2015 eleazar 268
                $.fn.showError(response['data']);
1877 eleazar 269
            }
2015 eleazar 270
        }).fail(function(jqXHR, textStatus, errorThrown) {
271
            $.fn.showError(textStatus);
272
        }).always(function() {
273
            NProgress.done();
1877 eleazar 274
        });
2015 eleazar 275
    });
2785 eleazar 276
 
277
    $('body').on('click', 'button.btn-edit', function(e) {
2807 eleazar 278
        var url = $(this).data('url');
2785 eleazar 279
        e.preventDefault();
280
        NProgress.start();
281
        $.ajax({
282
            'dataType': 'json',
283
            'accept': 'application/json',
284
            'method': 'get',
2807 eleazar 285
            'url': url,
2785 eleazar 286
        }).done(function(response) {
287
            if (response['success']) {
288
                var data = response.data
2798 eleazar 289
                $("#interview #comment").val(data['interview']['comment']);
290
                $('#interview #status').val(data['interview']['status']);
291
                $('#interview #type').val(data['interview']['type']);
292
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 293
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 294
                data.interview.content.forEach(obj => {
2896 eleazar 295
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
296
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 297
                })
2808 eleazar 298
                $("#form-interview").attr('action', url)
2785 eleazar 299
                $("#interview").show()
300
            } else {
301
                $.fn.showError(response['data']);
302
            }
303
        }).fail(function(jqXHR, textStatus, errorThrown) {
304
            $.fn.showError(textStatus);
305
        }).always(function() {
306
            NProgress.done();
307
        });
308
    });
2788 eleazar 309
 
310
    $('button.btn-delete').confirmation({
2887 eleazar 311
        rootSelector: 'button.btn-delete',
312
        title: 'LABEL_ARE_YOU_SURE',
313
        singleton: true,
314
        btnOkLabel: 'LABEL_YES',
315
        btnCancelLabel: 'LABEL_NO',
316
        onConfirm: function (value) {
317
            action = $(this).data('href');
318
            NProgress.start();
319
            $.ajax({
320
                'dataType': 'json',
321
                'accept': 'application/json',
322
                'method': 'post',
323
                'url': $(this).data('url'),
324
            }).done(function (response) {
325
                if (response['success']) {
326
                    $.fn.showSuccess(response['data']);
327
                    $('#vacancy_uuid').change();
328
                } else {
329
                    $.fn.showError(response['data']);
330
                }
331
            }).fail(function (jqXHR, textStatus, errorThrown) {
332
                $.fn.showError(textStatus);
333
            }).always(function () {
334
                NProgress.done();
2788 eleazar 335
            });
2887 eleazar 336
        },
337
    });
2015 eleazar 338
 
339
    $('body').on('click', 'button.btn-cancel', function(e) {
340
        e.preventDefault();
2521 eleazar 341
        $('#main').show();
2015 eleazar 342
        $('#row-form').hide();
343
        $('#div-listing').show();
344
    });
345
 
346
    $('#form-filter #vacancy_uuid').change(function(e) {
347
        e.preventDefault();
2577 eleazar 348
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 349
    })
2118 eleazar 350
 
2577 eleazar 351
    $('#form-filter #candidate_uuid').change(function(e) {
2015 eleazar 352
        e.preventDefault();
353
    })
2525 eleazar 354
     /**
355
     * Clicked cancel new/edit Form
356
     */
357
    $('button.btn-edit-cancel').click(function(e) {
358
        e.preventDefault();
2526 eleazar 359
        $('#interview').hide();
2525 eleazar 360
    });
361
    /**
362
     * Clicked save and continue new Form
363
     */
364
    $('button.btn-form-save-continue').click(function(e) {
365
        e.preventDefault();
366
        $('#interview #form-continue').val('1')
2540 eleazar 367
        $('#form-interview').submit();
2525 eleazar 368
    });
369
    /**
370
     * Clicked save and close new/edit Form
371
     */
372
    $('button.btn-form-save-close').click(function(e) {
373
        e.preventDefault();
374
        $('#interview #form-continue').val('0')
2540 eleazar 375
        $('#form-interview').submit();
2525 eleazar 376
    });
2029 eleazar 377
 
378
    $('#vacancy_uuid').on('change', function () {
2042 eleazar 379
        $('#candidate_uuid').html('');
380
 
2029 eleazar 381
        $.ajax({
382
            'dataType': 'json',
383
            'accept': 'application/json',
384
            'method': 'get',
2031 eleazar 385
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 386
        }).done(function (response) {
387
            var data = response.data
388
 
2036 eleazar 389
            data.candidates.forEach(function (candidate) {
2761 eleazar 390
                var option = $('<option />')
391
                    .val(candidate.uuid)
2777 eleazar 392
                    .text(candidate.first_name)
393
                    .data('addUrl', candidate.add_url)
394
                    .data('editUrl', candidate.edit_url)
395
                    .data('deleteUrl', candidate.delete_url)
2879 eleazar 396
                    .data('reportUrl', candidate.report_url)
2041 eleazar 397
 
398
                $('#candidate_uuid').append(option);
2036 eleazar 399
            });
2052 eleazar 400
 
2785 eleazar 401
            $('#candidate_uuid').change();
402
 
2244 eleazar 403
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 404
        })
405
    });
2032 eleazar 406
 
407
    $('#vacancy_uuid').change();
2785 eleazar 408
 
409
    $('#candidate_uuid').on('change', function () {
410
        const uuid = $('#candidate_uuid').val();
411
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
412
 
413
        $('#add-button').data('url', data.addUrl)
414
        $("#edit-button").data('url', data.editUrl)
415
        $("#delete-button").data('url', data.deleteUrl)
2890 eleazar 416
        $("#report-button").attr('href', data.reportUrl)
2785 eleazar 417
        if (data.addUrl) {
418
            $('#add-button').show();
2879 eleazar 419
            $('#report-button').show();
2785 eleazar 420
            $('#edit-button').hide();
421
            $('#delete-button').hide();
422
        } else {
423
            $('#add-button').hide();
424
            $('#edit-button').show();
425
            $('#delete-button').show();
2879 eleazar 426
            $('#report-button').show();
2785 eleazar 427
        }
428
 
429
    });
1709 eleazar 430
});
431
JS;
432
$this->inlineScript()->captureEnd();
433
?>
434
 
435
 
436
<!-- Content Header (Page header) -->
2521 eleazar 437
<section class="main-header">
1709 eleazar 438
	<div class="container-fluid">
439
    	<div class="row mb-2">
440
        	<div class="col-sm-12">
441
            	<h1>LABEL_INTERVIEW</h1>
442
			</div>
443
		</div>
444
	</div><!-- /.container-fluid -->
445
</section>
446
 
3062 eleazar 447
<section class="content">
448
    <div class="container-fluid">
449
        <div class="row">
450
            <div class="col-12">
451
                <div class="card">
452
                    <div class="card-header">
453
                        <?php
454
                        // $form = $this->form;
455
                        $form->setAttributes([
456
                            'name' => 'form-filter',
457
                            'id' => 'form-filter',
458
                        ]);
459
 
460
                        $form->prepare();
461
                        echo $this->form()->openTag($form);
462
                        ?>
463
                        <div class="row">
464
                            <div class="col-md-6 col-sm-12">
465
                                <div class="form-group">
466
                                    <?php
467
                                    $element = $form->get('form_uuid');
468
 
469
                                    $element->setOptions(['label' => 'LABEL_VACANCIES']);
470
 
471
                                    $element->setAttributes(['class' => 'form-control']);
472
                                    echo $this->formLabel($element);
473
                                    echo $this->formSelect($element);
474
                                    ?>
475
                                </div>
476
                            </div>
477
 
478
                        </div>
479
                        <?php echo $this->form()->closeTag($form); ?>
480
                    </div>
481
                    <div class="card-body">
482
                        <table id="gridTable" class="table   table-hover">
483
                            <thead>
484
                            <tr>
485
                                <th>LABEL_FIRST_NAME</th>
486
                                <th>LABEL_LAST_NAME</th>
487
                                <th>LABEL_EMAIL</th>
488
                                <th>LABEL_ACTIONS</th>
489
                            </tr>
490
                            </thead>
491
                            <tbody>
492
                            </tbody>
493
                        </table>
494
                    </div>
495
                    <div class="card-footer clearfix">
496
                        <div style="float:right;">
497
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i>
498
                                LABEL_REFRESH
499
                            </button>
500
                            <?php if ($allowAdd) : ?>
501
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i>
502
                                    LABEL_ADD
503
                                </button>
504
                            <?php endif; ?>
505
                        </div>
506
                    </div>
507
                </div>
508
            </div>
509
        </div>
510
    </div>
511
</section>
512
 
2521 eleazar 513
<section class="main">
1709 eleazar 514
	<div class="container-fluid">
515
    	<div class="row">
516
        	<div class="col-12">
2537 eleazar 517
 
518
				<div class="card">
519
					<div class="card-header">
520
                        <div class="row">
521
                            <div class="col-md-6 col-sm-12">
522
                                <div class="form-group">
523
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
524
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
525
                                        <?php foreach($this->vacancies as $vacancy): ?>
526
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
527
                                        <?php endforeach; ?>
528
                                    </select>
529
                                </div>
1709 eleazar 530
                            </div>
2537 eleazar 531
                            <div class="col-md-6 col-sm-12">
532
                                <div class="form-group">
533
                                    <label for="candidate_uuid">LABEL_CANDIDATES</label>
534
                                    <select id="candidate_uuid" name="candidate_uuid" class="form-control">
535
                                    </select>
536
                                </div>
1709 eleazar 537
                            </div>
2537 eleazar 538
                            <div
539
                                class="col-md-12 col-sm-12"
540
                            >
541
                            </div>
1709 eleazar 542
                        </div>
2537 eleazar 543
					</div>
544
					<div class="card-body">
545
                        <div id="job-description"></div>
546
                   	</div>
547
                    <div class="card-footer clearfix">
548
                        <div style="float:right;">
2785 eleazar 549
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
2987 eleazar 550
                            <a id="report-button" target="_blank" class="btn btn-primary btn-report"><i class="fa fa-file"></i> LABEL_VIEW_REPORT </a>
2864 eleazar 551
                            <button id="edit-button" type="button" class="btn btn-primary btn-edit"><i class="fa fa-edit"></i> LABEL_EDIT </button>
552
                            <button id="delete-button" type="button" class="btn btn-primary btn-delete"><i class="fa fa-ban"></i> LABEL_DELETE </button>
2537 eleazar 553
                        </div>
2015 eleazar 554
                    </div>
2537 eleazar 555
                 </div>
1876 eleazar 556
            </div>
2015 eleazar 557
        </div>
558
 	</div>
559
</section>
2052 eleazar 560
 
561
<script id="job-description-template" type="text/x-jsrender">
562
    <div class="card">
563
        <div class="card-body">
564
            <h5 class="card-title">{{:job_description.name}}</h5>
565
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 566
            <p class="card-text">{{:job_description.objectives}}</p>
567
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 568
        </div>
569
    </div>
2061 eleazar 570
</script>
571
 
2314 eleazar 572
<section id="interview" style="display: none;">
2215 eleazar 573
	<div class="container-fluid">
574
    	<div class="row">
575
        	<div class="col-12">
2537 eleazar 576
                <form action="#" name="form-interview" id="form-interview">
577
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
2689 eleazar 578
			    	<div class="card">
579
                    <?php
580
                         $form->setAttributes([
581
                             'method' => 'post',
582
                             'name' => 'form-add',
583
                             'id' => 'form-add'
584
                         ]);
585
                         $form->prepare();
586
                         echo $this->form()->openTag($form);
587
                         ?>
2537 eleazar 588
			    		<div class="card-header">
589
                            <label>interview</label>
590
			    		</div>
591
			    		<div class="card-body">
592
                            <div id="competencies-job"></div>
2683 eleazar 593
                                <div class="form-group">
594
                                    <?php
595
                                    $element = $form->get('comment');
596
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
597
                                    $element->setAttributes(['class' => 'form-control']);
598
                                    echo $this->formLabel($element);
599
                                    echo $this->formText($element);
600
                                    ?>
601
                                </div>
602
                                <div class="form-group">
603
                                    <?php
604
                                    $element = $form->get('points');
605
                                    $element->setAttributes(['class' => 'form-control']);
606
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
607
                                    echo $this->formLabel($element);
608
                                    echo $this->formSelect($element);
609
                                    ?>
610
                                </div>
2744 eleazar 611
                                <div class="form-group">
612
                                    <?php
613
                                    $element = $form->get('status');
614
                                    $element->setAttributes(['class' => 'form-control']);
615
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
616
                                    echo $this->formLabel($element);
617
                                    echo $this->formSelect($element);
618
                                    ?>
619
                                </div>
620
                                <div class="form-group">
621
                                    <?php
2747 eleazar 622
                                    $element = $form->get('type');
2744 eleazar 623
                                    $element->setAttributes(['class' => 'form-control']);
624
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
625
                                    echo $this->formLabel($element);
626
                                    echo $this->formSelect($element);
627
                                    ?>
628
                                </div>
2537 eleazar 629
                            </div>
630
                       	</div>
631
                        <div class="card-footer clearfix">
632
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
633
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
634
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
2515 eleazar 635
                        </div>
2280 eleazar 636
                    </div>
2537 eleazar 637
                </form>
2215 eleazar 638
            </div>
639
        </div>
640
 	</div>
641
</section>
642
 
2264 eleazar 643
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 644
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 645
    <thead>
646
        <tr>
2306 eleazar 647
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 648
           <th style="width: 50%;">LABEL_TITLE</th>
649
        </tr>
650
    </thead>
2300 eleazar 651
    <tbody>
652
        {{for job_description.competencies}}
653
            <tr>
654
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 655
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 656
            </tr>
2302 eleazar 657
 
658
            {{for behaviors}}
2308 eleazar 659
                <tr>
2302 eleazar 660
                   <td class="text-left">--LABEL_CONDUCT</td>
661
                   <td class="text-left">
2303 eleazar 662
                      {{:description}}
2849 eleazar 663
                   </td>
2507 eleazar 664
                </tr>
665
                <tr>
2897 eleazar 666
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
2895 eleazar 667
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
2519 eleazar 668
 
669
                        <textarea
2851 eleazar 670
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 671
                            class="form-control"
672
                        ></textarea>
673
 
2888 eleazar 674
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 675
 
2889 eleazar 676
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 677
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
678
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
679
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
680
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
681
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
682
                        </select>
683
                    </td>
2506 eleazar 684
                </tr>
685
            {{/for}}
686
 
2300 eleazar 687
        {{/for}}
688
    </tbody>
2293 eleazar 689
</table>
2241 eleazar 690
</script>