Proyectos de Subversion LeadersLinked - Backend

Rev

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

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