Proyectos de Subversion LeadersLinked - Backend

Rev

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