Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16766 Rev 16770
Línea 43... Línea 43...
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
Línea 44... Línea 44...
44
 
44
 
45
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
45
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
Línea -... Línea 46...
-
 
46
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
-
 
47
 
-
 
48
 
-
 
49
 
-
 
50
$this->headLink()->appendStylesheet($this->basePath('css/jquery-sortable.css'));
-
 
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-sortable/jquery-sortable.js'));
46
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
52
 
47
 
53
 
48
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
54
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
Línea 49... Línea 55...
49
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
55
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
Línea 57... Línea 63...
57
 
63
 
58
// JsRender //
64
// JsRender //
Línea 59... Línea -...
59
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
-
 
60
 
-
 
61
 
-
 
62
// Page Styles
-
 
63
//$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
-
 
64
 
-
 
65
 
65
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
Línea 66... Línea 66...
66
 
66
 
67
 
67
 
Línea 68... Línea 68...
68
$status_active = JobDescription::STATUS_ACTIVE;
68
$status_active = JobDescription::STATUS_ACTIVE;
Línea -... Línea 69...
-
 
69
 
-
 
70
$this->inlineScript()->captureStart();
69
 
71
echo <<<JS
70
$this->inlineScript()->captureStart();
-
 
71
echo <<<JS
72
 
72
 
-
 
73
 
73
 
74
jQuery(document).ready(function($) {
74
jQuery(document).ready(function($) {
Línea 75... Línea 75...
75
 
75
 
76
    var competencies_selected = new Array(); 
76
 
77
    var subordinates_selected = new Array();
77
 
Línea 78... Línea 78...
78
    var behaviors = new Array();
78
    var competencies_selected = new Array(); 
79
    var subordinates = new Array(); 
79
    var behaviors = new Array();
80
    var competency_types = new Array(); 
-
 
81
    var competencies = new Array(); 
-
 
82
 
-
 
83
    var allowEdit = $allowEdit;
-
 
84
    var allowDelete = $allowDelete;
-
 
Línea 85... Línea 80...
85
    var allowReport = $allowReport;
80
    var competency_types = new Array(); 
86
 
81
    var competencies = new Array(); 
87
 
82
 
Línea 102... Línea 97...
102
        } else {
97
        } else {
103
            $('#renderCompetencies').html('');
98
            $('#renderCompetencies').html('');
104
        }
99
        }
105
    }
100
    }
Línea 106... Línea -...
106
 
-
 
107
    $.fn.renderSubordinates = function() {
-
 
108
  
-
 
109
 
-
 
110
        if(subordinates_selected.length > 0) {
-
 
111
            $('#renderSubordinates').html($('#subordinateTemplate').render(subordinates_selected, {
-
 
112
                getSubordinate: (uuid) => subordinates.filter((item) => item.uuid == uuid ? item : false)[0],
-
 
113
 
-
 
114
            }));
-
 
115
        } else {
-
 
116
            $('#renderSubordinates').html('');
-
 
117
        }
-
 
118
    }
-
 
119
 
101
 
120
    $.fn.comboCompetencies = function() {
102
    $.fn.comboCompetencies = function() {
121
        $('#select-competency').children().remove();
103
        $('#select-competency').children().remove();
122
        $.each(competency_types, function(i, competency_type) {
104
        $.each(competency_types, function(i, competency_type) {
123
            competencies_filtered = competencies.filter((item) => item.competency_type_uuid == competency_type.uuid ? item : false)
105
            competencies_filtered = competencies.filter((item) => item.competency_type_uuid == competency_type.uuid ? item : false)
Línea 135... Línea 117...
135
            });
117
            });
136
        });    
118
        });    
Línea 137... Línea 119...
137
 
119
 
Línea 138... Línea -...
138
    }
-
 
139
 
-
 
140
    $.fn.comboSubordinates = function() {
-
 
141
 
-
 
142
        
-
 
143
        $('#select-subordinate').children().remove();
-
 
144
        $.each(subordinates, function(i, subordinate) {
-
 
145
            var subordinate_selected = subordinates_selected.filter((item) => item.uuid == subordinate.uuid ? item : false)[0];    
-
 
146
            if(!subordinate_selected) {
-
 
147
 
-
 
148
                $('#select-subordinate').append($('<option>', {
-
 
149
                    value: subordinate.uuid,
-
 
150
                    text: subordinate.name
-
 
151
                }));
-
 
152
            }
-
 
Línea 153... Línea 120...
153
        });
120
    }
154
    }
121
 
155
 
122
 
Línea 188... Línea 155...
188
                error.insertAfter(field.parent());
155
                error.insertAfter(field.parent());
189
            }
156
            }
190
        }
157
        }
191
    };
158
    };
Línea 192... Línea -...
192
 
-
 
193
    var gridTable = $('#gridTable').dataTable({
-
 
194
        'processing': true,
-
 
195
        'serverSide': true,
-
 
196
        'searching': true,
-
 
197
        'order': [
-
 
198
            [0, 'asc']
-
 
199
        ],
-
 
200
        'ordering': true,
159
 
201
        'ordenable': true,
-
 
202
        'responsive': true,
-
 
203
        'select': false,
-
 
204
        'paging': true,
-
 
205
        'pagingType': 'simple_numbers',
-
 
206
        'ajax': {
-
 
207
            'url': '$routeDatatable',
-
 
208
            'type': 'get',
-
 
209
            'beforeSend': function(request) {
-
 
210
                NProgress.start();
-
 
211
            },
-
 
212
            'dataFilter': function(response) {
-
 
213
                var response = jQuery.parseJSON(response);
-
 
214
                var json = {};
-
 
215
                json.recordsTotal = 0;
-
 
216
                json.recordsFiltered = 0;
-
 
217
                json.data = [];
-
 
218
                if (response.success) {
-
 
219
                    json.recordsTotal = response.data.total;
-
 
220
                    json.recordsFiltered = response.data.total;
-
 
221
                    json.data = response.data.items;
-
 
222
                } else {
-
 
223
                    $.fn.showError(response.data)
-
 
224
                }
-
 
225
                return JSON.stringify(json);
-
 
226
            }
160
    $.groupSortable = null;
227
        },
-
 
228
        'language': {
-
 
229
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
-
 
230
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
-
 
231
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
-
 
232
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
-
 
233
            'sInfo': 'LABEL_DATATABLE_SINFO',
-
 
234
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
-
 
235
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
-
 
236
            'sInfoPostFix': '',
-
 
237
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
-
 
238
            'sUrl': '',
-
 
239
            'sInfoThousands': ',',
-
 
240
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
-
 
241
            'oPaginate': {
-
 
242
                'sFirst': 'LABEL_DATATABLE_SFIRST',
-
 
243
                'sLast': 'LABEL_DATATABLE_SLAST',
-
 
244
                'sNext': 'LABEL_DATATABLE_SNEXT',
-
 
245
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
-
 
246
            },
-
 
247
            'oAria': {
-
 
248
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
-
 
249
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
-
 
250
            },
161
 
251
        },
-
 
252
        'drawCallback': function(settings) {
-
 
253
            NProgress.done();
-
 
254
            $('button.btn-delete').confirmation({
-
 
255
                rootSelector: 'button.btn-delete',
-
 
256
                title: 'LABEL_ARE_YOU_SURE',
-
 
257
                singleton: true,
-
 
258
                btnOkLabel: 'LABEL_YES',
-
 
259
                btnCancelLabel: 'LABEL_NO',
162
 
260
                onConfirm: function(value) {
-
 
-
 
163
    $.fn.setGroupSortable = function(html) {
261
                    action = $(this).data('href');
164
 
262
                    NProgress.start();
-
 
263
                    $.ajax({
-
 
264
                        'dataType': 'json',
-
 
265
                        'accept': 'application/json',
-
 
266
                        'method': 'post',
-
 
267
                        'url': action,
-
 
268
                    }).done(function(response) {
-
 
269
                        if (response['success']) {
165
        $('#ol-jobs-descriptions').html(html);
270
                            $.fn.showSuccess(response['data']);
-
 
271
                            gridTable.api().ajax.reload(null, false);
-
 
272
                        } else {
-
 
273
                            $.fn.showError(response['data']);
-
 
274
                        }
-
 
275
                    }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
276
                        $.fn.showError(textStatus);
-
 
277
                    }).always(function() {
-
 
278
                        NProgress.done();
-
 
279
                    });
-
 
280
                },
-
 
281
            });
-
 
282
        },
-
 
283
        'aoColumns': [{
-
 
284
                'mDataProp': 'name'
-
 
285
            },
-
 
286
            {
-
 
287
                'mDataProp': 'status'
-
 
288
            },
-
 
289
            {
-
 
290
                'mDataProp': 'actions'
-
 
291
            },
166
        $.groupSortable =  $('#ol-jobs-descriptions').sortable({
292
        ],
-
 
293
        'columnDefs': [{
-
 
294
                'targets': 0,
-
 
295
                'className': 'text-vertical-middle',
-
 
296
            },
-
 
297
            {
-
 
298
                'targets': -2,
-
 
299
                'orderable': false,
-
 
300
                'className': 'text-center',
167
 
301
                'render': function(data, type, row) {
168
            onDragStart: function(\$item, container, _super) {
302
                    checked = data == 'a' ? ' checked="checked" ' : '';
-
 
303
                    return '<div class="checkbox checkbox-success">' +
-
 
304
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
169
                //\$item.find('ol.dropdown-menu').sortable('disable');
305
                        '<label ></label></div>';
-
 
306
                }
170
                _super(\$item, container);
307
            },
171
            },
-
 
172
            onDrop: function(\$item, container, _super) {
-
 
173
                var data = $.groupSortable.sortable('serialize').get();
-
 
174
                var jsonString = JSON.stringify(data, null, ' ');
308
            {
175
 
309
                'targets': -1,
176
                $.ajax({
310
                'orderable': false,
177
                    'dataType': 'json',
311
                'render': function(data, type, row) {
178
                    'accept': 'application/json',
312
                    s = '';
179
                    'method': 'post',
313
                    if (allowEdit && data['link_edit']) {
-
 
314
                        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;';
180
                    'url': '$routeDatatable',
315
                    }
181
                    'data': {
316
                    if (allowDelete && data['link_delete']) {
-
 
317
                        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;';
182
                        data: jsonString
-
 
183
                    }
-
 
184
                }).done(function(response) {
-
 
185
 
318
                    }
186
 
319
                    if (allowReport && data['link_report']) {
187
                    if (!response['success']) {
320
                        s = s + '<button class="btn btn-primary btn-pdf"  data-href="' + data['link_report'] + '"  data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-file-o"></i> LABEL_PDF </button>&nbsp;';
188
                        $.fn.showError(response['data']);
-
 
189
                    }
321
                    }
190
                }).fail(function(jqXHR, textStatus, errorThrown) {
322
                    return s;
191
                    $.fn.showError(textStatus);
-
 
192
                })
-
 
193
 
-
 
194
 
-
 
195
                //\$item.find('ol.dropdown-menu').sortable('enable');
-
 
196
                _super(\$item, container);
-
 
197
 
-
 
198
                //console.log($(\$item).data('id'));
323
                }
199
                // console.log(\$item);
324
            }
200
            }
-
 
201
        });
-
 
202
 
-
 
203
    },
-
 
204
 
-
 
205
    $.fn.recursiveTree = function(items) {
-
 
206
        var s  = '';     
-
 
207
 
-
 
208
        $.each(items, function(i, item) {
-
 
209
 
-
 
210
            s = s + $('#listJobDescriptionTemplate').render(item);
-
 
211
 
-
 
212
        });
-
 
213
 
-
 
214
 
325
        ],
215
        return s;
-
 
216
    };
-
 
217
 
-
 
218
    
-
 
219
 
-
 
220
    $.fn.refreshTree = function() {
-
 
221
        NProgress.start();
-
 
222
        $.ajax({
-
 
223
            'dataType': 'json',
-
 
224
            'accept': 'application/json',
-
 
225
            'method': 'get',
-
 
226
            'url': '$routeDatatable',
-
 
227
        }).done(function(response) {
-
 
228
            if (response['success']) {
-
 
229
 
-
 
230
                var s = ''; 
-
 
231
 
-
 
232
                $.each(response['data'], function(i, item) {
-
 
233
                    s = s +  $.fn.recursiveTree(item);
-
 
234
                });
-
 
235
 
-
 
236
                $.fn.setGroupSortable(s);
-
 
237
 
-
 
238
            } else {
-
 
239
                $.fn.showError(response['data']);
-
 
240
            }
-
 
241
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
242
            $.fn.showError(textStatus);
-
 
243
         }).always(function() {
-
 
244
            NProgress.done();
-
 
245
        });
-
 
246
 
-
 
247
    }
-
 
248
 
Línea 326... Línea 249...
326
    });
249
   
327
 
250
 
328
    var validator = $('#form').validate({
251
    var validator = $('#form').validate({
329
        debug: true,
252
        debug: true,
Línea 344... Línea 267...
344
                maxlength: 1024,
267
                maxlength: 1024,
345
            },
268
            },
346
            'status': {
269
            'status': {
347
                required: false,
270
                required: false,
348
            },
271
            },
349
            'job_description_id_boss': {
-
 
350
                required: false,
-
 
351
            }
-
 
352
        },
272
        },
353
        submitHandler: function(form) {
273
        submitHandler: function(form) {
Línea 354... Línea 274...
354
    
274
    
355
            var data = {
275
            var data = {
356
                name : $('#form #name').val(),
276
                name : $('#form #name').val(),
357
                functions : $('#form #functions').val(),
277
                functions : $('#form #functions').val(),
358
                objectives : $('#form #objectives').val(),
278
                objectives : $('#form #objectives').val(),
359
                status :  $('#form #status').val(),
-
 
360
                job_description_id_boss: $('#form #job_description_id_boss').val(),
-
 
361
                subordinates_selected : new Array(),
279
                status :  $('#form #status').val(),
362
                competencies_selected : new Array(),
280
                competencies_selected : new Array(),
Línea 363... Línea 281...
363
            };
281
            };
Línea 368... Línea 286...
368
                    data.competencies_selected.push({'competency_uuid' : c.uuid, 'behavior_uuid' : b.uuid, 'level' : b.level});
286
                    data.competencies_selected.push({'competency_uuid' : c.uuid, 'behavior_uuid' : b.uuid, 'level' : b.level});
369
                });
287
                });
370
            });
288
            });
Línea 371... Línea -...
371
 
-
 
372
 
-
 
373
            $.each(subordinates_selected, function(i, subordinate_selected) {
-
 
374
                data.subordinates_selected.push(subordinate_selected.uuid);
-
 
375
            });
289
 
376
 
290
 
377
            NProgress.start();
291
            NProgress.start();
378
            $.ajax({
292
            $.ajax({
379
                'dataType': 'json',
293
                'dataType': 'json',
Línea 384... Línea 298...
384
            }).done(function(response) {
298
            }).done(function(response) {
385
                if (response['success']) {
299
                if (response['success']) {
386
                    $.fn.showSuccess(response['data']);
300
                    $.fn.showSuccess(response['data']);
387
                    $('#row-lists').show();
301
                    $('#row-lists').show();
388
                    $('#row-form').hide();
302
                    $('#row-form').hide();
389
                    gridTable.api().ajax.reload(null, false);
303
                    $.fn.refreshTree();
390
                } else {
304
                } else {
391
                    validator.resetForm();
305
                    validator.resetForm();
392
                    if (jQuery.type(response['data']) == 'string') {
306
                    if (jQuery.type(response['data']) == 'string') {
393
                        $.fn.showError(response['data']);
307
                        $.fn.showError(response['data']);
394
                    } else {
308
                    } else {
Línea 405... Línea 319...
405
            return false;
319
            return false;
406
        },
320
        },
407
        invalidHandler: function(form, validator) {}
321
        invalidHandler: function(form, validator) {}
408
    });
322
    });
Línea -... Línea 323...
-
 
323
 
-
 
324
    $('body').on('click', 'button.btn-refresh', function(e) {
-
 
325
        e.preventDefault();
-
 
326
        $.fn.refreshTree();
-
 
327
    });
409
 
328
 
-
 
329
    $('body').on('click', 'button.btn-cancel', function(e) {
-
 
330
        e.preventDefault();
-
 
331
        $('#row-lists').show();
-
 
332
        $('#row-form').hide();
-
 
333
        $('#div-listing').show();
-
 
334
    });
-
 
335
 
-
 
336
    $('body').on('click', 'button.btn-import', function(e) {
-
 
337
        e.preventDefault();
-
 
338
        NProgress.start();
-
 
339
        $.ajax({
-
 
340
            'dataType': 'json',
-
 
341
            'method': 'post',
-
 
342
            'url': '$routeImport',
-
 
343
        }).done(function(response) {
-
 
344
            if (response['success']) {
-
 
345
                $.fn.showSuccess(response['data']);
-
 
346
                $.fn.refreshTree();
-
 
347
            } else {
-
 
348
                $.fn.showError(response['data']);
-
 
349
            }
-
 
350
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
351
            $.fn.showError(textStatus);
-
 
352
        }).always(function() {
-
 
353
            NProgress.done();
-
 
354
        });
-
 
355
        return false;
-
 
356
    });
-
 
357
 
410
    $('body').on('click', 'button.btn-add', function(e) {
358
    $('body').on('click', 'button.btn-add-job-description', function(e) {
-
 
359
        e.preventDefault();
-
 
360
 
411
        e.preventDefault();
361
        var link = $(this).data('link');
412
        NProgress.start();
362
        NProgress.start();
413
        $.ajax({
363
        $.ajax({
414
            'dataType': 'json',
364
            'dataType': 'json',
415
            'accept': 'application/json',
365
            'accept': 'application/json',
416
            'method': 'get',
366
            'method': 'get',
417
            'url': '$routeAdd',
367
            'action' : link,
Línea 418... Línea 368...
418
        }).done(function(response) {
368
        }).done(function(response) {
Línea 424... Línea 374...
424
                competency_types = response['data']['competency_types'];
374
                competency_types = response['data']['competency_types'];
425
                competencies = response['data']['competencies'];
375
                competencies = response['data']['competencies'];
Línea 426... Línea 376...
426
 
376
 
427
 
-
 
428
                competencies_selected = [];
-
 
429
                subordinates = [];
-
 
430
 
-
 
Línea 431... Línea -...
431
                $('#select-subordinate').children().remove();
-
 
432
                $('#job_description_id_boss').children().not(':first').remove();
-
 
433
 
-
 
434
                $.each(response['data']['jobs_description'], function(value, text) {
-
 
435
                    subordinates.push({uuid:  value, name: text});
-
 
436
 
-
 
437
                    $('#select-subordinate').append($('<option>', {
-
 
438
                        value: value,
-
 
439
                        text: text
-
 
440
                    }));
-
 
441
 
-
 
442
                    $('#job_description_id_boss').append($('<option>', {
-
 
443
                        value: value,
-
 
444
                        text: text
-
 
445
                    }));
-
 
446
                });
-
 
447
 
-
 
448
                $('#form #job_description_id_boss').val('').trigger('change');
-
 
449
 
-
 
450
 
-
 
451
                  
-
 
Línea 452... Línea 377...
452
                $.fn.renderSubordinates();
377
 
453
                $.fn.comboSubordinates();
378
                competencies_selected = [];
454
                
379
 
455
 
380
 
Línea 461... Línea 386...
461
 
386
 
462
                $.fn.renderCompetencies();
387
                $.fn.renderCompetencies();
Línea 463... Línea 388...
463
                $.fn.comboCompetencies();
388
                $.fn.comboCompetencies();
464
 
389
 
465
                $('span[id="form-title"]').html('LABEL_ADD');
390
                $('span[id="form-title"]').html('LABEL_ADD');
466
                $('#form').attr('action', '$routeAdd');
391
                $('#form').attr('action', link);
Línea 467... Línea 392...
467
                $('#form #name').val('');
392
                $('#form #name').val('');
468
                $('#form #status').bootstrapToggle('on');
393
                $('#form #status').bootstrapToggle('on');
Línea 483... Línea 408...
483
        }).fail(function(jqXHR, textStatus, errorThrown) {
408
        }).fail(function(jqXHR, textStatus, errorThrown) {
484
            $.fn.showError(textStatus);
409
            $.fn.showError(textStatus);
485
        }).always(function() {
410
        }).always(function() {
486
            NProgress.done();
411
            NProgress.done();
487
        });
412
        });
-
 
413
       
488
        return false
414
        return false
489
    });
415
    });
Línea 490... Línea 416...
490
 
416
 
491
    $('body').on('click', 'button.btn-edit', function(e) {
417
    $('body').on('click', 'i.btn-add-job-description', function(e) {
-
 
418
        e.preventDefault();
-
 
419
 
492
        e.preventDefault();
420
        var link = $(this).data('link');
493
        NProgress.start();
-
 
494
        var action = $(this).data('href');
421
        NProgress.start();
495
        $.ajax({
422
        $.ajax({
496
            'dataType': 'json',
423
            'dataType': 'json',
497
            'accept': 'application/json',
424
            'accept': 'application/json',
498
            'method': 'get',
425
            'method': 'get',
499
            'url': action,
426
            'action' : link,
-
 
427
        }).done(function(response) {
500
        }).done(function(response) {
428
 
501
            if (response['success']) {
-
 
502
                $('span[id="form-title"]').html('LABEL_EDIT');
-
 
503
                $('#form').attr('action', action);
-
 
504
                $('#form #name').val(response['data']['name']);
-
 
505
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
429
            if (response['success']) {
506
               
-
 
507
                $('#form #functions').val(response['data']['functions']);
-
 
Línea 508... Línea 430...
508
                $('#form #objectives').val(response['data']['objectives']);
430
 
509
 
431
 
510
                behaviors = response['data']['behaviors'];
-
 
511
                competency_types = response['data']['competency_types'];
-
 
512
 
432
                behaviors = response['data']['behaviors'];
Línea 513... Línea -...
513
 
-
 
514
                competencies = response['data']['competencies'];
-
 
515
 
-
 
516
                subordinates = [];
-
 
517
                $('#select-subordinate').children().remove();
-
 
518
                $('#job_description_id_boss').children().not(':first').remove();
-
 
519
 
-
 
Línea -... Línea 433...
-
 
433
                competency_types = response['data']['competency_types'];
Línea 520... Línea -...
520
                
-
 
521
                $.each(response['data']['jobs_description'], function(value, text) {
-
 
522
                    subordinates.push({uuid:  value, name: text});
-
 
523
 
-
 
Línea 524... Línea 434...
524
 
434
                competencies = response['data']['competencies'];
525
                    $('#select-subordinate').append($('<option>', {
435
 
526
                        value: value,
436
 
527
                        text: text
437
                competencies_selected = [];
528
                    }));
438
 
Línea 529... Línea -...
529
 
-
 
530
                    $('#job_description_id_boss').append($('<option>', {
-
 
531
                        value: value,
-
 
532
                        text: text
-
 
533
                    }));
-
 
534
                });
-
 
535
 
-
 
536
 
-
 
537
                $('#form #job_description_id_boss').val(response['data']['job_description_id_boss']).trigger('change');
-
 
538
 
439
 
539
 
440
                $.each(competencies, function(i, competency) {
540
                competencies_selected = response['data']['competencies_selected'];
-
 
541
                subordinates_selected = response['data']['subordinates_selected'];                
-
 
542
 
-
 
Línea -... Línea 441...
-
 
441
                    $.each(competency.behaviors, function(j, behavior) {
-
 
442
                        competencies[i].behaviors[j].level = 0;
-
 
443
                    });
-
 
444
                });
-
 
445
 
-
 
446
                $.fn.renderCompetencies();
-
 
447
                $.fn.comboCompetencies();
543
 
448
 
544
 
449
                $('span[id="form-title"]').html('LABEL_ADD');
-
 
450
                $('#form').attr('action', link);
-
 
451
                $('#form #name').val('');
545
                $.fn.renderCompetencies();
452
                $('#form #status').bootstrapToggle('on');
546
                $.fn.comboCompetencies();
453
                    
547
                      
454
                $('#form #functions').val('');
-
 
455
                $('#form #objectives').val('');
548
                $.fn.renderSubordinates();
456
 
549
                $.fn.comboSubordinates();
457
                validator.resetForm();
550
 
458
 
551
                
459
 
552
                validator.resetForm();
460
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
553
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
461
                $('#row-lists').hide();
554
                $('#row-lists').hide();
462
                $('#row-form').show();
555
                $('#row-form').show();
463
 
556
            } else {
464
           } else   {                      
557
                $.fn.showError(response['data']);
-
 
558
            }
465
                $.fn.showError(response['data']);
559
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
560
            $.fn.showError(textStatus);
466
            }
Línea 561... Línea -...
561
        }).always(function() {
-
 
562
            NProgress.done();
-
 
563
        });
-
 
564
    });
-
 
565
    $('body').on('click', 'button.btn-refresh', function(e) {
-
 
566
        e.preventDefault();
-
 
Línea -... Línea 467...
-
 
467
        }).fail(function(jqXHR, textStatus, errorThrown) {
567
        gridTable.api().ajax.reload(null, false);
468
            $.fn.showError(textStatus);
568
    });
469
        }).always(function() {
569
 
470
            NProgress.done();
-
 
471
        });
570
    $('body').on('click', 'button.btn-cancel', function(e) {
472
       
571
        e.preventDefault();
473
        return false
-
 
474
    });
572
        $('#row-lists').show();
475
 
573
        $('#row-form').hide();
476
 
574
        $('#div-listing').show();
477
 
575
    });
478
    $('body').on('click', 'i.btn-edit-job-description', function(e) {
-
 
479
        e.preventDefault();
-
 
480
        NProgress.start();
576
 
481
        var action = $(this).data('link');
-
 
482
        $.ajax({
-
 
483
            'dataType': 'json',
-
 
484
            'accept': 'application/json',
-
 
485
            'method': 'get',
-
 
486
            'url': action,
-
 
487
        }).done(function(response) {
-
 
488
            if (response['success']) {
-
 
489
                $('span[id="form-title"]').html('LABEL_EDIT');
-
 
490
                $('#form').attr('action', action);
-
 
491
                $('#form #name').val(response['data']['name']);
-
 
492
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
-
 
493
               
-
 
494
                $('#form #functions').val(response['data']['functions']);
-
 
495
                $('#form #objectives').val(response['data']['objectives']);
-
 
496
 
577
    $('body').on('click', 'button.btn-import', function(e) {
497
                behaviors = response['data']['behaviors'];
-
 
498
                competency_types = response['data']['competency_types'];
-
 
499
 
-
 
500
                competencies = response['data']['competencies'];
578
        e.preventDefault();
501
                competencies_selected = response['data']['competencies_selected'];
579
        NProgress.start();
502
               
580
        $.ajax({
503
                $.fn.renderCompetencies();
581
            'dataType': 'json',
504
                $.fn.comboCompetencies();
582
            'method': 'post',
505
                      
583
            'url': '$routeImport',
506
                              
584
        }).done(function(response) {
507
                validator.resetForm();
585
            if (response['success']) {
508
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
586
                $.fn.showSuccess(response['data']);
-
 
587
                gridTable.api().ajax.reload(null, false);
509
                $('#row-lists').hide();
Línea 588... Línea -...
588
            } else {
-
 
589
                $.fn.showError(response['data']);
510
                $('#row-form').show();
590
            }
511
            } else {
591
        }).fail(function(jqXHR, textStatus, errorThrown) {
512
                $.fn.showError(response['data']);
Línea -... Línea 513...
-
 
513
            }
Línea -... Línea 514...
-
 
514
        }).fail(function(jqXHR, textStatus, errorThrown) {
592
            $.fn.showError(textStatus);
515
            $.fn.showError(textStatus);
593
        }).always(function() {
516
        }).always(function() {
594
            NProgress.done();
517
            NProgress.done();
595
        });
518
        });
596
        return false;
519
    });
Línea 620... Línea 543...
620
            }
543
            }
621
        }).fail(function( jqXHR, textStatus, errorThrown) {
544
        }).fail(function( jqXHR, textStatus, errorThrown) {
622
            $.fn.showError(textStatus);
545
            $.fn.showError(textStatus);
623
        }).always(function() {
546
        }).always(function() {
624
            NProgress.done();
547
            NProgress.done();
625
        });
548
        });*/
626
 
-
 
627
 
-
 
628
 
-
 
629
    });
549
    });
Línea 630... Línea -...
630
 
-
 
631
 
-
 
632
 
550
 
633
    $('body').on('click', 'button[id="btn-select-competency"]', function(e) {
551
    $('body').on('click', 'button[id="btn-select-competency"]', function(e) {
Línea 634... Línea 552...
634
        var competency_uuid = $('#select-competency').val();
552
        var competency_uuid = $('#select-competency').val();
635
 
553
 
Línea 658... Línea 576...
658
                $.fn.comboCompetencies();
576
                $.fn.comboCompetencies();
659
            }
577
            }
660
        }
578
        }
661
    });
579
    });
Línea 662... Línea -...
662
 
-
 
663
 
580
 
664
    $('body').on('click', 'button[id="btn-select-subordinate"]', function(e) {
581
    $('body').on('click', 'i.btn-delete-job-description', function(e) {
665
        e.preventDefault();
-
 
666
 
582
        e.preventDefault();
667
        var uuid = $("#select-subordinate").val();    
-
 
668
 
583
        action = $(this).data('link');
669
        if (uuid == "") {
-
 
670
            $.fn.showError('ERROR_SELECT_DEPENDENT_IS_EMPTY');
584
        NProgress.start();
671
        } else {
-
 
672
            subordinate = subordinates.filter((item) => item.uuid == uuid ? item : false)[0];
585
        $.ajax({
673
            if(subordinate) {
-
 
674
                subordinates_selected.push({uuid: subordinate.uuid});
586
            'dataType': 'json',
675
                $.fn.renderSubordinates();
587
            'accept': 'application/json',
676
                $.fn.comboSubordinates();
588
            'method': 'post',
677
            }    
-
 
678
        }
-
 
679
    });
-
 
680
 
-
 
681
    $('body').on('click', 'button.btn-delete-subordinate', function(e) {
-
 
682
        var uuid = $(this).data('subordinate');
-
 
683
        bootbox.confirm({
-
 
684
            title: 'LABEL_DEPENDENT_DELETE_TITLE',
-
 
685
            message: 'LABEL_DEPENDENT_DELETE_MESSAGE',
589
            'url': action,
686
            buttons: {
590
        }).done(function(response) {
687
                cancel: {
591
            if (response['success']) {
688
                    label: '<i class="fa fa-times"></i> LABEL_CANCEL'
-
 
689
                },
592
                $.fn.showSuccess(response['data']);
690
                confirm: {
-
 
691
                    label: '<i class="fa fa-check"></i> LABEL_ACCEPT'
593
               $.fn.refreshTree();
692
                }
-
 
693
            },
-
 
694
            callback: function(result) {
-
 
695
                if (result) {
-
 
696
                    subordinates_selected = subordinates_selected.filter((item) => item.uuid != uuid ? item : false); 
-
 
697
 
594
            } else {
698
                    $.fn.renderSubordinates();
-
 
699
                    $.fn.comboSubordinates();
-
 
700
                }
595
                $.fn.showError(response['data']);
-
 
596
            }
-
 
597
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
598
            $.fn.showError(textStatus);
-
 
599
        }).always(function() {
701
            }
600
            NProgress.done();
702
        });
601
        });
Línea 703... Línea -...
703
    });
-
 
704
 
-
 
705
 
602
    });
706
 
603
 
Línea 707... Línea 604...
707
    $('body').on('click', 'button.btn-delete-competency', function(e) {
604
    $('body').on('click', 'button.btn-delete-job-description-competency', function(e) {
708
        e.preventDefault();
605
        e.preventDefault();
709
    
606
    
Línea 730... Línea 627...
730
                }
627
                }
731
            }
628
            }
732
        });
629
        });
733
    });
630
    });
Línea 734... Línea 631...
734
 
631
 
735
    $('body').on('click','button.btn-edit-behavior', function(e) {
632
    $('body').on('click','button.btn-edit-job-description-behavior', function(e) {
Línea 736... Línea 633...
736
        e.preventDefault();
633
        e.preventDefault();
737
 
634
 
Línea 775... Línea 672...
775
 
672
 
Línea 776... Línea 673...
776
        }
673
        }
Línea 777... Línea 674...
777
 
674
 
778
    });
675
    });
779
 
676
 
780
    $('body').on('click', 'button.btn-edit-cancel', function(e) {
677
    $('body').on('click', 'button.btn-edit-job-description-cancel', function(e) {
Línea 781... Línea 678...
781
        $('#row-lists').show();
678
        $('#row-lists').show();
Línea 797... Línea 694...
797
    $('#form #objectives').maxlength({
694
    $('#form #objectives').maxlength({
798
        alwaysShow: true,
695
        alwaysShow: true,
799
        validate: true
696
        validate: true
800
    });
697
    });
Línea 801... Línea -...
801
 
-
 
802
 
-
 
803
    $('#form #job_description_id_boss').select2({
-
 
804
        theme: 'bootstrap4',
-
 
805
        width: '100%',
-
 
806
    });
-
 
807
 
-
 
808
 
-
 
809
 
698
 
810
    $('#select-subordinate').select2({
699
    $('#select-competency').select2({
811
        theme: 'bootstrap4',
700
        theme: 'bootstrap4',
812
        width: '100%',
701
        width: '100%',
Línea 813... Línea -...
813
    });
-
 
814
 
-
 
815
 
702
    });
816
 
-
 
817
    $('#select-competency').select2({
-
 
Línea 818... Línea 703...
818
        theme: 'bootstrap4',
703
 
Línea 819... Línea 704...
819
        width: '100%',
704
 
820
    });
705
 
821
    
706
    $.fn.refreshTree();    
-
 
707
 
-
 
708
});
822
 
709
 
Línea 823... Línea 710...
823
});
710
JS;
824
 
711
$this->inlineScript()->captureEnd();
825
JS;
712
?>
Línea 840... Línea 727...
840
    </div>
727
    </div>
841
    <div class="container-fluid">
728
    <div class="container-fluid">
842
        <div class="row">
729
        <div class="row">
843
            <div class="col-12">
730
            <div class="col-12">
844
                <div class="card">
731
                <div class="card">
-
 
732
                	<div class="card-header">
-
 
733
                		<div style="float:right;">
-
 
734
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
-
 
735
                            <?php if ($allowAdd) : ?>
-
 
736
                                <?php if ($allowImport) : ?>
-
 
737
                                    <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
-
 
738
                                <?php endif; ?>
-
 
739
                                <button type="button" class="btn btn-primary btn-add-job-description" data-link="<?php echo $routeAdd ?>"><i class="fa fa-plus"></i> LABEL_ADD </button>
-
 
740
                            <?php endif; ?>
-
 
741
                        </div>
-
 
742
                	</div>
845
                    <div class="card-body">
743
                    <div class="card-body">
-
 
744
 
-
 
745
                        
846
                        <table id="gridTable" class="table table-hover">
746
                       <ol id="ol-jobs-descriptions" class="default vertical">
847
                            <thead>
-
 
848
                                <tr>
-
 
849
                                    <th style="width: 50%">LABEL_NAME</th>
-
 
850
                                    <th style="width: 15%">LABEL_ACTIVE</th>
-
 
851
                                    <th style="width: 35%">LABEL_ACTIONS</th>
-
 
852
                                </tr>
-
 
853
                            </thead>
-
 
854
                            <tbody>
-
 
855
                            </tbody>
-
 
-
 
747
 
856
                        </table>
748
            			</ol>
-
 
749
            
857
                    </div>
750
                    </div>
858
                    <div class="card-footer clearfix">
751
                    <div class="card-footer clearfix">
859
                        <div style="float:right;">
752
                		<div style="float:right;">
860
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
753
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
861
                            <?php if ($allowAdd) : ?>
754
                            <?php if ($allowAdd) : ?>
862
                                <?php if ($allowImport) : ?>
755
                                <?php if ($allowImport) : ?>
863
                                    <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
756
                                    <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
864
                                <?php endif; ?>
757
                                <?php endif; ?>
865
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
758
                                <button type="button" class="btn btn-primary btn-add-job-description" data-link="<?php echo $routeAdd ?>"><i class="fa fa-plus"></i> LABEL_ADD </button>
866
                            <?php endif; ?>
759
                            <?php endif; ?>
867
                        </div>
760
                        </div>
868
                    </div>
761
                    </div>
869
                </div>
762
                </div>
870
            </div>
763
            </div>
871
        </div>
764
        </div>
872
    </div>
765
    </div>
873
</section>
766
</section>
Línea 874... Línea 767...
874
 
767
 
875
<section id="row-form" style="display:none">
-
 
-
 
768
<section id="row-form" style="display:none">
876
    <div class="container">
769
 
877
        <!-- Modal Header -->
770
        <!-- Modal Header -->
878
        <div class="modal-header">
771
        <div class="modal-header">
879
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
772
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
880
        </div>
773
        </div>
Línea 887... Línea 780...
887
                            <a class="nav-link active" id="custom-tabs-general-tab" data-toggle="pill" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
780
                            <a class="nav-link active" id="custom-tabs-general-tab" data-toggle="pill" href="#custom-tabs-general" role="tab" aria-controls="custom-tabs-general" aria-selected="true">LABEL_GENERAL</a>
888
                        </li>
781
                        </li>
889
                        <li class="nav-item">
782
                        <li class="nav-item">
890
                            <a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="pill" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
783
                            <a class="nav-link" id="custom-tabs-compentencies-tab" data-toggle="pill" href="#custom-tabs-compentencies" role="tab" aria-controls="custom-tabs-compentencies" aria-selected="false">LABEL_COMPETENCIES</a>
891
                        </li>
784
                        </li>
892
                        <li class="nav-item">
-
 
893
                            <a class="nav-link" id="custom-tabs-subordinate-tab" data-toggle="pill" href="#custom-tabs-subordinate" role="tab" aria-controls="custom-tabs-subordinate" aria-selected="false">LABEL_SUBORDINATES</a>
-
 
894
                        </li>
-
 
895
                    </ul>
785
                    </ul>
896
                </div>
786
                </div>
897
                <div class="card-body">
787
                <div class="card-body">
898
                    <?php
788
                    <?php
899
                    $form = $this->form;
789
                    $form = $this->form;
Línea 905... Línea 795...
905
 
795
 
906
                    $form->prepare();
796
                    $form->prepare();
Línea 907... Línea -...
907
                    echo $this->form()->openTag($form);
-
 
908
 
-
 
909
 
-
 
910
                    $element = $form->get('subordinates');
797
                    echo $this->form()->openTag($form);
911
                    echo $this->formHidden($element);
798
 
Línea 912... Línea 799...
912
 
799
 
Línea 929... Línea 816...
929
                                        echo $this->formLabel($element);
816
                                        echo $this->formLabel($element);
930
                                        echo $this->formText($element);
817
                                        echo $this->formText($element);
931
                                        ?>
818
                                        ?>
932
                                    </div>
819
                                    </div>
933
                                </div>
820
                                </div>
934
                                <div class="col-md col-sm-12 col-12">
-
 
935
                                    <div class="form-group m-0">
-
 
936
                                        <?php
-
 
937
                                        $element = $form->get('job_description_id_boss');
-
 
938
                                        $element->setOptions(['label' => 'LABEL_BOSS']);
-
 
939
                                        $element->setAttributes(['class' => 'form-control']);
-
 
940
 
-
 
941
                                        echo $this->formLabel($element);
-
 
942
                                        echo $this->formSelect($element);
-
 
943
                                        ?>
-
 
944
                                    </div>
-
 
945
                                </div>
-
 
946
                                <div class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center">
821
                                <div class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center">
947
                                    <div class="form-group m-0">
822
                                    <div class="form-group m-0">
948
                                        <label>LABEL_STATUS</label>
823
                                        <label>LABEL_STATUS</label>
949
                                        <br />
824
                                        <br />
950
                                        <?php
825
                                        <?php
Línea 990... Línea 865...
990
                                <br>
865
                                <br>
991
                                <div class="col-md-12 col-sm-12 col-xs-12" id="renderCompetencies" style="margin-top: 10px;">
866
                                <div class="col-md-12 col-sm-12 col-xs-12" id="renderCompetencies" style="margin-top: 10px;">
992
                                </div>
867
                                </div>
993
                            </div>
868
                            </div>
994
                        </div>
869
                        </div>
995
                        <div class="tab-pane fade" id="custom-tabs-subordinate" role="tabpanel" aria-labelledby="custom-tabs-subordinate-tab">
-
 
996
                            <div class="row">
-
 
997
                                <div class="col-md-8 col-sm-8 col-xs-12">
-
 
998
                                    <select id="select-subordinate" class="form-control"></select>
-
 
999
                                </div>
-
 
1000
                                <div class="col-md-4 col-sm-4 col-xs-12">
-
 
1001
                                    <button type="button" class="btn btn-primary" id="btn-select-subordinate" data-toggle="tooltip" title="LABEL_ADD ">LABEL_ADD </button>
-
 
1002
                                </div>
-
 
1003
                            </div>
-
 
1004
                            <div class="row">
-
 
1005
                                <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top: 10px;">
-
 
1006
                                    <table class="table table-bordered">
-
 
1007
                                        <thead>
-
 
1008
                                            <tr>
-
 
1009
                                                <th style="width: 60%;">LABEL_NAME</th>
-
 
1010
                                                <th style="width: 20%;">LABEL_ACTIONS</th>
-
 
1011
                                            </tr>
-
 
1012
                                        </thead>
-
 
1013
                                        <tbody id="renderSubordinates"></tbody>
-
 
1014
                                    </table>
-
 
1015
                                </div>
-
 
1016
                            </div>
-
 
1017
                        </div>
-
 
1018
                    </div>
870
                    </div>
1019
                </div>
871
                </div>
1020
            </div>
872
            </div>
1021
            <?php echo $this->form()->closeTag($form); ?>
873
            <?php echo $this->form()->closeTag($form); ?>
1022
            <!-- /.card -->
874
            <!-- /.card -->
1023
        </div>
875
        </div>
1024
        <!-- Modal footer -->
876
        <!-- Modal footer -->
1025
        <div class="modal-footer">
877
        <div class="modal-footer">
1026
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
878
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
1027
            <button type="button" class="btn btn-danger btn-edit-cancel">Cerrar</button>
879
            <button type="button" class="btn btn-danger btn-edit-job-description-cancel">Cerrar</button>
1028
        </div>
880
        </div>
1029
</section>
881
</section>
Línea 1030... Línea 882...
1030
 
882
 
Línea 1087... Línea 939...
1087
                     <td class="text-left">LABEL_COMPETENCY</td>
939
                     <td class="text-left">LABEL_COMPETENCY</td>
1088
                     <td class="text-left">{{:name}}</td>
940
                     <td class="text-left">{{:name}}</td>
1089
                     <td>
941
                     <td>
1090
                     </td>
942
                     </td>
1091
                     <td>
943
                     <td>
1092
                        <button  type="button" class="btn btn-default btn-delete-competency" data-competency="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button> 
944
                        <button  type="button" class="btn btn-default btn-delete-job-description-competency" data-competency="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button> 
1093
                     </td>
945
                     </td>
1094
                  </tr>
946
                  </tr>
1095
                  {{for behaviors}}
947
                  {{for behaviors}}
1096
                  <tr >
948
                  <tr >
1097
                     <td class="text-left">--LABEL_BEHAVIOR</td>
949
                     <td class="text-left">--LABEL_BEHAVIOR</td>
Línea 1100... Línea 952...
1100
                     </td>
952
                     </td>
1101
                     <td class="text-right">
953
                     <td class="text-right">
1102
                        {{:level}} 
954
                        {{:level}} 
1103
                     </td>
955
                     </td>
1104
                     <td>
956
                     <td>
1105
                        <button type="button"  class="btn btn-default btn-edit-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button> 
957
                        <button type="button"  class="btn btn-default btn-edit-job-description-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button> 
1106
                     </td>
958
                     </td>
1107
                  </tr>
959
                  </tr>
1108
                  {{/for}}
960
                  {{/for}}
1109
               </tbody>
961
               </tbody>
1110
            </table>
962
            </table>
Línea 1142... Línea 994...
1142
                     <td class="text-left">LABEL_COMPETENCY</td>
994
                     <td class="text-left">LABEL_COMPETENCY</td>
1143
                     <td class="text-left">{{:name}}</td>
995
                     <td class="text-left">{{:name}}</td>
1144
                     <td>
996
                     <td>
1145
                     </td>
997
                     </td>
1146
                     <td>
998
                     <td>
1147
                        <button  type="button" class="btn btn-default btn-delete-competency" data-competency="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button> 
999
                        <button  type="button" class="btn btn-default btn-delete-job-description-competency" data-competency="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_COMPETENCY"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_COMPETENCY </button> 
1148
                     </td>
1000
                     </td>
1149
                  </tr>
1001
                  </tr>
1150
                  {{for behaviors}}
1002
                  {{for behaviors}}
1151
                  <tr >
1003
                  <tr >
1152
                     <td class="text-left">--LABEL_BEHAVIOR</td>
1004
                     <td class="text-left">--LABEL_BEHAVIOR</td>
Línea 1159... Línea 1011...
1159
                        {{if level == '2' }} LABEL_LEVEL_TWO {{/if}} 
1011
                        {{if level == '2' }} LABEL_LEVEL_TWO {{/if}} 
1160
                        {{if level == '3' }} LABEL_LEVEL_THREE {{/if}} 
1012
                        {{if level == '3' }} LABEL_LEVEL_THREE {{/if}} 
1161
                        {{if level == '4' }} LABEL_LEVEL_FOUR {{/if}} 
1013
                        {{if level == '4' }} LABEL_LEVEL_FOUR {{/if}} 
1162
                     </td>
1014
                     </td>
1163
                     <td>
1015
                     <td>
1164
                        <button type="button"  class="btn btn-default btn-edit-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button> 
1016
                        <button type="button"  class="btn btn-default btn-edit-job-description-behavior" data-behavior="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_LEVEL"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_LEVEL</button> 
1165
                     </td>
1017
                     </td>
1166
                  </tr>
1018
                  </tr>
1167
                  {{/for}}
1019
                  {{/for}}
1168
               </tbody>
1020
               </tbody>
1169
            </table>
1021
            </table>
Línea 1171... Línea 1023...
1171
      </div>
1023
      </div>
1172
   </div>
1024
   </div>
1173
</div>
1025
</div>
1174
</script>
1026
</script>
Línea -... Línea 1027...
-
 
1027
 
-
 
1028
<script id="listJobDescriptionTemplate" type="text/x-jsrender">
-
 
1029
	<li data-id="{{:uuid}}">
-
 
1030
        {{>name}}
-
 
1031
        <div class="float-right">
-
 
1032
            {{if link_add }}
-
 
1033
            <i class="fa fa-plus btn-add-job-description" data-link="{{:link_add}}"></i>&nbsp;
-
 
1034
            {{/if}}
-
 
1035
            {{if link_edit }}
-
 
1036
            <i class="fa fa-pencil btn-edit-job-description" data-link="{{:link_edit}}"></i>&nbsp;
-
 
1037
            {{/if}}
-
 
1038
            {{if link_delete }}
-
 
1039
            <i class="fa fa-trash btn-delete-job-description" data-link="{{:link_delete}}"></i>&nbsp;
-
 
1040
            {{/if}}
-
 
1041
            {{if link_report }}
-
 
1042
            <i class="fa fa-file-o btn-pdf-job-description" data-link="{{:link_report}}"></i>&nbsp;
-
 
1043
            {{/if}}
-
 
1044
        </div>
-
 
1045
        <ol>	
-
 
1046
	   {{for children tmpl="#listJobDescriptionTemplate"/}}
-
 
1047
	   </ol> 
-
 
1048
	</li>
Línea 1175... Línea -...
1175
 
-
 
1176
 
-
 
1177
<script id="subordinateTemplate" type="text/x-jsrender">
-
 
1178
    <tr>
-
 
1179
        <td class="text-left"> {{:~getSubordinate(uuid).name}}</td>
-
 
1180
        <td>
-
 
1181
            <button type="button" class="btn btn-default btn-delete-subordinate" data-subordinate="{{:uuid}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE</button>   
-
 
1182
        </td>
-
 
1183
    </tr>
-
 
1184
    </script>
-
 
1185
 
1049
</script>