Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 2887 | Rev 2889 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1709 eleazar 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
2029 eleazar 6
$routeIndex = $this->url('recruitment-and-selection/interview/form');
2128 eleazar 7
$routeAdd = $this->url('recruitment-and-selection/interview/form/add', ['candidate_uuid' => 'UUID_PLACEHOLDER']);
1877 eleazar 8
 
1827 eleazar 9
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/interview/form/add') ? 1 : 0;
1709 eleazar 10
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
11
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
12
 
13
 
14
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
15
 
16
 
1885 eleazar 17
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
1709 eleazar 18
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
19
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
20
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
21
 
22
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
23
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
24
 
25
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
29
 
30
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
33
 
34
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
36
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
38
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
39
 
40
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
41
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
43
 
1887 eleazar 44
 
2746 eleazar 45
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
47
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
48
 
1887 eleazar 49
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
1709 eleazar 50
 
2052 eleazar 51
// JsRender //
52
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
1709 eleazar 53
 
2510 eleazar 54
 
55
$points_0 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_0;
56
$points_1 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_1;
57
$points_2 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_2;
58
$points_3 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_3;
59
$points_4 = \LeadersLinked\Model\RecruitmentSelectionInterview::POINTS_4;
60
 
61
 
62
 
1709 eleazar 63
$this->headStyle()->captureStart();
64
echo <<<CSS
65
 
66
CSS;
67
$this->headStyle()->captureEnd();
68
 
69
$this->inlineScript()->captureStart();
70
echo <<<JS
71
 
2503 eleazar 72
const classFormGenerator = function() {
73
    this.id = 0,
74
        this.table = '',
75
        this.text = '',
2506 eleazar 76
        this.behaviors = [],
2503 eleazar 77
        this.clear = function() {
2506 eleazar 78
            this.behaviors = [];
2503 eleazar 79
            this.render();
80
        },
81
 
82
        /**
83
         * Add element to section array
84
         */
2506 eleazar 85
        this.addSection = function( text, value) {
2503 eleazar 86
            var d = new Date();
87
            var slug = 'section' + d.getTime();
88
            var position = 0;
2506 eleazar 89
            $.each(this.behaviors, function(index, section) {
2503 eleazar 90
                if (position < section.position) {
91
                    position = section.position;
92
                }
93
            });
94
            position++;
95
            var section = {
2506 eleazar 96
                'slug_behaviors': slug,
2503 eleazar 97
                'text': text,
98
                'value': value,
99
                'position': position,
100
                'questions': [],
101
                'status': 0
102
            }
2506 eleazar 103
            this.behaviors.push(section);
2503 eleazar 104
        },
105
         /**
106
         * Edit element to section array
107
         */
2506 eleazar 108
        this.editSection = function(slug, text, value) {
2503 eleazar 109
            var renderTable = false;
2506 eleazar 110
            for (i = 0; i < this.behaviors.length; i++) {
111
                if (slug == this.behaviors[i].slug_behaviors) {
112
                    this.behaviors[i].text = text;
113
                    this.behaviors[i].value = value;
2503 eleazar 114
                    renderTable = true;
115
                    break;
116
                }
117
            }
118
            if (renderTable) {
119
                this.renderSection(slug);
120
            }
121
        },
122
         /**
123
         * Remove element to section array
124
         */
125
        this.deleteSection = function(slug) {
126
            var renderTable = false;
2506 eleazar 127
            for (i = 0; i < this.behaviors.length; i++) {
128
                if (slug == this.behaviors[i].slug_behaviors) {
129
                    this.behaviors.splice(i, 1);
2503 eleazar 130
                    renderTable = true;
131
                    break;
132
                }
133
            }
134
            if (renderTable) {
135
                $('#panel' + slug).remove();
136
            }
137
        }
138
}
139
 
1709 eleazar 140
jQuery( document ).ready(function( $ ) {
2504 eleazar 141
    var objFormGenerator = new classFormGenerator();
2506 eleazar 142
    //objFormGenerator.render();
1877 eleazar 143
    $.validator.setDefaults({
2015 eleazar 144
        debug: true,
145
        highlight: function(element) {
146
            $(element).addClass('is-invalid');
147
        },
148
        unhighlight: function(element) {
149
            $(element).removeClass('is-invalid');
150
        },
151
        errorElement: 'span',
152
        errorClass: 'error invalid-feedback',
153
        errorPlacement: function(error, element) {
154
            if(element.parent('.btn-file').length) {
155
                error.insertAfter(element.parent().parent());
156
            } else if(element.parent('.toggle').length) {
157
                error.insertAfter(element.parent().parent());
158
            } else {
159
                error.insertAfter(element.parent());
1709 eleazar 160
            }
2015 eleazar 161
        }
162
    });
1709 eleazar 163
 
2015 eleazar 164
    $.fn.showFormErrorValidator = function(fieldname, errors) {
165
        var field = $(fieldname);
166
        if(field) {
167
            $(field).addClass('is-invalid');
1709 eleazar 168
 
2015 eleazar 169
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
170
 
171
            if(element.parent('.btn-file').length) {
172
                error.insertAfter(element.parent().parent());
173
            } else if(element.parent('.toggle').length) {
174
                error.insertAfter(element.parent().parent());
175
            } else {
176
                error.insertAfter(element.parent());
1709 eleazar 177
            }
2015 eleazar 178
        }
179
    };
1827 eleazar 180
 
2523 eleazar 181
    function getContent() {
182
        return $('[data-behavior-textarea]').map(
183
            function (idx, td) {
184
                const uuid = $(td).data('behavior-textarea');
185
                const textarea = $(td).find('textarea');
186
                const select = $(td).find('select');
2521 eleazar 187
 
2523 eleazar 188
                return {
189
                    uuid: uuid,
190
                    comment: textarea.val(),
191
                    evaluation: select.val(),
192
                }
193
            }
194
        ).get()
195
    }
196
 
2537 eleazar 197
    var validator = $('#form-interview').validate({
1877 eleazar 198
        debug: true,
199
        onclick: false,
200
        onkeyup: false,
201
        ignore: [],
2534 eleazar 202
        rules: {},
1877 eleazar 203
        submitHandler: function(form) {
204
            $.ajax({
205
                'dataType': 'json',
206
                'accept': 'application/json',
207
                'method': 'post',
2809 eleazar 208
                'url': $('#form-interview').attr('action'),
2523 eleazar 209
                'data': {
2571 eleazar 210
                    content: JSON.stringify(getContent()),
2523 eleazar 211
                    vacancy_uuid: $('#vacancy_uuid').val(),
212
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 213
                    points: $('#points').val(),
2744 eleazar 214
                    comment: $('#comment').val(),
2747 eleazar 215
                    type: $('#type').val(),
2749 eleazar 216
                    status: $('#status').val(),
2523 eleazar 217
                }
1877 eleazar 218
            }).done(function(response) {
219
                NProgress.start();
220
                if (response['success']) {
221
                    $.fn.showSuccess(response['data']);
2521 eleazar 222
                    $('#main').show();
2536 eleazar 223
                    $('#interview').hide();
2791 eleazar 224
                    $('#vacancy_uuid').change();
1877 eleazar 225
                } else {
226
                    validator.resetForm();
227
                    if (jQuery.type(response['data']) == 'string') {
228
                        $.fn.showError(response['data']);
229
                    } else {
230
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 231
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 232
                        });
233
                    }
234
                }
235
            }).fail(function(jqXHR, textStatus, errorThrown) {
236
                $.fn.showError(textStatus);
237
            }).always(function() {
238
                NProgress.done();
239
            });
240
            return false;
241
        },
242
        invalidHandler: function(form, validator) {}
243
    });
1709 eleazar 244
 
2015 eleazar 245
    $('body').on('click', 'button.btn-add', function(e) {
2812 eleazar 246
        var url = $(this).data('url');
2015 eleazar 247
        e.preventDefault();
248
        NProgress.start();
249
        $.ajax({
250
            'dataType': 'json',
251
            'accept': 'application/json',
252
            'method': 'get',
2812 eleazar 253
            'url': url,
2015 eleazar 254
        }).done(function(response) {
255
            if (response['success']) {
2237 eleazar 256
                var data = response.data
2785 eleazar 257
                $("#interview #comment").val('');
258
                $('#interview #status').val('');
259
                $('#interview #type').val('')
260
                $("#interview #points").val('');
261
 
2264 eleazar 262
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2313 eleazar 263
                $("#interview").show()
2812 eleazar 264
                $("#form-interview").attr('action', url)
1877 eleazar 265
            } else {
2015 eleazar 266
                $.fn.showError(response['data']);
1877 eleazar 267
            }
2015 eleazar 268
        }).fail(function(jqXHR, textStatus, errorThrown) {
269
            $.fn.showError(textStatus);
270
        }).always(function() {
271
            NProgress.done();
1877 eleazar 272
        });
2015 eleazar 273
    });
2785 eleazar 274
 
275
    $('body').on('click', 'button.btn-edit', function(e) {
2807 eleazar 276
        var url = $(this).data('url');
2785 eleazar 277
        e.preventDefault();
278
        NProgress.start();
279
        $.ajax({
280
            'dataType': 'json',
281
            'accept': 'application/json',
282
            'method': 'get',
2807 eleazar 283
            'url': url,
2785 eleazar 284
        }).done(function(response) {
285
            if (response['success']) {
286
                var data = response.data
2798 eleazar 287
                $("#interview #comment").val(data['interview']['comment']);
288
                $('#interview #status').val(data['interview']['status']);
289
                $('#interview #type').val(data['interview']['type']);
290
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 291
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 292
                data.interview.content.forEach(obj => {
2888 eleazar 293
                    $('#textarea-' + obj.uuid).val(obj.comment);
294
                    $('#select-' + obj.uuid).val(obj.evaluation);
2887 eleazar 295
                })
2808 eleazar 296
                $("#form-interview").attr('action', url)
2785 eleazar 297
                $("#interview").show()
298
            } else {
299
                $.fn.showError(response['data']);
300
            }
301
        }).fail(function(jqXHR, textStatus, errorThrown) {
302
            $.fn.showError(textStatus);
303
        }).always(function() {
304
            NProgress.done();
305
        });
306
    });
2788 eleazar 307
 
308
    $('button.btn-delete').confirmation({
2887 eleazar 309
        rootSelector: 'button.btn-delete',
310
        title: 'LABEL_ARE_YOU_SURE',
311
        singleton: true,
312
        btnOkLabel: 'LABEL_YES',
313
        btnCancelLabel: 'LABEL_NO',
314
        onConfirm: function (value) {
315
            action = $(this).data('href');
316
            NProgress.start();
317
            $.ajax({
318
                'dataType': 'json',
319
                'accept': 'application/json',
320
                'method': 'post',
321
                'url': $(this).data('url'),
322
            }).done(function (response) {
323
                if (response['success']) {
324
                    $.fn.showSuccess(response['data']);
325
                    $('#vacancy_uuid').change();
326
                } else {
327
                    $.fn.showError(response['data']);
328
                }
329
            }).fail(function (jqXHR, textStatus, errorThrown) {
330
                $.fn.showError(textStatus);
331
            }).always(function () {
332
                NProgress.done();
2788 eleazar 333
            });
2887 eleazar 334
        },
335
    });
2015 eleazar 336
 
337
    $('body').on('click', 'button.btn-cancel', function(e) {
338
        e.preventDefault();
2521 eleazar 339
        $('#main').show();
2015 eleazar 340
        $('#row-form').hide();
341
        $('#div-listing').show();
342
    });
343
 
344
    $('#form-filter #vacancy_uuid').change(function(e) {
345
        e.preventDefault();
2577 eleazar 346
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 347
    })
2118 eleazar 348
 
2577 eleazar 349
    $('#form-filter #candidate_uuid').change(function(e) {
2015 eleazar 350
        e.preventDefault();
351
    })
2525 eleazar 352
     /**
353
     * Clicked cancel new/edit Form
354
     */
355
    $('button.btn-edit-cancel').click(function(e) {
356
        e.preventDefault();
2526 eleazar 357
        $('#interview').hide();
2525 eleazar 358
    });
359
    /**
360
     * Clicked save and continue new Form
361
     */
362
    $('button.btn-form-save-continue').click(function(e) {
363
        e.preventDefault();
364
        $('#interview #form-continue').val('1')
2540 eleazar 365
        $('#form-interview').submit();
2525 eleazar 366
    });
367
    /**
368
     * Clicked save and close new/edit Form
369
     */
370
    $('button.btn-form-save-close').click(function(e) {
371
        e.preventDefault();
372
        $('#interview #form-continue').val('0')
2540 eleazar 373
        $('#form-interview').submit();
2525 eleazar 374
    });
2029 eleazar 375
 
376
    $('#vacancy_uuid').on('change', function () {
2042 eleazar 377
        $('#candidate_uuid').html('');
378
 
2029 eleazar 379
        $.ajax({
380
            'dataType': 'json',
381
            'accept': 'application/json',
382
            'method': 'get',
2031 eleazar 383
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 384
        }).done(function (response) {
385
            var data = response.data
386
 
2036 eleazar 387
            data.candidates.forEach(function (candidate) {
2761 eleazar 388
                var option = $('<option />')
389
                    .val(candidate.uuid)
2777 eleazar 390
                    .text(candidate.first_name)
391
                    .data('addUrl', candidate.add_url)
392
                    .data('editUrl', candidate.edit_url)
393
                    .data('deleteUrl', candidate.delete_url)
2879 eleazar 394
                    .data('reportUrl', candidate.report_url)
2041 eleazar 395
 
396
                $('#candidate_uuid').append(option);
2036 eleazar 397
            });
2052 eleazar 398
 
2785 eleazar 399
            $('#candidate_uuid').change();
400
 
2244 eleazar 401
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 402
        })
403
    });
2032 eleazar 404
 
405
    $('#vacancy_uuid').change();
2785 eleazar 406
 
407
    $('#candidate_uuid').on('change', function () {
408
        const uuid = $('#candidate_uuid').val();
409
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
410
 
411
        $('#add-button').data('url', data.addUrl)
412
        $("#edit-button").data('url', data.editUrl)
413
        $("#delete-button").data('url', data.deleteUrl)
2879 eleazar 414
        $("#report-button").data('url', data.reportUrl)
2785 eleazar 415
        if (data.addUrl) {
416
            $('#add-button').show();
2879 eleazar 417
            $('#report-button').show();
2785 eleazar 418
            $('#edit-button').hide();
419
            $('#delete-button').hide();
420
        } else {
421
            $('#add-button').hide();
422
            $('#edit-button').show();
423
            $('#delete-button').show();
2879 eleazar 424
            $('#report-button').show();
2785 eleazar 425
        }
426
 
427
    });
1709 eleazar 428
});
429
JS;
430
$this->inlineScript()->captureEnd();
431
?>
432
 
433
 
434
<!-- Content Header (Page header) -->
2521 eleazar 435
<section class="main-header">
1709 eleazar 436
	<div class="container-fluid">
437
    	<div class="row mb-2">
438
        	<div class="col-sm-12">
439
            	<h1>LABEL_INTERVIEW</h1>
440
			</div>
441
		</div>
442
	</div><!-- /.container-fluid -->
443
</section>
444
 
2521 eleazar 445
<section class="main">
1709 eleazar 446
	<div class="container-fluid">
447
    	<div class="row">
448
        	<div class="col-12">
2537 eleazar 449
 
450
				<div class="card">
451
					<div class="card-header">
452
                        <div class="row">
453
                            <div class="col-md-6 col-sm-12">
454
                                <div class="form-group">
455
                                    <label for="vacancy_uuid">LABEL_VACANCY</label>
456
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
457
                                        <?php foreach($this->vacancies as $vacancy): ?>
458
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
459
                                        <?php endforeach; ?>
460
                                    </select>
461
                                </div>
1709 eleazar 462
                            </div>
2537 eleazar 463
                            <div class="col-md-6 col-sm-12">
464
                                <div class="form-group">
465
                                    <label for="candidate_uuid">LABEL_CANDIDATES</label>
466
                                    <select id="candidate_uuid" name="candidate_uuid" class="form-control">
467
                                    </select>
468
                                </div>
1709 eleazar 469
                            </div>
2537 eleazar 470
                            <div
471
                                class="col-md-12 col-sm-12"
472
                            >
473
                            </div>
1709 eleazar 474
                        </div>
2537 eleazar 475
					</div>
476
					<div class="card-body">
477
                        <div id="job-description"></div>
478
                   	</div>
479
                    <div class="card-footer clearfix">
480
                        <div style="float:right;">
2785 eleazar 481
                            <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
2864 eleazar 482
                            <button id="report-button" type="button" class="btn btn-primary btn-report"><i class="fa fa-file"></i> LABEL_REPORT </button>
483
                            <button id="edit-button" type="button" class="btn btn-primary btn-edit"><i class="fa fa-edit"></i> LABEL_EDIT </button>
484
                            <button id="delete-button" type="button" class="btn btn-primary btn-delete"><i class="fa fa-ban"></i> LABEL_DELETE </button>
2537 eleazar 485
                        </div>
2015 eleazar 486
                    </div>
2537 eleazar 487
                 </div>
1876 eleazar 488
            </div>
2015 eleazar 489
        </div>
490
 	</div>
491
</section>
2052 eleazar 492
 
493
<script id="job-description-template" type="text/x-jsrender">
494
    <div class="card">
495
        <div class="card-body">
496
            <h5 class="card-title">{{:job_description.name}}</h5>
497
            <p class="card-text">{{:vacancy.description}}</p>
2214 eleazar 498
            <p class="card-text">{{:job_description.objectives}}</p>
499
            <p class="card-text">{{:job_description.functions}}</p>
2052 eleazar 500
        </div>
501
    </div>
2061 eleazar 502
</script>
503
 
2314 eleazar 504
<section id="interview" style="display: none;">
2215 eleazar 505
	<div class="container-fluid">
506
    	<div class="row">
507
        	<div class="col-12">
2537 eleazar 508
                <form action="#" name="form-interview" id="form-interview">
509
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
2689 eleazar 510
			    	<div class="card">
511
                    <?php
512
                         $form->setAttributes([
513
                             'method' => 'post',
514
                             'name' => 'form-add',
515
                             'id' => 'form-add'
516
                         ]);
517
                         $form->prepare();
518
                         echo $this->form()->openTag($form);
519
                         ?>
2537 eleazar 520
			    		<div class="card-header">
521
                            <label>interview</label>
522
			    		</div>
523
			    		<div class="card-body">
524
                            <div id="competencies-job"></div>
2683 eleazar 525
                                <div class="form-group">
526
                                    <?php
527
                                    $element = $form->get('comment');
528
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
529
                                    $element->setAttributes(['class' => 'form-control']);
530
                                    echo $this->formLabel($element);
531
                                    echo $this->formText($element);
532
                                    ?>
533
                                </div>
534
                                <div class="form-group">
535
                                    <?php
536
                                    $element = $form->get('points');
537
                                    $element->setAttributes(['class' => 'form-control']);
538
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
539
                                    echo $this->formLabel($element);
540
                                    echo $this->formSelect($element);
541
                                    ?>
542
                                </div>
2744 eleazar 543
                                <div class="form-group">
544
                                    <?php
545
                                    $element = $form->get('status');
546
                                    $element->setAttributes(['class' => 'form-control']);
547
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
548
                                    echo $this->formLabel($element);
549
                                    echo $this->formSelect($element);
550
                                    ?>
551
                                </div>
552
                                <div class="form-group">
553
                                    <?php
2747 eleazar 554
                                    $element = $form->get('type');
2744 eleazar 555
                                    $element->setAttributes(['class' => 'form-control']);
556
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
557
                                    echo $this->formLabel($element);
558
                                    echo $this->formSelect($element);
559
                                    ?>
560
                                </div>
2537 eleazar 561
                            </div>
562
                       	</div>
563
                        <div class="card-footer clearfix">
564
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
565
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
566
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
2515 eleazar 567
                        </div>
2280 eleazar 568
                    </div>
2537 eleazar 569
                </form>
2215 eleazar 570
            </div>
571
        </div>
572
 	</div>
573
</section>
574
 
2264 eleazar 575
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 576
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 577
    <thead>
578
        <tr>
2306 eleazar 579
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 580
           <th style="width: 50%;">LABEL_TITLE</th>
581
        </tr>
582
    </thead>
2300 eleazar 583
    <tbody>
584
        {{for job_description.competencies}}
585
            <tr>
586
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 587
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 588
            </tr>
2302 eleazar 589
 
590
            {{for behaviors}}
2308 eleazar 591
                <tr>
2302 eleazar 592
                   <td class="text-left">--LABEL_CONDUCT</td>
593
                   <td class="text-left">
2303 eleazar 594
                      {{:description}}
2849 eleazar 595
                   </td>
2507 eleazar 596
                </tr>
597
                <tr>
2858 eleazar 598
                    <td colspan="2" data-behavior-textarea="{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 599
                        <label for="textarea-{{:uuid}}">LABEL_COMMENT</label>
600
 
601
                        <textarea
2851 eleazar 602
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 603
                            class="form-control"
604
                        ></textarea>
605
 
2888 eleazar 606
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 607
 
608
                        <select class="form-control" id="behavior-level-{{:uuid}}">
609
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
610
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
611
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
612
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
613
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
614
                        </select>
615
                    </td>
2506 eleazar 616
                </tr>
617
            {{/for}}
618
 
2300 eleazar 619
        {{/for}}
620
    </tbody>
2293 eleazar 621
</table>
2241 eleazar 622
</script>