Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3460 | Rev 3463 | 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))
3454 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)
3454 eleazar 299
                $("#interview").show()
2785 eleazar 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']);
3454 eleazar 327
                    $('#vacancy_uuid').change();
2887 eleazar 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();
3454 eleazar 348
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 349
    })
3454 eleazar 350
 
351
    $('#form-filter #candidate_uuid').change(function(e) {
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();
3454 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
    });
3120 eleazar 377
 
3454 eleazar 378
    $('#vacancy_uuid').on('change', function () {
3124 eleazar 379
        $('#candidate_uuid').html('');
2042 eleazar 380
 
2029 eleazar 381
        $.ajax({
382
            'dataType': 'json',
383
            'accept': 'application/json',
384
            'method': 'get',
3125 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
        })
3120 eleazar 405
    });
2032 eleazar 406
 
3454 eleazar 407
    $('#vacancy_uuid').change();
2785 eleazar 408
 
3454 eleazar 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)
416
        $("#report-button").attr('href', data.reportUrl)
3461 eleazar 417
 
3454 eleazar 418
 
419
    });
3341 eleazar 420
});
1709 eleazar 421
JS;
422
$this->inlineScript()->captureEnd();
423
?>
424
 
3460 eleazar 425
<!-- Content Header (Page header) -->
426
<section class="main-header">
427
	<div class="container-fluid">
428
    	<div class="row mb-2">
429
        	<div class="col-sm-12">
430
            	<h1>LABEL_INTERVIEW</h1>
431
			</div>
432
		</div>
433
	</div><!-- /.container-fluid -->
434
</section>
1709 eleazar 435
 
3460 eleazar 436
<section id="content">
437
    <div class="container-fluid">
438
        <div class="row">
439
            <div class="col-12">
440
                <div class="card">
441
                    <div class="card-header">
442
 
443
                        <?php echo $this->form()->closeTag($form); ?>
444
                    </div>
445
                    <div class="card-body">
446
                        <table id="gridTable" class="table   table-hover">
447
                            <thead>
448
                            <tr>
449
                                <th>LABEL_FIRST_NAME</th>
450
                                <th>LABEL_LAST_NAME</th>
451
                                <th>LABEL_EMAIL</th>
452
                                <th>LABEL_ACTIONS</th>
453
                            </tr>
454
                            </thead>
455
                            <tbody>
456
                            </tbody>
457
                        </table>
458
                    </div>
459
                    <div class="card-footer clearfix">
460
                        <div style="float:right;">
461
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
462
                        </div>
463
                    </div>
464
                </div>
465
            </div>
466
        </div>
467
    </div>
468
</section>
469
 
3459 eleazar 470
<section id="main" style="display: none;">
3451 eleazar 471
	<div class="container-fluid">
3459 eleazar 472
    	<div class="row p-2">
3454 eleazar 473
        	<div class="col-12">
3459 eleazar 474
                <?php
475
                    $form->setAttributes([
476
                        'method' => 'post',
477
                        'name' => 'form-interview',
478
                        'id' => 'form-interview'
479
                    ]);
480
                    $form->prepare();
481
                    echo $this->form()->openTag($form);
482
                ?>
483
			    	<div class="card">
484
                        <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
485
                            <li class="nav-item" role="presentation">
486
                                <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>
487
                            </li>
488
                            <li class="nav-item" role="presentation">
489
                                <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>
490
                            </li>
491
                            <li class="nav-item" role="presentation">
492
                                <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>
493
                            </li>
494
                        </ul>
495
 
496
			    		<div class="tab-content">
497
                            <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
498
                            <div class="row">
499
                                <div class="col-md-6 col-sm-12">
500
                                    <div class="form-group">
3451 eleazar 501
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
3459 eleazar 502
                                        <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
503
                                            <?php foreach($this->vacancies as $vacancy): ?>
504
                                                <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
505
                                            <?php endforeach; ?>
506
                                        </select>
507
                                    </div>
508
                                </div>
509
 
3449 eleazar 510
                            </div>
3459 eleazar 511
 
512
                            <div class="row p-2">
513
                                    <div class="col-md-6 col-sm-12">
514
                                        <div class="form-group">
515
                                            <label for="candidate_uuid">LABEL_CANDIDATES</label>
516
                                            <select id="candidate_uuid" name="candidate_uuid" class="form-control">
517
                                            </select>
518
                                        </div>
519
                                    </div>
520
                                    <div id="job-description"></div>
521
                                </div>
3451 eleazar 522
                            </div>
3459 eleazar 523
                            <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
524
                                <div class="row p-2">
525
                                   <div class="col-md-12 col-sm-12 col-xs-12" id="competencies-job" style="margin-top: 1px;">
526
                                   </div>
527
                                </div>
3451 eleazar 528
                            </div>
3459 eleazar 529
                            <div class="tab-pane fade" id="custom-tabs-evaluation" role="tabpanel" aria-labelledby="custom-tabs-evaluation-tab">
530
                                <div class="row p-2">
531
                                    <div class="col-12">
532
                                        <div class="form-group">
533
                                            <?php
534
                                            $element = $form->get('comment');
535
                                            $element->setOptions(['label' => 'LABEL_COMMENT']);
536
                                            $element->setAttributes(['class' => 'form-control']);
537
                                            echo $this->formLabel($element);
538
                                            echo $this->formText($element);
539
                                            ?>
540
                                        </div>
541
                                        <div class="form-group">
542
                                            <?php
543
                                            $element = $form->get('points');
544
                                            $element->setAttributes(['class' => 'form-control']);
545
                                            $element->setOptions(['label' => 'LABEL_EVALUATION']);
546
                                            echo $this->formLabel($element);
547
                                            echo $this->formSelect($element);
548
                                            ?>
549
                                        </div>
550
                                        <div class="form-group">
551
                                            <?php
552
                                            $element = $form->get('status');
553
                                            $element->setAttributes(['class' => 'form-control']);
554
                                            $element->setOptions(['label' => 'LABEL_STATUS']);
555
                                            echo $this->formLabel($element);
556
                                            echo $this->formSelect($element);
557
                                            ?>
558
                                        </div>
559
                                        <div class="form-group">
560
                                            <?php
561
                                            $element = $form->get('type');
562
                                            $element->setAttributes(['class' => 'form-control']);
563
                                            $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
564
                                            echo $this->formLabel($element);
565
                                            echo $this->formSelect($element);
566
                                            ?>
567
                                        </div>
568
                                    </div>
569
                                </div>
570
                            </div>
571
                            <div class="card-footer clearfix">
572
                                <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
573
                                <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
574
                                <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
575
                            </div>
576
                       	</div>
3062 eleazar 577
                    </div>
3459 eleazar 578
                <?php echo $this->form()->closeTag($form); ?>
3062 eleazar 579
            </div>
580
        </div>
2015 eleazar 581
 	</div>
582
</section>
2052 eleazar 583
 
584
<script id="job-description-template" type="text/x-jsrender">
585
    <div class="card">
586
        <div class="card-body">
587
            <h5 class="card-title">{{:job_description.name}}</h5>
588
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 589
            <p class="card-text">{{:job_description.objectives}}</p>
590
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 591
        </div>
592
    </div>
2061 eleazar 593
</script>
594
 
3459 eleazar 595
<script id="competenciesTemplata" type="text/x-jsrender">
596
<table class="table table-bordered" id="panel-{{:slug_section}}">
2293 eleazar 597
    <thead>
598
        <tr>
2306 eleazar 599
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 600
           <th style="width: 50%;">LABEL_TITLE</th>
601
        </tr>
3459 eleazar 602
    </thead>
2300 eleazar 603
    <tbody>
604
        {{for job_description.competencies}}
605
            <tr>
606
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 607
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 608
            </tr>
3459 eleazar 609
 
2302 eleazar 610
            {{for behaviors}}
2308 eleazar 611
                <tr>
2302 eleazar 612
                   <td class="text-left">--LABEL_CONDUCT</td>
613
                   <td class="text-left">
2303 eleazar 614
                      {{:description}}
3459 eleazar 615
                   </td>
3393 eleazar 616
                </tr>
617
                <tr>
618
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
3391 eleazar 619
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
3459 eleazar 620
 
2519 eleazar 621
                        <textarea
2851 eleazar 622
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 623
                            class="form-control"
624
                        ></textarea>
3459 eleazar 625
 
2888 eleazar 626
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 627
 
2889 eleazar 628
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 629
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
630
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
631
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
632
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
633
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
634
                        </select>
3392 eleazar 635
                    </td>
2506 eleazar 636
                </tr>
637
            {{/for}}
638
 
2300 eleazar 639
        {{/for}}
640
    </tbody>
2293 eleazar 641
</table>
2241 eleazar 642
</script>
3459 eleazar 643
 
644
<script id="competenciesTemplate" type="text/x-jsrender">
645
<table class="table table-bordered" id="panel-{{:slug_section}}">
646
    <thead>
647
        <tr>
648
           <th style="width: 50%;">LABEL_ELEMENT</th>
649
           <th style="width: 50%;">LABEL_TITLE</th>
650
        </tr>
651
    </thead>
652
    <tbody>
653
        {{for job_description.competencies}}
654
            <tr>
655
               <td class="text-left">LABEL_COMPETENCY</td>
656
               <td class="text-left">{{:competency_name}}</td>
657
            </tr>
658
 
659
            {{for behaviors}}
660
                <tr>
661
                    <td colspan="2">
662
                        <table class="table table-borderless">
663
                            <tr>
664
                                <td class="text-left">--LABEL_CONDUCT</td>
665
                                <td class="text-left">
666
                                    {{:description}}
667
                                </td>
668
                            </tr>
669
                            <tr>
670
                                <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
671
                                    <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
672
 
673
                                    <textarea
674
                                        id="textarea-{{:competency_uuid}}-{{:uuid}}"
675
                                        class="form-control"
676
                                    ></textarea>
677
 
678
                                    <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
679
 
680
                                    <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
681
                                        <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
682
                                        <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
683
                                        <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
684
                                        <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
685
                                        <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
686
                                    </select>
687
                                </td>
688
                            </tr>
689
                        </table>
690
                    </td>
691
                </tr>
692
            {{/for}}
693
        {{/for}}
694
    </tbody>
695
</table>
696
</script>