Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
1354 eleazar 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
$routeAdd = $this->url('recruitment-selection/forms/add');
8
$routeDatatable = $this->url('recruitment-selection/forms');
9
$routeDashboard = $this->url('dashboard');
10
 
11
$allowAdd = $acl->isAllowed($roleName, 'recruitment-selection/forms/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'recruitment-selection/forms/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'recruitment-selection/forms/delete') ? 1 : 0;
14
$allowReport = $acl->isAllowed($roleName, 'recruitment-selection/forms/report') ? 1 : 0;
15
 
16
 
16822 efrain 17
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
1354 eleazar 18
 
19
 
16822 efrain 20
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
21
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
1354 eleazar 22
 
23
 
16822 efrain 24
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
25
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
26
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
1354 eleazar 27
 
16822 efrain 28
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
29
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
1354 eleazar 30
 
16822 efrain 31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
34
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
1354 eleazar 35
 
36
 
16822 efrain 37
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.min.css'));
38
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
1354 eleazar 39
 
16822 efrain 40
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.full.min.js'));
1354 eleazar 41
 
16822 efrain 42
$this->inlineScript()->appendFile($this->basePath('assets/vendors/moment/moment-with-locales.min.js'));
43
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
44
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
1354 eleazar 45
 
46
 
16822 efrain 47
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
48
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
1354 eleazar 49
 
50
 
16822 efrain 51
 
52
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
53
 
1354 eleazar 54
// bootbox Alert //
55
 
16822 efrain 56
 
1354 eleazar 57
// JsRender //
16822 efrain 58
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
1354 eleazar 59
 
60
 
61
// Page Styles
62
$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
63
 
64
 
65
$status_active = \LeadersLinked\Model\RecruitmentForm::STATUS_ACTIVE;
66
$status_inactive = \LeadersLinked\Model\RecruitmentForm::STATUS_INACTIVE;
67
 
68
$this->inlineScript()->captureStart();
69
echo <<<JS
70
jQuery(document).ready(function($) {
71
    var allowEdit = $allowEdit;
72
    var allowDelete = $allowDelete;
73
    var allowReport = $allowReport;
74
    var sections = [];
75
    var competencies_type = [];
76
    /**
77
     * Get rows and set data table
78
     */
79
    var tableForm = $('#gridTable').dataTable({
80
        'processing': true,
81
        'serverSide': true,
82
        'searching': true,
83
        'order': [
84
            [0, 'asc']
85
        ],
86
        'ordering': true,
87
        'ordenable': true,
88
        'responsive': true,
89
        'select': false,
90
        'paging': true,
91
        'pagingType': 'simple_numbers',
92
        'ajax': {
93
            'url': '$routeDatatable',
94
            'type': 'get',
95
            'beforeSend': function(request) {
96
                NProgress.start();
97
            },
98
            'dataFilter': function(response) {
99
                var response = jQuery.parseJSON(response);
100
                var json = {};
101
                json.recordsTotal = 0;
102
                json.recordsFiltered = 0;
103
                json.data = [];
104
                if (response.success) {
105
                    json.recordsTotal = response.data.total;
106
                    json.recordsFiltered = response.data.total;
107
                    json.data = response.data.items;
108
                } else {
109
                    $.fn.showError(response.data)
110
                }
111
                return JSON.stringify(json);
112
            }
113
        },
114
        'language': {
115
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
116
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
117
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
118
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
119
            'sInfo': 'LABEL_DATATABLE_SINFO',
120
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
121
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
122
            'sInfoPostFix': '',
123
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
124
            'sUrl': '',
125
            'sInfoThousands': ',',
126
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
127
            'oPaginate': {
128
                'sFirst': 'LABEL_DATATABLE_SFIRST',
129
                'sLast': 'LABEL_DATATABLE_SLAST',
130
                'sNext': 'LABEL_DATATABLE_SNEXT',
131
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
132
            },
133
            'oAria': {
134
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
135
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
136
            },
137
        },
138
        'drawCallback': function(settings) {
139
            NProgress.done();
16822 efrain 140
 
1354 eleazar 141
        },
142
        'aoColumns': [{
143
                'mDataProp': 'name'
144
            },
145
            {
146
                'mDataProp': 'job_description'
147
            },
148
            {
149
                'mDataProp': 'status'
150
            },
151
            {
152
                'mDataProp': 'actions'
153
            },
154
        ],
155
        'columnDefs': [{
156
                'targets': 0,
157
                'className': 'text-vertical-middle',
158
            },
159
            {
160
                'targets': 1,
161
                'className': 'text-vertical-middle',
162
            },
163
            {
164
                'targets': -2,
165
                'orderable': false,
166
                'className': 'text-center',
167
                'render': function(data, type, row) {
16822 efrain 168
                    checked = data == 'a'  ? 'checked' : '';
169
                    return '<div class="form-check">' +
170
                        '<input type="checkbox" class="form-check-input" disabled="" checked="' + checked + '">' +
171
                        '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
1354 eleazar 172
                }
173
            },
174
            {
175
                'targets': -1,
176
                'orderable': false,
177
                'render': function(data, type, row) {
178
                    s = '';
179
                    if (allowEdit) {
180
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
181
                    }
182
                    if (allowDelete) {
183
                        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;';
184
                    }
185
                    if (allowReport) {
186
                        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;';
187
                    }
188
                    return s;
189
                }
190
            }
191
        ],
192
    });
193
    /**
194
     * Clicked on edit form
195
     */
196
    $('body').on('click', 'button.btn-edit-form', function(e) {
197
        e.preventDefault();
198
        renderCompetenciesData([]);
199
        form_id = $(this).data('id')
200
        var action = $(this).data('href');
201
        $.ajax({
202
            'dataType': 'json',
203
            'accept': 'application/json',
204
            'method': 'get',
205
            'url': action,
206
        }).done(function(response) {
207
            if (response['success']) {
208
                $("#rows").html('');
209
                sections = [];
210
                $('#form-main').attr('action', action);
211
                $('#form-main #form-name').val(response['data']['name']);
212
                $('#form-main #job_description_id').val(response['data']['job_description_id']).trigger('change');
213
                $('#form-main #form-status').val(response['data']['status']);
214
                CKEDITOR.instances['form-description'].setData(response['data']['description']);
215
 
216
                sections = response['data']['content'] || [];
217
                renderData(sections);
218
                $('#row-lists').hide();
219
                $('#row-form').show();
220
            } else {
221
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
222
            }
223
        }).fail(function(jqXHR, textStatus, errorThrown) {
224
            $.fn.showError(textStatus);
225
        });
226
    });
227
    /**
228
     * Clicked add new section
229
     */
230
    $('#btn-add-section').click(function(e) {
231
        $('#form-section #id-section').val('');
232
        $('#form-section #title-section').val('');
233
        $('#form-section #text-section').val('');
234
        $('#form-section #type-section').val($('#form-section #type-section option:first').val());
235
        $('#modal-section h4[class="modal-title"]').html('LABEL_ADD LABEL_SECTION');
236
        $('#modal-section').modal('show');
237
        return;
238
    });
239
    /**
240
     * Clicked edit section
241
     */
242
    /**
243
     * Clicked save section
244
     */
245
    $('#btn-save-section').click(function(e) {
246
        if ($('#title-section').val() == '') {
247
            $.fn.showError('ERROR_ENTER_TITLE');
248
            return;
249
        } else {
250
            $('#id-section').val() == "" ?
251
                addSection($('#title-section').val(), $('#text-section').val(), $('#type-section').val()) :
252
                editSection($('#id-section').val(), $('#title-section').val(), $('#text-section').val(), $('#type-section').val())
253
            $('#modal-section').modal('hide');
254
            return;
255
        }
256
    });
257
    /**
258
     * Clicked remove section
259
     */
260
    $('body').on('click', 'button.btn-delete-section', function(e) {
261
        var id_section = $(this).data('section');
16822 efrain 262
 
263
          swal.fire({
1354 eleazar 264
            title: "LABEL_DELETE LABEL_SECTION",
265
            message: "LABEL_QUESTION_DELETE",
16822 efrain 266
            icon: 'question',
267
            cancelButtonText: 'LABEL_NO',
268
            showCancelButton: true,
269
            confirmButtonText: 'LABEL_YES'
270
          }).then((result) => {
271
            if (result.isConfirmed) {
272
                removeSection(id_section);
1354 eleazar 273
            }
16822 efrain 274
          });
275
 
276
 
1354 eleazar 277
    });
278
    $('body').on('click', 'button.btn-edit-section', function(e) {
279
        var id = $(this).data('section');
280
        sections.map((item) => {
281
            if (item.id_section == id) {
282
                $('#form-section #id-section').val(item.id_section);
283
                $('#form-section #title-section').val(item.title);
284
                $('#form-section #text-section').val(item.text);
285
                $('#form-section #type-section').val(item.type);
286
                $('#modal-section').modal('show');
287
                return;
288
            }
289
        });
290
    });
291
    /**
292
     * Clicked remove option
293
     */
294
    $('body').on('click', 'button.btn-delete-option', function(e) {
295
        var id_section = $(this).data('section');
296
        var id_option = $(this).data('option');
16822 efrain 297
 
298
          swal.fire({
1354 eleazar 299
            title: "LABEL_DELETE LABEL_OPTION",
300
            message: "LABEL_QUESTION_DELETE",
16822 efrain 301
            icon: 'question',
302
            cancelButtonText: 'LABEL_NO',
303
            showCancelButton: true,
304
            confirmButtonText: 'LABEL_YES'
305
          }).then((result) => {
306
            if (result.isConfirmed) {
307
                removeOption(id_section, id_option);
1354 eleazar 308
                    return;
309
            }
16822 efrain 310
          });
311
 
312
 
313
 
1354 eleazar 314
    });
315
    /**
316
     * Clicked add new Option
317
     */
318
    $('body').on('click', 'button.btn-add-option', function(e) {
319
        var id = $(this).data('section');
320
        $('#section-option').val(id);
321
        $('#text-option').val('');
322
        $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_OPTION');
323
        $('#modal-option').modal('show');
324
        return;
325
    });
326
    /**
327
     * Clicked add new Option
328
     */
329
    $('#btn-save-option').click(function(e) {
330
        if ($('#text-option').val() == '') {
331
            $.fn.showError('ERROR_ENTER_TEXT');
332
            return;
333
        } else {
334
            $('#id-option').val() == "" ?
335
                addOption($('#section-option').val(), $('#text-option').val()) :
336
                editOption($('#section-option').val(), $('#id-option').val(), $('#text-option').val())
337
        }
338
        $('#modal-option').modal('hide');
339
        return;
340
    });
341
    /**
342
     * Clicked edit Option
343
     */
344
    $('body').on('click', 'button.btn-edit-option', function(e) {
345
        var id_section = $(this).data('section');
346
        var id_option = $(this).data('option');
347
        sections.map((item) => {
348
            if (item.id_section == id_section) {
349
                item.options.map((opt) => {
350
                    if (opt.id_option == id_option) {
351
                        $('#id-option').val(opt.id_option);
352
                        $('#section-option').val(opt.id_section);
353
                        $("#text-option").val(opt.title);
354
                        $('#modal-option h4[class="modal-title"]').html('LABEL_EDIT LABEL_OPTION');
355
                        $('#modal-option').modal('show');
356
                        return;
357
                    }
358
                });
359
            }
360
        });
361
    });
362
    /**
363
     * Clicked new Form
364
     */
365
    $('button.btn-add-form').click(function(e) {
366
        $("#rows").html('');
367
        sections = [];
368
        $('#form-main').attr('action', '$routeAdd');
369
        $('#form-main #form-name').val('');
370
        $('#form-main #job_description_id').val('').trigger('change');
371
        $('#form-main #form-status').val('$status_active');
372
        CKEDITOR.instances['form-description'].setData('');
373
        renderCompetenciesData([]);
374
        $('#row-lists').hide();
375
        $('#row-form').show();
376
        $('#form-main #form-name').focus();
377
        return;
378
    });
379
    /**
380
     * Clicked cancel new/edit Form
381
     */
382
    $('button.btn-edit-cancel').click(function(e) {
383
        $('#row-form').hide();
384
        $('#row-lists').show();
385
        return;
386
    });
387
    /**
388
     * Clicked save and continue new Form
389
     */
390
    $('button.btn-form-save-continue').click(function(e) {
391
        for (var instanceName in CKEDITOR.instances) {
392
            CKEDITOR.instances[instanceName].updateElement();
393
        }
394
        saveData(1);
395
    });
396
    /**
397
     * Clicked save and close new/edit Form
398
     */
399
    $('button.btn-form-save-close').click(function(e) {
400
        for (var instanceName in CKEDITOR.instances) {
401
            CKEDITOR.instances[instanceName].updateElement();
402
        }
403
        saveData(0);
404
    });
405
    /**
406
     * Save Form Data
407
     */
408
    const saveData = (action) => {
409
        if ($('#form-name').val() == '') {
410
            $.fn.showError('ERROR_ENTER_NAME');
411
        } else if ($('#form-description').val() == '') {
412
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
413
        } else if ($('#form-text').val() == '') {
414
            $.fn.showError('ERROR_ENTER_TEXT');
415
        } else if ($('#form-status').val() == '') {
416
            $.fn.showError('ERROR_SELECT_STATUS');
417
        } else if ($('#job_description_id').val() == '') {
418
            $.fn.showError('ERROR_SELECT_JOB_DESCRIPTION');
419
        } else if (sections.length == 0) {
420
            $.fn.showError('ERROR_NOT_SECTIONS');
421
        } else {
422
            $.ajax({
423
                'dataType': 'json',
424
                'method': 'post',
425
                'url': $('#form-main').attr('action'),
426
                'data': {
427
                    'name': $('#form-main #form-name').val(),
428
                    'job_description_id': $('#form-main #job_description_id').val(),
429
                    'status': $('#form-main #form-status').val(),
430
                    'description': $('#form-main #form-description').val(),
431
                    'content': JSON.stringify(sections)
432
                },
433
            }).done(function(response) {
434
                if (response['success']) {
435
                    $.fn.showSuccess(response['data']);
436
                    if (action == 1) {
437
                        $('#form-main').attr('action', response['action_edit']);
438
                    } else {
439
                        $('#row-form').hide();
440
                        $('#row-lists').show();
441
                        /*---------- Reset Form -------- */
442
                        $('#form-main')[0].reset();
443
                        /*--------Reset Sections ----------*/
444
                        sections = [];
445
                        tableForm.fnDraw();
446
                    }
447
                    return;
448
                } else {
449
                    $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
450
                    return;
451
                }
452
            });
453
        }
454
    }
455
    /**
456
     * Remove Html Tags
457
     */
458
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
459
    /**
460
     * Render Sections data
461
     */
462
    const renderData = (data) => {
463
        $("#rows").html($("#sectionTemplate").render(data));
464
    }
465
    /**
466
     * Add Section to array
467
     */
468
    const addSection = (title, text, type) => {
469
        sections.push({
470
            'id_section': new Date().getTime(),
471
            'title': title,
472
            'type': type,
473
            'text': text,
474
            'answer': '',
475
            'options': []
476
        });
477
        return renderData(sections);
478
    }
479
    /**
480
     * Edit item behavior
481
     */
482
    const editSection = (id, title, text, type) => {
483
        sections.map((item) => {
484
            if (item.id_section == id) {
485
                item.title = title;
486
                item.type = type;
487
                item.text = text;
488
            }
489
        });
490
        return renderData(sections);
491
    }
492
    /**
493
     * Remove behavior
494
     */
495
    const removeSection = (id) => {
496
        sections = sections.filter((item) => item.id_section != id);
497
        return renderData(sections);
498
    }
499
    /**
500
     * Add Option to array
501
     */
502
    const addOption = (id_section, title) => {
503
        sections.map((item) => {
504
            if (item.id_section == id_section) {
505
                item.options.push({
506
                    'id_section': id_section,
507
                    'id_option': new Date().getTime(),
508
                    'title': title,
509
                    'answer': ''
510
                });
511
            }
512
        });
513
        return renderData(sections);
514
    }
515
    /**
516
     * Edit item Option
517
     */
518
    const editOption = (id_section, id, title) => {
519
        sections.map((item) => {
520
            if (item.id_section == id_section) {
521
                item.options.map((opt) => {
522
                    if (opt.id_option == id) {
523
                        opt.title = title
524
                    }
525
                });
526
            }
527
        });
528
        return renderData(sections);
529
    }
530
    /**
531
     * Remove Option
532
     */
533
    const removeOption = (id_section, id) => {
534
        sections.map((item) => {
535
            if (item.id_section == id_section) {
536
                item.options = item.options.filter((opt) => opt.id_option != id) || []
537
            }
538
        });
539
        return renderData(sections);
540
    }
541
    /**
542
     * Clicked refresh button
543
     */
544
    $('button.btn-refresh').click(function(e) {
545
        tableForm.fnDraw();
546
        return;
547
    });
16822 efrain 548
 
549
 $('body').on('click', 'button.btn-delete', function(e) {
550
        e.preventDefault();
551
        var action = $(this).data('href');
552
 
553
 
554
          swal.fire({
555
            title: 'LABEL_ARE_YOU_SURE',
556
            icon: 'question',
557
            cancelButtonText: 'LABEL_NO',
558
            showCancelButton: true,
559
            confirmButtonText: 'LABEL_YES'
560
          }).then((result) => {
561
            if (result.isConfirmed) {
562
 
563
                    NProgress.start();
564
                    $.ajax({
565
                        'dataType'  : 'json',
566
                        'accept'    : 'application/json',
567
                        'method'    : 'post',
568
                        'url'       :  action,
569
                    }).done(function(response) {
570
                        if(response['success']) {
571
                            $.fn.showSuccess(response['data']);
572
                            gridTable.api().ajax.reload(null, false);
573
                        } else {
574
                            $.fn.showError(response['data']);
575
                        }
576
                    }).fail(function( jqXHR, textStatus, errorThrown) {
577
                        $.fn.showError(textStatus);
578
                    }).always(function() {
579
                        NProgress.done();
580
                    });
581
            }
582
       });
583
    });
584
 
1354 eleazar 585
    /**
586
     * Initialize select Jobdescription
587
     */
588
    $('#job_description_id').select2({
589
        theme: 'bootstrap4',
590
        width: '100%',
591
    });
592
    /**
593
     * On change selecte JobDescription
594
     */
595
    $('#job_description_id').on('change', function() {
596
        if ($("#job_description_id").val() != '') {
15443 efrain 597
            $.getJSON("/jobs-description/edit/" + $("#job_description_id").val(), function(response) {
1354 eleazar 598
                if (response['success']) {
599
                    competencies_type = response['data']['competency_types'];
600
                    renderCompetenciesData(response['data']['competencies_selected']);
601
                }
602
            });
603
        }
604
    });
605
    /**
606
     * Filter competencie type
607
     */
608
    const filterTypeById = (id) => competencies_type.filter((item) => item.competency_type_id == id ? item : false)[0];
609
    /**
610
     * Render Competencies data
611
     */
612
    const renderCompetenciesData = (data) => {
613
        if (data.length > 0) {
614
            $("#competencies-to-job").show();
615
            $("#rows-job-competencies").html($("#sectionCompetencies").render(data, {
616
                getType: filterTypeById
617
            }));
618
        } else {
619
            $("#competencies-to-job").hide();
620
            $("#rows-job-competencies").html('');
621
        }
622
    }
623
});
624
JS;
625
 
626
$this->inlineScript()->captureEnd();
627
?>
16891 efrain 628
<div class="container">
629
	<div class="card" id="">
630
	 	<div class="card-header">
631
	 		<h6 class="card-title">LABEL_PERFORMANCE_EVALUATION</h6>
632
	 	</div>
633
	 	<div class="card-body">
634
	 		<div class="row">
635
	 	         <div class="col-12 mt-3">
636
 
637
	 	            <table id="gridTable" class="table   table-bordered">
1354 eleazar 638
                  <thead>
639
                     <tr>
640
                        <th style="width:25%">LABEL_NAME</th>
641
                        <th style="width:20%">LABEL_JOB_DESCRIPTION</th>
642
                        <th style="width:10%">LABEL_ACTIVE</th>
643
                        <th style="width:25%">LABEL_ACTIONS</th>
644
                     </tr>
645
                  </thead>
646
                  <tbody></tbody>
647
               </table>
16891 efrain 648
 
649
	 	         </div>
650
	 	     </div>
651
	 	</div>
652
	 	<div class="card-footer text-right">
653
			 <div style="float:right;">
1354 eleazar 654
                  <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
655
                  <?php if ($allowAdd) : ?>
656
                  <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
657
                  <?php endif; ?>
658
               </div>
16891 efrain 659
	 	</div>
660
	</div>
1354 eleazar 661
</div>
16891 efrain 662
 
663
 
1354 eleazar 664
<!-- Create/Edit Form -->
665
<div class="row" id="row-form" style="display: none; padding: 16px;">
666
   <div class="col-xs-12 col-md-12">
667
      <form action="#" name="form-main" id="form-main">
668
         <div class="form-group">
669
            <label for="form-name">LABEL_FIRST_NAME</label>
670
            <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
671
         </div>
672
         <div class="form-group">
673
            <label for="job_description_id">LABEL_POSITION_EVALUATED</label>
674
            <select name="job_description_id" id="job_description_id" class="form-control">
675
               <option value="">LABEL_SELECT</option>
676
               <?php foreach ($jobsDescription as $rs): ?>
677
               <option value="<?php echo $rs->uuid;?>"><?php echo $rs->name;?></option>
678
               <?php endforeach; ?>
679
            </select>
680
         </div>
681
         <div class="form-group">
682
            <label for="form-description">LABEL_DESCRIPTION</label>
683
            <!--  ckeditor -->
684
            <textarea  name="form-description" id="form-description" rows="5" class="ckeditor form-control"></textarea>
685
         </div>
686
         <div class="form-group">
687
            <label for="form-status">LABEL_STATUS</label>
688
            <select name="form-status" id="form-status" class="form-control">
689
               <option value="<?php echo $status_inactive; ?>">LABEL_INACTIVE</option>
690
               <option value="<?php echo $status_active; ?>">LABEL_ACTIVE</option>
691
            </select>
692
         </div>
693
         <div class="row">
694
            <div class="col-xs-12 col-md-12 text-right">
695
               <button type="button" class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
696
            </div>
697
         </div>
698
         <br />
699
         <div class="row">
700
            <div class="col-xs-12 col-md-12">
701
               <div class="panel-group" id="rows"></div>
702
            </div>
703
         </div>
704
         <div class="form-group" id="competencies-to-job" style="display:none">
705
            <div class="row">
706
               <div class="col-xs-12 col-md-12">
707
                  <hr>
16845 efrain 708
                  <h6 style="font-size: 18px;font-weight: bold;">LABEL_COMPETENCIES_TO_JOB:</h6>
1354 eleazar 709
                  <br>
710
                  <div class="panel-group" id="rows-job-competencies"></div>
711
               </div>
712
            </div>
713
         </div>
714
         <div class="form-group">
715
            <button type="button" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
716
            <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
16822 efrain 717
            <button type="button" class="btn btn-light btn-edit-cancel">LABEL_CANCEL</button>
1354 eleazar 718
         </div>
719
      </form>
720
   </div>
721
</div>
722
<!-- Create/Edit Form-->
723
<!-- section Modal -->
724
<div  id="modal-section" class="modal" tabindex="-1" role="dialog">
725
   <div class="modal-dialog modal-lg" role="document">
726
      <form action="#" name="form-section" id="form-section">
727
         <input type="hidden" name="id-section" id="id-section" />
728
         <div class="modal-content">
729
            <div class="modal-header">
16845 efrain 730
               <h6 class="modal-title">LABEL_ADD LABEL_SECTION</h6>
16864 efrain 731
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1354 eleazar 732
            </div>
733
            <div class="modal-body">
734
               <div class="form-group">
735
                  <label for="title-section">LABEL_FIRST_NAME</label>
736
                  <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
737
               </div>
738
               <div class="form-group">
739
                  <label for="text-section">LABEL_TEXT</label>
740
                  <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
741
               </div>
742
               <div class="form-group">
743
                  <label for="type-section">LABEL_TYPE</label>
744
                  <select name="type-section" id="type-section" class="form-control">
745
                     <option value="simple">Simple</option>
746
                     <option value="multiple">Multiple</option>
747
                  </select>
748
               </div>
749
            </div>
16891 efrain 750
            <div class="modal-footer text-right">
1354 eleazar 751
               <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
16864 efrain 752
               <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close">LABEL_CLOSE</button>
1354 eleazar 753
            </div>
754
         </div>
755
      </form>
756
   </div>
757
</div>
758
<!-- End Modal section -->
759
<!-- Modal Options -->
760
<div  id="modal-option" class="modal" tabindex="-1" role="dialog">
761
   <div class="modal-dialog modal-lg" role="document">
762
      <form action="#" name="form-option" id="form-option">
763
         <input type="hidden" name="section-option" id="section-option" value="" />
764
         <input type="hidden" name="id-option" id="id-option" value="" />
765
         <div class="modal-content">
766
            <div class="modal-header">
16845 efrain 767
               <h6 class="modal-title">LABEL_OPTION</h6>
16864 efrain 768
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
1354 eleazar 769
            </div>
770
            <div class="modal-body">
771
               <div class="form-group">
772
                  <label for="text-option">LABEL_TEXT</label>
773
                  <!--  ckeditor -->
774
                  <textarea  name="text-option" id="text-option" rows="5" class="form-control"></textarea>
775
               </div>
776
            </div>
16891 efrain 777
            <div class="modal-footer text-right">
1354 eleazar 778
               <button type="button" class="btn btn-primary" id="btn-save-option">LABEL_SAVE</button>
16864 efrain 779
               <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close">LABEL_CLOSE</button>
1354 eleazar 780
            </div>
781
         </div>
782
      </form>
783
   </div>
784
</div>
785
 
786
   <!-- End Modal Options -->
787
   <!---Template Sections --->
788
   <script id="sectionTemplate" type="text/x-jsrender">
789
   <div class="panel panel-default" id="panel-{{:id_section}}">
790
   <div class="panel-heading">
16845 efrain 791
   <h6 class="panel-title" style="font-size: 18px;">
1354 eleazar 792
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
793
         <span class="section-name{{:id_section}}">
794
         {{:title}}
795
         </span>
796
         </a>
16845 efrain 797
      </h6>
1354 eleazar 798
   </div>
799
   <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
800
      <div class="panel-body">
801
         <div class="table-responsive">
802
            <table class="table table-bordered">
803
               <thead>
804
                  <tr>
805
                     <th style="width: 10%;">LABEL_ELEMENT</th>
806
                     <th style="width: 30%;">LABEL_TEXT</th>
807
                     <th style="width: 10%;">LABEL_TYPE</th>
808
                     <th style="width: 50%;">LABEL_ACTIONS</th>
809
                  </tr>
810
               </thead>
811
               <tbody>
812
                  <tr>
813
                     <td class="text-left">LABEL_SECTION</td>
814
                     <td class="text-left">{{:title}}</td>
815
                     <td>
816
                        {{if type == 'simple'}} Simple {{/if}}
817
                        {{if type == 'multiple'}} Multiple {{/if}}
818
                     </td>
819
                     <td>
820
                        <button  type="button" class="btn btn-default btn-edit-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
821
                        <button  type="button" class="btn btn-default btn-delete-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button>
822
                        {{if type == 'multiple'}}
823
                        <button type="button" class="btn btn-default btn-add-option" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_ADD  LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD  LABEL_OPTION </button>
824
                        {{/if}}
825
                     </td>
826
                  </tr>
827
                  {{for options}}
828
                  <tr >
829
                     <td class="text-left">--LABEL_OPTION</td>
830
                     <td class="text-left">
831
                        {{:title}}
832
                     </td>
833
                     <td></td>
834
                     <td>
835
                        <button type="button"  class="btn btn-default btn-edit-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>
836
                        <button type="button" class="btn btn-default btn-delete-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button>
837
                     </td>
838
                  </tr>
839
                  {{/for}}
840
               </tbody>
841
            </table>
842
         </div>
843
      </div>
844
   </div>
845
</div>
846
   </script>
847
   <!-- End Template Sections-->
848
 
849
  <!---Template Competencies --->
850
   <script id="sectionCompetencies" type="text/x-jsrender">
851
   <div class="panel panel-default" id="panel-{{:competency_id}}">
852
   <div class="panel-heading">
16845 efrain 853
      <h6 class="panel-title" style="font-size: 18px;">
1354 eleazar 854
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:competency_id}}" href="#collapse-{{:competency_id}}">
855
         <span class="competency-name{{:competency_id}}">
856
         {{:~getType(competency_type_id).name}} - {{:name}}
857
         </span>
858
         </a>
16845 efrain 859
      </h6>
1354 eleazar 860
   </div>
861
   <div id="collapse-{{:competency_id}}" class="panel-collapse in collapse show">
862
      <div class="panel-body">
863
         <div class="table-responsive">
864
            <table class="table table-bordered">
865
               <thead>
866
                  <tr>
15443 efrain 867
                     <th style="width: 80%;">LABEL_BEHAVIOR</th>
1354 eleazar 868
                     <th style="width: 20%;">LABEL_LEVEL</th>
869
                  </tr>
870
               </thead>
871
               <tbody>
872
                  {{for behaviors}}
873
                  <tr >
874
                     <td class="text-left">
875
                        {{:description}}
876
                     </td>
877
                     <td>
878
                        {{if level == '0'}} LABEL_NA {{/if}}
879
                        {{if level == '1' }} LABEL_LEVEL_ONE {{/if}}
880
                        {{if level == '2' }} LABEL_LEVEL_TWO {{/if}}
881
                        {{if level == '3' }} LABEL_LEVEL_THREE {{/if}}
882
                        {{if level == '4' }} LABEL_LEVEL_FOUR {{/if}}
883
                     </td>
884
 
885
 
886
                  </tr>
887
                  {{/for}}
888
               </tbody>
889
            </table>
890
         </div>
891
      </div>
892
   </div>
893
</div>
894
   </script>
895
    <!-- End Template Competencies-->
896
 
897
</section>