Proyectos de Subversion LeadersLinked - Backend

Rev

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