Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3110 | Rev 3112 | 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
 
3094 eleazar 216
            {
217
                'targets': -1,
218
                'orderable': false,
219
                'render': function(data, type, row) {
3111 eleazar 220
                    s = '';
221
                    if (allowEdit) {
222
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
223
                    }
224
                    if (allowDelete) {
225
                        s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>&nbsp;';
226
                    }
227
                    if (allowReport) {
228
                        s = s + '<a class="btn btn-default btn-pdf" href="' + data['link_report'] + '" target="_blank" data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-file-o"></i> LABEL_PDF </button>&nbsp;';
229
                    }
230
                    return s;
3094 eleazar 231
                }
232
            }
233
        ],
234
    });
235
 
2523 eleazar 236
    function getContent() {
2897 eleazar 237
        return $('[data-competency-behavior]').map(
2523 eleazar 238
            function (idx, td) {
2895 eleazar 239
                const competencyUuid = $(td).data('competency-uuid');
240
                const behaviorUuid = $(td).data('behavior-uuid');
2523 eleazar 241
                const textarea = $(td).find('textarea');
242
                const select = $(td).find('select');
2521 eleazar 243
 
2523 eleazar 244
                return {
2895 eleazar 245
                    competencyUuid: competencyUuid,
246
                    behaviorUuid : behaviorUuid,
2523 eleazar 247
                    comment: textarea.val(),
248
                    evaluation: select.val(),
249
                }
250
            }
251
        ).get()
252
    }
253
 
2537 eleazar 254
    var validator = $('#form-interview').validate({
1877 eleazar 255
        debug: true,
256
        onclick: false,
257
        onkeyup: false,
258
        ignore: [],
2534 eleazar 259
        rules: {},
1877 eleazar 260
        submitHandler: function(form) {
261
            $.ajax({
262
                'dataType': 'json',
263
                'accept': 'application/json',
264
                'method': 'post',
2809 eleazar 265
                'url': $('#form-interview').attr('action'),
2523 eleazar 266
                'data': {
2571 eleazar 267
                    content: JSON.stringify(getContent()),
2523 eleazar 268
                    vacancy_uuid: $('#vacancy_uuid').val(),
269
                    candidate_uuid: $('#candidate_uuid').val(),
2686 eleazar 270
                    points: $('#points').val(),
2744 eleazar 271
                    comment: $('#comment').val(),
2747 eleazar 272
                    type: $('#type').val(),
2749 eleazar 273
                    status: $('#status').val(),
2523 eleazar 274
                }
1877 eleazar 275
            }).done(function(response) {
276
                NProgress.start();
277
                if (response['success']) {
278
                    $.fn.showSuccess(response['data']);
3071 eleazar 279
                    $('#main').hide();
2536 eleazar 280
                    $('#interview').hide();
2791 eleazar 281
                    $('#vacancy_uuid').change();
1877 eleazar 282
                } else {
283
                    validator.resetForm();
284
                    if (jQuery.type(response['data']) == 'string') {
285
                        $.fn.showError(response['data']);
286
                    } else {
287
                        $.each(response['data'], function(fieldname, errors) {
2531 eleazar 288
                            $.fn.showFormErrorValidator('#interview #' + fieldname, errors);
1877 eleazar 289
                        });
290
                    }
291
                }
292
            }).fail(function(jqXHR, textStatus, errorThrown) {
293
                $.fn.showError(textStatus);
294
            }).always(function() {
295
                NProgress.done();
296
            });
297
            return false;
298
        },
299
        invalidHandler: function(form, validator) {}
300
    });
1709 eleazar 301
 
2015 eleazar 302
    $('body').on('click', 'button.btn-add', function(e) {
2812 eleazar 303
        var url = $(this).data('url');
2015 eleazar 304
        e.preventDefault();
305
        NProgress.start();
306
        $.ajax({
307
            'dataType': 'json',
308
            'accept': 'application/json',
309
            'method': 'get',
2812 eleazar 310
            'url': url,
2015 eleazar 311
        }).done(function(response) {
312
            if (response['success']) {
2237 eleazar 313
                var data = response.data
2785 eleazar 314
                $("#interview #comment").val('');
315
                $('#interview #status').val('');
316
                $('#interview #type').val('')
2960 eleazar 317
                $("#interview #points").val('$points_0');
2785 eleazar 318
 
2264 eleazar 319
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2313 eleazar 320
                $("#interview").show()
2812 eleazar 321
                $("#form-interview").attr('action', url)
1877 eleazar 322
            } else {
2015 eleazar 323
                $.fn.showError(response['data']);
1877 eleazar 324
            }
2015 eleazar 325
        }).fail(function(jqXHR, textStatus, errorThrown) {
326
            $.fn.showError(textStatus);
327
        }).always(function() {
328
            NProgress.done();
1877 eleazar 329
        });
2015 eleazar 330
    });
2785 eleazar 331
 
332
    $('body').on('click', 'button.btn-edit', function(e) {
2807 eleazar 333
        var url = $(this).data('url');
2785 eleazar 334
        e.preventDefault();
335
        NProgress.start();
336
        $.ajax({
337
            'dataType': 'json',
338
            'accept': 'application/json',
339
            'method': 'get',
2807 eleazar 340
            'url': url,
2785 eleazar 341
        }).done(function(response) {
342
            if (response['success']) {
343
                var data = response.data
2798 eleazar 344
                $("#interview #comment").val(data['interview']['comment']);
345
                $('#interview #status').val(data['interview']['status']);
346
                $('#interview #type').val(data['interview']['type']);
347
                $("#interview #points").val(data['interview']['points']);
2785 eleazar 348
                $("#competencies-job").html($("#competenciesTemplate").render(data))
2887 eleazar 349
                data.interview.content.forEach(obj => {
2896 eleazar 350
                    $('#textarea-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.comment);
351
                    $('#select-' + obj.competencyUuid + '-' + obj.behaviorUuid).val(obj.evaluation);
2887 eleazar 352
                })
2808 eleazar 353
                $("#form-interview").attr('action', url)
2785 eleazar 354
                $("#interview").show()
355
            } else {
356
                $.fn.showError(response['data']);
357
            }
358
        }).fail(function(jqXHR, textStatus, errorThrown) {
359
            $.fn.showError(textStatus);
360
        }).always(function() {
361
            NProgress.done();
362
        });
363
    });
2788 eleazar 364
 
365
    $('button.btn-delete').confirmation({
2887 eleazar 366
        rootSelector: 'button.btn-delete',
367
        title: 'LABEL_ARE_YOU_SURE',
368
        singleton: true,
369
        btnOkLabel: 'LABEL_YES',
370
        btnCancelLabel: 'LABEL_NO',
371
        onConfirm: function (value) {
372
            action = $(this).data('href');
373
            NProgress.start();
374
            $.ajax({
375
                'dataType': 'json',
376
                'accept': 'application/json',
377
                'method': 'post',
378
                'url': $(this).data('url'),
379
            }).done(function (response) {
380
                if (response['success']) {
381
                    $.fn.showSuccess(response['data']);
382
                    $('#vacancy_uuid').change();
383
                } else {
384
                    $.fn.showError(response['data']);
385
                }
386
            }).fail(function (jqXHR, textStatus, errorThrown) {
387
                $.fn.showError(textStatus);
388
            }).always(function () {
389
                NProgress.done();
2788 eleazar 390
            });
2887 eleazar 391
        },
392
    });
2015 eleazar 393
 
394
    $('body').on('click', 'button.btn-cancel', function(e) {
395
        e.preventDefault();
2521 eleazar 396
        $('#main').show();
2015 eleazar 397
        $('#row-form').hide();
398
        $('#div-listing').show();
399
    });
400
 
401
    $('#form-filter #vacancy_uuid').change(function(e) {
402
        e.preventDefault();
2577 eleazar 403
        $('#form-filter #candidate_uuid').empty();
2015 eleazar 404
    })
2118 eleazar 405
 
2577 eleazar 406
    $('#form-filter #candidate_uuid').change(function(e) {
2015 eleazar 407
        e.preventDefault();
408
    })
2525 eleazar 409
     /**
410
     * Clicked cancel new/edit Form
411
     */
412
    $('button.btn-edit-cancel').click(function(e) {
413
        e.preventDefault();
2526 eleazar 414
        $('#interview').hide();
2525 eleazar 415
    });
416
    /**
417
     * Clicked save and continue new Form
418
     */
419
    $('button.btn-form-save-continue').click(function(e) {
420
        e.preventDefault();
421
        $('#interview #form-continue').val('1')
2540 eleazar 422
        $('#form-interview').submit();
2525 eleazar 423
    });
424
    /**
425
     * Clicked save and close new/edit Form
426
     */
427
    $('button.btn-form-save-close').click(function(e) {
428
        e.preventDefault();
429
        $('#interview #form-continue').val('0')
2540 eleazar 430
        $('#form-interview').submit();
2525 eleazar 431
    });
2029 eleazar 432
 
433
    $('#vacancy_uuid').on('change', function () {
2042 eleazar 434
        $('#candidate_uuid').html('');
435
 
2029 eleazar 436
        $.ajax({
437
            'dataType': 'json',
438
            'accept': 'application/json',
439
            'method': 'get',
2031 eleazar 440
            'url': "$routeIndex" + "?vacancy_uuid=" + $('#vacancy_uuid').val(),
2038 eleazar 441
        }).done(function (response) {
442
            var data = response.data
443
 
2036 eleazar 444
            data.candidates.forEach(function (candidate) {
2761 eleazar 445
                var option = $('<option />')
446
                    .val(candidate.uuid)
2777 eleazar 447
                    .text(candidate.first_name)
448
                    .data('addUrl', candidate.add_url)
449
                    .data('editUrl', candidate.edit_url)
450
                    .data('deleteUrl', candidate.delete_url)
2879 eleazar 451
                    .data('reportUrl', candidate.report_url)
2041 eleazar 452
 
453
                $('#candidate_uuid').append(option);
2036 eleazar 454
            });
2052 eleazar 455
 
2785 eleazar 456
            $('#candidate_uuid').change();
457
 
2244 eleazar 458
            $('#job-description').html($('#job-description-template').render(response.data));
2029 eleazar 459
        })
460
    });
2032 eleazar 461
 
462
    $('#vacancy_uuid').change();
2785 eleazar 463
 
464
    $('#candidate_uuid').on('change', function () {
465
        const uuid = $('#candidate_uuid').val();
466
        const data = $('#candidate_uuid option[value="' + uuid + '"]').data()
467
 
468
        $('#add-button').data('url', data.addUrl)
469
        $("#edit-button").data('url', data.editUrl)
470
        $("#delete-button").data('url', data.deleteUrl)
2890 eleazar 471
        $("#report-button").attr('href', data.reportUrl)
2785 eleazar 472
        if (data.addUrl) {
473
            $('#add-button').show();
2879 eleazar 474
            $('#report-button').show();
2785 eleazar 475
            $('#edit-button').hide();
476
            $('#delete-button').hide();
477
        } else {
478
            $('#add-button').hide();
479
            $('#edit-button').show();
480
            $('#delete-button').show();
2879 eleazar 481
            $('#report-button').show();
2785 eleazar 482
        }
483
 
484
    });
1709 eleazar 485
});
486
JS;
487
$this->inlineScript()->captureEnd();
488
?>
489
 
490
 
491
<!-- Content Header (Page header) -->
2521 eleazar 492
<section class="main-header">
1709 eleazar 493
	<div class="container-fluid">
494
    	<div class="row mb-2">
495
        	<div class="col-sm-12">
496
            	<h1>LABEL_INTERVIEW</h1>
497
			</div>
498
		</div>
499
	</div><!-- /.container-fluid -->
500
</section>
501
 
3062 eleazar 502
<section class="content">
503
    <div class="container-fluid">
504
        <div class="row">
505
            <div class="col-12">
506
                <div class="card">
507
                    <div class="card-header">
3064 eleazar 508
 
3062 eleazar 509
                        <div class="row">
510
                            <div class="col-md-6 col-sm-12">
511
                                <div class="form-group">
3064 eleazar 512
                                <label for="vacancy_uuid">LABEL_VACANCY</label>
513
                                    <select id="vacancy_uuid" name="vacancy_uuid" class="form-control">
514
                                        <?php foreach($this->vacancies as $vacancy): ?>
515
                                            <option value="<?= $vacancy->uuid ?>"><?= $vacancy->name ?></option>
516
                                        <?php endforeach; ?>
517
                                    </select>
3062 eleazar 518
                                </div>
519
                            </div>
520
 
521
                        </div>
522
                        <?php echo $this->form()->closeTag($form); ?>
523
                    </div>
524
                    <div class="card-body">
525
                        <table id="gridTable" class="table   table-hover">
526
                            <thead>
527
                            <tr>
528
                                <th>LABEL_FIRST_NAME</th>
529
                                <th>LABEL_LAST_NAME</th>
530
                                <th>LABEL_EMAIL</th>
531
                                <th>LABEL_ACTIONS</th>
532
                            </tr>
533
                            </thead>
534
                            <tbody>
535
                            </tbody>
536
                        </table>
537
                    </div>
538
                    <div class="card-footer clearfix">
3105 eleazar 539
                        <div style="float:right;">
540
                        <button id="add-button" type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
541
                        </div>
3062 eleazar 542
                    </div>
543
                </div>
544
            </div>
545
        </div>
546
    </div>
547
</section>
548
 
3107 eleazar 549
<section class="main">
1709 eleazar 550
	<div class="container-fluid">
551
    	<div class="row">
552
        	<div class="col-12">
2537 eleazar 553
 
554
				<div class="card">
555
					<div class="card-header">
556
                        <div class="row">
557
                            <div class="col-md-6 col-sm-12">
558
                                <div class="form-group">
559
                                    <label for="candidate_uuid">LABEL_CANDIDATES</label>
560
                                    <select id="candidate_uuid" name="candidate_uuid" class="form-control">
561
                                    </select>
562
                                </div>
1709 eleazar 563
                            </div>
2537 eleazar 564
                            <div
565
                                class="col-md-12 col-sm-12"
566
                            >
567
                            </div>
1709 eleazar 568
                        </div>
2537 eleazar 569
					</div>
570
					<div class="card-body">
571
                        <div id="job-description"></div>
572
                   	</div>
573
                 </div>
1876 eleazar 574
            </div>
2015 eleazar 575
        </div>
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
 
2314 eleazar 590
<section id="interview" style="display: none;">
2215 eleazar 591
	<div class="container-fluid">
592
    	<div class="row">
593
        	<div class="col-12">
2537 eleazar 594
                <form action="#" name="form-interview" id="form-interview">
595
                    <input type="hidden" name="form-continue" id="form-continue" value="0" />
2689 eleazar 596
			    	<div class="card">
597
                    <?php
598
                         $form->setAttributes([
599
                             'method' => 'post',
600
                             'name' => 'form-add',
601
                             'id' => 'form-add'
602
                         ]);
603
                         $form->prepare();
604
                         echo $this->form()->openTag($form);
605
                         ?>
2537 eleazar 606
			    		<div class="card-header">
607
                            <label>interview</label>
608
			    		</div>
609
			    		<div class="card-body">
610
                            <div id="competencies-job"></div>
2683 eleazar 611
                                <div class="form-group">
612
                                    <?php
613
                                    $element = $form->get('comment');
614
                                    $element->setOptions(['label' => 'LABEL_COMMENT']);
615
                                    $element->setAttributes(['class' => 'form-control']);
616
                                    echo $this->formLabel($element);
617
                                    echo $this->formText($element);
618
                                    ?>
619
                                </div>
620
                                <div class="form-group">
621
                                    <?php
622
                                    $element = $form->get('points');
623
                                    $element->setAttributes(['class' => 'form-control']);
624
                                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
625
                                    echo $this->formLabel($element);
626
                                    echo $this->formSelect($element);
627
                                    ?>
628
                                </div>
2744 eleazar 629
                                <div class="form-group">
630
                                    <?php
631
                                    $element = $form->get('status');
632
                                    $element->setAttributes(['class' => 'form-control']);
633
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
634
                                    echo $this->formLabel($element);
635
                                    echo $this->formSelect($element);
636
                                    ?>
637
                                </div>
638
                                <div class="form-group">
639
                                    <?php
2747 eleazar 640
                                    $element = $form->get('type');
2744 eleazar 641
                                    $element->setAttributes(['class' => 'form-control']);
642
                                    $element->setOptions(['label' => 'LABEL_INTERVIEWED_BY']);
643
                                    echo $this->formLabel($element);
644
                                    echo $this->formSelect($element);
645
                                    ?>
646
                                </div>
2537 eleazar 647
                            </div>
648
                       	</div>
649
                        <div class="card-footer clearfix">
650
                        <button type="submit" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
651
                        <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
652
                        <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
2515 eleazar 653
                        </div>
2280 eleazar 654
                    </div>
2537 eleazar 655
                </form>
2215 eleazar 656
            </div>
657
        </div>
658
 	</div>
659
</section>
660
 
2264 eleazar 661
<script id="competenciesTemplate" type="text/x-jsrender">
2508 eleazar 662
<table class="table table-bordered" id="panel-{{:slug_section}}>
2293 eleazar 663
    <thead>
664
        <tr>
2306 eleazar 665
           <th style="width: 50%;">LABEL_ELEMENT</th>
2293 eleazar 666
           <th style="width: 50%;">LABEL_TITLE</th>
667
        </tr>
668
    </thead>
2300 eleazar 669
    <tbody>
670
        {{for job_description.competencies}}
671
            <tr>
672
               <td class="text-left">LABEL_COMPETENCY</td>
2302 eleazar 673
               <td class="text-left">{{:competency_name}}</td>
2300 eleazar 674
            </tr>
2302 eleazar 675
 
676
            {{for behaviors}}
2308 eleazar 677
                <tr>
2302 eleazar 678
                   <td class="text-left">--LABEL_CONDUCT</td>
679
                   <td class="text-left">
2303 eleazar 680
                      {{:description}}
2849 eleazar 681
                   </td>
2507 eleazar 682
                </tr>
683
                <tr>
2897 eleazar 684
                    <td colspan="2" data-competency-behavior data-competency-uuid="{{:competency_uuid}}" data-behavior-uuid="{{:uuid}}">
2895 eleazar 685
                        <label for="textarea-{{:competency_uuid}}-{{:uuid}}">LABEL_COMMENT</label>
2519 eleazar 686
 
687
                        <textarea
2851 eleazar 688
                            id="textarea-{{:competency_uuid}}-{{:uuid}}"
2519 eleazar 689
                            class="form-control"
690
                        ></textarea>
691
 
2888 eleazar 692
                        <label for="select-{{:competency_uuid}}-{{:uuid}}">LABEL_EVALUATION</label>
2519 eleazar 693
 
2889 eleazar 694
                        <select class="form-control" id="select-{{:competency_uuid}}-{{:uuid}}">
2519 eleazar 695
                            <option value="<?= $points_0 ?>"><?= $points_0 ?></option>
696
                            <option value="<?= $points_1 ?>"><?= $points_1 ?></option>
697
                            <option value="<?= $points_2 ?>"><?= $points_2 ?></option>
698
                            <option value="<?= $points_3 ?>"><?= $points_3 ?></option>
699
                            <option value="<?= $points_4 ?>"><?= $points_4 ?></option>
700
                        </select>
701
                    </td>
2506 eleazar 702
                </tr>
703
            {{/for}}
704
 
2300 eleazar 705
        {{/for}}
706
    </tbody>
2293 eleazar 707
</table>
2241 eleazar 708
</script>