Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1188 Rev 1189
Línea 316... Línea 316...
316
                competencies_type = response['data']['competency_types'];
316
                competencies_type = response['data']['competency_types'];
317
                dependents = response['data']['jobs_description'];
317
                dependents = response['data']['jobs_description'];
318
                renderData([]);
318
                renderData([]);
319
                setCompetencySelect();
319
                setCompetencySelect();
320
                setDependentSelect();
320
                setDependentSelect();
321
 
-
 
322
                var s = '';
-
 
323
                var first = true;
-
 
324
                $.each(response['data']['competency_types'], function(index, rowCompetencyType) {
-
 
325
                    first = true;
-
 
326
                    $.each(response['data']['competencies'], function(index, rowCompetency) {
-
 
327
                        if (rowCompetencyType['competency_type_id'] == rowCompetency['competency_type_id']) {
-
 
328
                            if (first) {
-
 
329
                                first = false;
-
 
330
                                s = '<tr>' +
-
 
331
                                    '<td><big><b>' + rowCompetencyType['name'] + '</b></big></td>' +
-
 
332
                                    '</tr>';
-
 
333
                                $('#tableCompetencies tbody').append(s)
-
 
334
                            }
-
 
335
                            s = '<tr>' +
-
 
336
                                '<td> ' +
-
 
337
                                '<div class="custom-control custom-checkbox">' +
-
 
338
                                '<input class="custom-control-input" type="checkbox"  name="competency_level' + rowCompetency['competency_id'] + '" id="competency_level' + rowCompetency['competency_id'] + '" value="1">' +
-
 
339
                                '<label for="competency_level' + rowCompetency['competency_id'] + '" class="custom-control-label">' + rowCompetency['name'] + '</label>' +
-
 
340
                                '</div>' +
-
 
341
                                '<td>';
-
 
342
                            $('#tableCompetencies tbody').append(s)
-
 
343
                        }
-
 
344
                    });
-
 
345
                });
-
 
346
                $('#tableSubordinates tbody').empty();
-
 
347
                $('#job_description_id_boss option:not(:first)').remove();
-
 
348
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
-
 
349
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
-
 
350
                    s = '<tr>' +
-
 
351
                        '<td>' +
-
 
352
                        '<div class="custom-control custom-checkbox">' +
-
 
353
                        '<input class="custom-control-input" type="checkbox" name="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" id="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" value="1">' +
-
 
354
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
-
 
355
                        '</div>' +
-
 
356
                        '</td>' +
-
 
357
                        '</tr>';
-
 
358
                    $('#tableSubordinates tbody').append(s)
-
 
359
                });
-
 
360
                validator.resetForm();
321
                validator.resetForm();
361
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
322
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
362
                $('#modal').modal('show');
323
                $('#modal').modal('show');
363
            } else {
324
            } else {
364
                $.fn.showError(response['data']);
325
                $.fn.showError(response['data']);
Línea 385... Línea 346...
385
                $('#form #name').val(response['data']['name']);
346
                $('#form #name').val(response['data']['name']);
386
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
347
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
387
                CKEDITOR.instances.functions.setData(response['data']['functions']);
348
                CKEDITOR.instances.functions.setData(response['data']['functions']);
388
                CKEDITOR.instances.objectives.setData(response['data']['objectives']);
349
                CKEDITOR.instances.objectives.setData(response['data']['objectives']);
389
                $('#tableCompetencies tbody').empty();
350
                $('#tableCompetencies tbody').empty();
390
                var s = '';
-
 
391
                var first = true;
-
 
392
                
-
 
393
                competencies = response['data']['competencies'];
351
                competencies = response['data']['competencies'];
394
                competencies_type = response['data']['competency_types'];
352
                competencies_type = response['data']['competency_types'];
395
                competencies_selected = response['data']['competencies_selected'];
353
                competencies_selected = response['data']['competencies_selected'];
396
                dependents = response['data']['jobs_description'];
354
                dependents = response['data']['jobs_description'];
397
                renderData(competencies_selected);
355
                renderData(competencies_selected);
398
                setCompetencySelect();
356
                setCompetencySelect();
399
                setDependentSelect();
357
                setDependentSelect();
400
 
-
 
401
                $('#tableSubordinates tbody').empty();
-
 
402
                $('#job_description_id_boss option:not(:first)').remove();
-
 
403
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
-
 
404
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
-
 
405
                    checked = '';
-
 
406
                    if ($.isArray(response['data']['dependent'])) {
-
 
407
                        if ($.inArray(rowJobDescription['job_description_id'], response['data']['dependent']) != -1) {
-
 
408
                            checked = ' checked="checked" ';
-
 
409
                        }
-
 
410
                    }
-
 
411
                    s = '<tr>' +
-
 
412
                        '<td>' +
-
 
413
                        '<div class="custom-control custom-checkbox">' +
-
 
414
                        '<input class="custom-control-input" type="checkbox" ' + checked + ' name="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" id="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" value="1">' +
-
 
415
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
-
 
416
                        '</div>' +
-
 
417
                        '</td>' +
-
 
418
                        '</tr>';
-
 
419
                    $('#tableSubordinates tbody').append(s)
-
 
420
                });
-
 
421
                $('#job_description_id_boss').val(response['data']['job_description_id_boss']);
358
                $('#job_description_id_boss').val(response['data']['job_description_id_boss']);
422
                validator.resetForm();
359
                validator.resetForm();
423
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
360
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
424
                $('#modal').modal('show');
361
                $('#modal').modal('show');
425
            } else {
362
            } else {