Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3463 | Rev 3468 | 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');
3455 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
 
3454 eleazar 72
const classFormGenerator = function() {
73
    this.id = 0,
74
        this.table = '',
75
        this.text = '',
76
        this.behaviors = [],
77
        this.clear = function() {
78
            this.behaviors = [];
79
            this.render();
80
        },
81
 
82
        /**
83
         * Add element to section array
84
         */
85
        this.addSection = function( text, value) {
86
            var d = new Date();
87
            var slug = 'section' + d.getTime();
88
            var position = 0;
89
            $.each(this.behaviors, function(index, section) {
90
                if (position < section.position) {
91
                    position = section.position;
92
                }
93
            });
94
            position++;
95
            var section = {
96
                'slug_behaviors': slug,
97
                'text': text,
98
                'value': value,
99
                'position': position,
100
                'questions': [],
101
                'status': 0
102
            }
103
            this.behaviors.push(section);
104
        },
105
         /**
106
         * Edit element to section array
107
         */
108
        this.editSection = function(slug, text, value) {
109
            var renderTable = false;
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;
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;
127
            for (i = 0; i < this.behaviors.length; i++) {
128
                if (slug == this.behaviors[i].slug_behaviors) {
129
                    this.behaviors.splice(i, 1);
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( $ ) {
3454 eleazar 141
    var objFormGenerator = new classFormGenerator();
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']);
3454 eleazar 224
                    $('#main').show();
225
                    $('#interview').hide();
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('')
3454 eleazar 262
                $("#interview #points").val('');
263
 
2264 eleazar 264
                $("#competencies-job").html($("#competenciesTemplate").render(data))
3466 eleazar 265
 
2812 eleazar 266
                $("#form-interview").attr('action', url)
3466 eleazar 267
                $("#content").hide();
268
                $("#main").show()
1877 eleazar 269
            } else {
2015 eleazar 270
                $.fn.showError(response['data']);
1877 eleazar 271
            }
2015 eleazar 272
        }).fail(function(jqXHR, textStatus, errorThrown) {
273
            $.fn.showError(textStatus);
274
        }).always(function() {
275
            NProgress.done();
1877 eleazar 276
        });
2015 eleazar 277
    });
2785 eleazar 278
 
279
    $('body').on('click', 'button.btn-edit', function(e) {
2807 eleazar 280
        var url = $(this).data('url');
2785 eleazar 281
        e.preventDefault();
282
        NProgress.start();
283
        $.ajax({
284
            'dataType': 'json',
285
            'accept': 'application/json',
286
            'method': 'get',
2807 eleazar 287
            'url': url,
2785 eleazar 288
        }).done(function(response) {
289
            if (response['success']) {
290
                var data = response.data
2798 eleazar 291
                $("#interview #comment").val(data['interview']['comment']);
292
                $('#interview #status').val(data['interview']['status']);
293
                $('#interview #type').val(data['interview']['type']);
294
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 295
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 296
                data.interview.content.forEach(obj => {
2896 eleazar 297
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
298
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 299
                })
2808 eleazar 300
                $("#form-interview").attr('action', url)
3454 eleazar 301
                $("#interview").show()
2785 eleazar 302
            } else {
303
                $.fn.showError(response['data']);
304
            }
305
        }).fail(function(jqXHR, textStatus, errorThrown) {
306
            $.fn.showError(textStatus);
307
        }).always(function() {
308
            NProgress.done();
309
        });
310
    });
2788 eleazar 311
 
312
    $('button.btn-delete').confirmation({
2887 eleazar 313
        rootSelector: 'button.btn-delete',
314
        title: 'LABEL_ARE_YOU_SURE',
315
        singleton: true,
316
        btnOkLabel: 'LABEL_YES',
317
        btnCancelLabel: 'LABEL_NO',
318
        onConfirm: function (value) {
319
            action = $(this).data('href');
320
            NProgress.start();
321
            $.ajax({
322
                'dataType': 'json',
323
                'accept': 'application/json',
324
                'method': 'post',
325
                'url': $(this).data('url'),
326
            }).done(function (response) {
327
                if (response['success']) {
328
                    $.fn.showSuccess(response['data']);
3454 eleazar 329
                    $('#vacancy_uuid').change();
2887 eleazar 330
                } else {
331
                    $.fn.showError(response['data']);
332
                }
333
            }).fail(function (jqXHR, textStatus, errorThrown) {
334
                $.fn.showError(textStatus);
335
            }).always(function () {
336
                NProgress.done();
2788 eleazar 337
            });
2887 eleazar 338
        },
339
    });
2015 eleazar 340
 
341
    $('body').on('click', 'button.btn-cancel', function(e) {
342
        e.preventDefault();
2521 eleazar 343
        $('#main').show();
2015 eleazar 344
        $('#row-form').hide();
345
        $('#div-listing').show();
346
    });
347
 
348
    $('#form-filter #vacancy_uuid').change(function(e) {
349
        e.preventDefault();
3454 eleazar 350
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 351
    })
3454 eleazar 352
 
353
    $('#form-filter #candidate_uuid').change(function(e) {
354
        e.preventDefault();
355
    })
2525 eleazar 356
     /**
357
     * Clicked cancel new/edit Form
358
     */
359
    $('button.btn-edit-cancel').click(function(e) {
360
        e.preventDefault();
3454 eleazar 361
        $('#interview').hide();
2525 eleazar 362
    });
363
    /**
364
     * Clicked save and continue new Form
365
     */
366
    $('button.btn-form-save-continue').click(function(e) {
367
        e.preventDefault();
368
        $('#interview #form-continue').val('1')
2540 eleazar 369
        $('#form-interview').submit();
2525 eleazar 370
    });
371
    /**
372
     * Clicked save and close new/edit Form
373
     */
374
    $('button.btn-form-save-close').click(function(e) {
375
        e.preventDefault();
376
        $('#interview #form-continue').val('0')
2540 eleazar 377
        $('#form-interview').submit();
2525 eleazar 378
    });
3120 eleazar 379
 
3463 eleazar 380
    $('#vacancy_uuid').on('change', function (event) {
3124 eleazar 381
        $('#candidate_uuid').html('');
2042 eleazar 382
 
3463 eleazar 383
        var uuid = event.target.value;
384
 
385
        $("#add-button").data('url', String('$routeAdd').replaceAll('UUID_PLACEHOLDER', uuid))
386
 
2029 eleazar 387
        $.ajax({
388
            'dataType': 'json',
389
            'accept': 'application/json',
390
            'method': 'get',
3125 eleazar 391
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 392
        }).done(function (response) {
393
            var data = response.data
394
 
2036 eleazar 395
            data.candidates.forEach(function (candidate) {
2761 eleazar 396
                var option = $('<option />')
397
                    .val(candidate.uuid)
2777 eleazar 398
                    .text(candidate.first_name)
399
                    .data('addUrl', candidate.add_url)
400
                    .data('editUrl', candidate.edit_url)
401
                    .data('deleteUrl', candidate.delete_url)
2879 eleazar 402
                    .data('reportUrl', candidate.report_url)
2041 eleazar 403
 
404
                $('#candidate_uuid').append(option);
2036 eleazar 405
            });
2052 eleazar 406
 
2785 eleazar 407
            $('#candidate_uuid').change();
408
 
2244 eleazar 409
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 410
        })
3120 eleazar 411
    });
2032 eleazar 412
 
3454 eleazar 413
    $('#vacancy_uuid').change();
2785 eleazar 414
 
3454 eleazar 415
 
3463 eleazar 416
 
3341 eleazar 417
});
1709 eleazar 418
JS;
419
$this->inlineScript()->captureEnd();
420
?>
421
 
3460 eleazar 422
<!-- Content Header (Page header) -->
423
<section class="main-header">
424
	<div class="container-fluid">
425
    	<div class="row mb-2">
426
        	<div class="col-sm-12">
427
            	<h1>LABEL_INTERVIEW</h1>
428
			</div>
429
		</div>
430
	</div><!-- /.container-fluid -->
431
</section>
1709 eleazar 432
 
3460 eleazar 433
<section id="content">
434
    <div class="container-fluid">
435
        <div class="row">
436
            <div class="col-12">
437
                <div class="card">
438
                    <div class="card-header">
439
 
440
                        <?php echo $this->form()->closeTag($form); ?>
441
                    </div>
442
                    <div class="card-body">
443
                        <table id="gridTable" class="table   table-hover">
444
                            <thead>
445
                            <tr>
446
                                <th>LABEL_FIRST_NAME</th>
447
                                <th>LABEL_LAST_NAME</th>
448
                                <th>LABEL_EMAIL</th>
449
                                <th>LABEL_ACTIONS</th>
450
                            </tr>
451
                            </thead>
452
                            <tbody>
453
                            </tbody>
454
                        </table>
455
                    </div>
456
                    <div class="card-footer clearfix">
457
                        <div style="float:right;">
458
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
459
                        </div>
460
                    </div>
461
                </div>
462
            </div>
463
        </div>
464
    </div>
465
</section>
466
 
3459 eleazar 467
<section id="main" style="display: none;">
3451 eleazar 468
	<div class="container-fluid">
3459 eleazar 469
    	<div class="row p-2">
3454 eleazar 470
        	<div class="col-12">
3459 eleazar 471
                <?php
472
                    $form->setAttributes([
473
                        'method' => 'post',
474
                        'name' => 'form-interview',
475
                        'id' => 'form-interview'
476
                    ]);
477
                    $form->prepare();
478
                    echo $this->form()->openTag($form);
479
                ?>
480
			    	<div class="card">
481
                        <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
482
                            <li class="nav-item" role="presentation">
483
                                <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>
484
                            </li>
485
                            <li class="nav-item" role="presentation">
486
                                <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>
487
                            </li>
488
                            <li class="nav-item" role="presentation">
489
                                <a class="nav-link" id="custom-tabs-evaluation-tab" data-toggle="tab" href="#custom-tabs-evaluation" role="tab" aria-controls="custom-tabs-evaluation" aria-selected="false">LABEL_CONCLUTION</a>
490
                            </li>
491
                        </ul>
492
 
493
			    		<div class="tab-content">
494
                            <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
495
                            <div class="row">
496
                                <div class="col-md-6 col-sm-12">
497
                                    <div class="form-group">
3451 eleazar 498
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
3459 eleazar 499
                                        <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
500
                                            <?php foreach($this->vacancies as $vacancy): ?>
501
                                                <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
502
                                            <?php endforeach; ?>
503
                                        </select>
504
                                    </div>
505
                                </div>
506
 
3449 eleazar 507
                            </div>
3459 eleazar 508
 
509
                            <div class="row p-2">
510
                                    <div class="col-md-6 col-sm-12">
511
                                        <div class="form-group">
512
                                            <label for="candidate_uuid">LABEL_CANDIDATES</label>
513
                                            <select id="candidate_uuid" name="candidate_uuid" class="form-control">
514
                                            </select>
515
                                        </div>
516
                                    </div>
517
                                    <div id="job-description"></div>
518
                                </div>
3451 eleazar 519
                            </div>
3459 eleazar 520
                            <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
521
                                <div class="row p-2">
522
                                   <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
523
                                   </div>
524
                                </div>
3451 eleazar 525
                            </div>
3459 eleazar 526
                            <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
527
                                <div class="row p-2">
528
                                    <div class="col-12">
529
                                        <div class="form-group">
530
                                            <?php
531
                                            $element = $form->get('comment');
532
                                            $element->setOptions(['label' => 'LABEL_COMMENT']);
533
                                            $element->setAttributes(['class' => 'form-control']);
534
                                            echo $this->formLabel($element);
535
                                            echo $this->formText($element);
536
                                            ?>
537
                                        </div>
538
                                        <div class="form-group">
539
                                            <?php
540
                                            $element = $form->get('points');
541
                                            $element->setAttributes(['class' => 'form-control']);
542
                                            $element->setOptions(['label' => 'LABEL_EVALUATION']);
543
                                            echo $this->formLabel($element);
544
                                            echo $this->formSelect($element);
545
                                            ?>
546
                                        </div>
547
                                        <div class="form-group">
548
                                            <?php
549
                                            $element = $form->get('status');
550
                                            $element->setAttributes(['class' => 'form-control']);
551
                                            $element->setOptions(['label' => 'LABEL_STATUS']);
552
                                            echo $this->formLabel($element);
553
                                            echo $this->formSelect($element);
554
                                            ?>
555
                                        </div>
556
                                        <div class="form-group">
557
                                            <?php
558
                                            $element = $form->get('type');
559
                                            $element->setAttributes(['class' => 'form-control']);
560
                                            $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
561
                                            echo $this->formLabel($element);
562
                                            echo $this->formSelect($element);
563
                                            ?>
564
                                        </div>
565
                                    </div>
566
                                </div>
567
                            </div>
568
                            <div class="card-footer clearfix">
569
                                <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
570
                                <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
571
                                <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
572
                            </div>
573
                       	</div>
3062 eleazar 574
                    </div>
3459 eleazar 575
                <?php echo $this->form()->closeTag($form); ?>
3062 eleazar 576
            </div>
577
        </div>
2015 eleazar 578
 	</div>
579
</section>
2052 eleazar 580
 
581
<script id="job-description-template" type="text/x-jsrender">
582
    <div class="card">
583
        <div class="card-body">
584
            <h5 class="card-title">{{:job_description.name}}</h5>
585
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 586
            <p class="card-text">{{:job_description.objectives}}</p>
587
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 588
        </div>
589
    </div>
2061 eleazar 590
</script>
591
 
3459 eleazar 592
<script id="competenciesTemplata" type="text/x-jsrender">
593
<table class="table table-bordered" id="panel-{{:slug_section}}">
2293 eleazar 594
    <thead>
595
        <tr>
2306 eleazar 596
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 597
           <th style="width: 50%;">LABEL_TITLE</th>
598
        </tr>
3459 eleazar 599
    </thead>
2300 eleazar 600
    <tbody>
601
        {{for job_description.competencies}}
602
            <tr>
603
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 604
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 605
            </tr>
3459 eleazar 606
 
2302 eleazar 607
            {{for behaviors}}
2308 eleazar 608
                <tr>
2302 eleazar 609
                   <td class="text-left">--LABEL_CONDUCT</td>
610
                   <td class="text-left">
2303 eleazar 611
                      {{:description}}
3459 eleazar 612
                   </td>
3393 eleazar 613
                </tr>
614
                <tr>
615
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
3391 eleazar 616
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
3459 eleazar 617
 
2519 eleazar 618
                        <textarea
2851 eleazar 619
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 620
                            class="form-control"
621
                        ></textarea>
3459 eleazar 622
 
2888 eleazar 623
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 624
 
2889 eleazar 625
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 626
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
627
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
628
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
629
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
630
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
631
                        </select>
3392 eleazar 632
                    </td>
2506 eleazar 633
                </tr>
634
            {{/for}}
635
 
2300 eleazar 636
        {{/for}}
637
    </tbody>
2293 eleazar 638
</table>
2241 eleazar 639
</script>
3459 eleazar 640
 
641
<script id="competenciesTemplate" type="text/x-jsrender">
642
<table class="table table-bordered" id="panel-{{:slug_section}}">
643
    <thead>
644
        <tr>
645
           <th style="width: 50%;">LABEL_ELEMENT</th>
646
           <th style="width: 50%;">LABEL_TITLE</th>
647
        </tr>
648
    </thead>
649
    <tbody>
650
        {{for job_description.competencies}}
651
            <tr>
652
               <td class="text-left">LABEL_COMPETENCY</td>
653
               <td class="text-left">{{:competency_name}}</td>
654
            </tr>
655
 
656
            {{for behaviors}}
657
                <tr>
658
                    <td colspan="2">
659
                        <table class="table table-borderless">
660
                            <tr>
661
                                <td class="text-left">--LABEL_CONDUCT</td>
662
                                <td class="text-left">
663
                                    {{:description}}
664
                                </td>
665
                            </tr>
666
                            <tr>
667
                                <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
668
                                    <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
669
 
670
                                    <textarea
671
                                        id="textarea-{{:competency_uuid}}-{{:uuid}}"
672
                                        class="form-control"
673
                                    ></textarea>
674
 
675
                                    <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
676
 
677
                                    <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
678
                                        <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
679
                                        <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
680
                                        <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
681
                                        <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
682
                                        <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
683
                                    </select>
684
                                </td>
685
                            </tr>
686
                        </table>
687
                    </td>
688
                </tr>
689
            {{/for}}
690
        {{/for}}
691
    </tbody>
692
</table>
693
</script>