Proyectos de Subversion LeadersLinked - Backend

Rev

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