Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1165 | Rev 1167 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1165 Rev 1166
Línea 48... Línea 48...
48
$status_active = JobDescription::STATUS_ACTIVE;
48
$status_active = JobDescription::STATUS_ACTIVE;
Línea 49... Línea 49...
49
 
49
 
50
$this->inlineScript()->captureStart();
50
$this->inlineScript()->captureStart();
Línea 51... Línea -...
51
echo <<<JS
-
 
52
 
-
 
-
 
51
echo <<<JS
-
 
52
 
-
 
53
let competencies = [];
-
 
54
let competencies_type = [];
-
 
55
let subordinates = [];
53
 
56
let competencies_selected = [];
54
 
57
let subordinates_selected = [];
55
jQuery(document).ready(function($) {
58
jQuery(document).ready(function($) {
56
    $.validator.setDefaults({
59
    $.validator.setDefaults({
57
        debug: true,
60
        debug: true,
Línea 299... Línea 302...
299
                CKEDITOR.instances.functions.setData('');
302
                CKEDITOR.instances.functions.setData('');
300
                CKEDITOR.instances.objectives.setData('');
303
                CKEDITOR.instances.objectives.setData('');
301
                $('#tableCompetencies tbody').empty();
304
                $('#tableCompetencies tbody').empty();
302
                var s = '';
305
                var s = '';
303
                var first = true;
306
                var first = true;
304
 
-
 
305
                competencies = response['data']['competencies'];
307
                competencies = response['data']['competencies'];
306
                competencies_type = response['data']['competency_types'];
308
                competencies_type = response['data']['competency_types'];
307
                setCompetencySelect();
309
                setCompetencySelect();
308
 
-
 
309
 
-
 
310
 
-
 
311
    
-
 
312
                $('#tableSubordinates tbody').empty();
310
                $('#tableSubordinates tbody').empty();
313
                $('#job_description_id_boss option:not(:first)').remove();
311
                $('#job_description_id_boss option:not(:first)').remove();
314
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
312
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
315
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
313
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
316
                    s = '<tr>' +
314
                    s = '<tr>' +
Línea 450... Línea 448...
450
        'width': '160px',
448
        'width': '160px',
451
        'height': '40px'
449
        'height': '40px'
452
    });
450
    });
453
    CKEDITOR.replace('functions');
451
    CKEDITOR.replace('functions');
454
    CKEDITOR.replace('objectives');
452
    CKEDITOR.replace('objectives');
455
 
-
 
456
 
-
 
457
    const setCompetencySelect = () =>{
453
    const setCompetencySelect = () => {
458
        $.each(competencies, function(i, item) {
454
        $.each(competencies, function(i, item) {
459
                if (filterItemById(item.competency_id).length <= 0) {
455
            if (filterItemById(item.competency_id).length <= 0) {
460
                     let type = filterTypeById(item.competency_type_id);
456
                let type = filterTypeById(item.competency_type_id);
461
                    $('#select-competency').append($('<option>', {
457
                $('#select-competency').append($('<option>', {
462
                        value: item.competency_id,
458
                    value: item.competency_id,
463
                        text: `${type.name} ${item.name}`
459
                    text: `${type.name} ${item.name}`
464
                    }));
460
                }));
465
                }
461
            }
466
            });
462
        });
467
    }
463
    }
468
 
-
 
469
    const filterItemById = (id) => [];
464
    const filterItemById = (id) => competencies_selected.filter((item) => item.competency_id == id ? item : false)[0];
470
 
-
 
471
 
-
 
472
 
-
 
473
    const filterTypeById = (id) => behaviors.filter((item) => item.competency_type_id == id ? item : false)[0];
465
    const filterTypeById = (id) => competencies_type.filter((item) => item.competency_type_id == id ? item : false)[0];
474
 
-
 
475
 
-
 
476
 
-
 
477
 
-
 
478
 
-
 
479
 
-
 
480
 
-
 
481
 
-
 
482
 
-
 
483
 
-
 
484
 
-
 
485
 
-
 
486
 
-
 
487
 
-
 
488
});
466
});
Línea 489... Línea -...
489
 
-
 
490
 
-
 
491
 
467
 
492
 
468
 
493
JS;
469
JS;
Línea 494... Línea 470...
494
$this->inlineScript()->captureEnd();
470
$this->inlineScript()->captureEnd();