Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
66 efrain 1
<?php
2
use LeadersLinked\Model\JobDescription;
3
 
4
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
5
$currentUser    = $this->currentUserHelper();
6
 
7
$roleName = $currentUser->getUserTypeId();
8
 
9
 
10
$routeAdd       = $this->url('settings/jobs-description/add');
11
$routeDatatable = $this->url('settings/jobs-description');
846 geraldo 12
$routeImport    = $this->url('settings/jobs-description/import');
66 efrain 13
$routeDashboard = $this->url('dashboard');
14
 
15
$allowAdd               = $acl->isAllowed($roleName, 'settings/jobs-description/add') ? 1 : 0;
16
$allowEdit              = $acl->isAllowed($roleName, 'settings/jobs-description/edit') ? 1 : 0;
17
$allowDelete            = $acl->isAllowed($roleName, 'settings/jobs-description/delete') ? 1 : 0;
561 geraldo 18
$allowReport            = $acl->isAllowed($roleName, 'settings/jobs-description/report') ? 1 : 0;
846 geraldo 19
$allowImport            = $acl->isAllowed($roleName, 'settings/jobs-description/import') ? 1 : 0;
66 efrain 20
 
21
 
22
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
24
 
25
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
26
 
27
 
28
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
31
 
32
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
33
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
34
 
35
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
37
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
38
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
39
 
40
 
41
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
43
 
44
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
45
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
46
 
47
 
48
$status_active = JobDescription::STATUS_ACTIVE;
49
 
50
$this->inlineScript()->captureStart();
51
echo <<<JS
1161 geraldo 52
 
53
let competencies = [];
54
let competencies_type = [];
55
let subordinates = [];
56
 
1164 geraldo 57
let competencies_selected = [];
58
let subordinates_selected = [];
59
 
938 geraldo 60
jQuery(document).ready(function($) {
935 geraldo 61
    $.validator.setDefaults({
62
        debug: true,
63
        highlight: function(element) {
64
            $(element).addClass('is-invalid');
65
        },
66
        unhighlight: function(element) {
67
            $(element).removeClass('is-invalid');
68
        },
69
        errorElement: 'span',
70
        errorClass: 'error invalid-feedback',
71
        errorPlacement: function(error, element) {
72
            if (element.parent('.form-group').length) {
73
                error.insertAfter(element);
74
            } else if (element.parent('.toggle').length) {
75
                error.insertAfter(element.parent().parent());
76
            } else {
77
                error.insertAfter(element.parent());
78
            }
79
        }
80
    });
81
    $.fn.showFormErrorValidator = function(fieldname, errors) {
82
        var field = $(fieldname);
83
        if (field) {
84
            $(field).addClass('is-invalid');
85
            var error = $('<span id="' + fieldname + '-error" class="error invalid-feedback">' + errors + '</div>');
86
            if (field.parent('.form-group').length) {
87
                error.insertAfter(field);
88
            } else if (field.parent('.toggle').length) {
89
                error.insertAfter(field.parent().parent());
90
            } else {
91
                error.insertAfter(field.parent());
92
            }
93
        }
94
    };
95
    var allowEdit = $allowEdit;
96
    var allowDelete = $allowDelete;
97
    var allowReport = $allowReport;
98
    var gridTable = $('#gridTable').dataTable({
99
        'processing': true,
100
        'serverSide': true,
101
        'searching': true,
102
        'order': [
103
            [0, 'asc']
104
        ],
105
        'ordering': true,
106
        'ordenable': true,
107
        'responsive': true,
108
        'select': false,
109
        'paging': true,
110
        'pagingType': 'simple_numbers',
111
        'ajax': {
112
            'url': '$routeDatatable',
113
            'type': 'get',
114
            'beforeSend': function(request) {
115
                NProgress.start();
66 efrain 116
            },
935 geraldo 117
            'dataFilter': function(response) {
118
                var response = jQuery.parseJSON(response);
119
                var json = {};
120
                json.recordsTotal = 0;
121
                json.recordsFiltered = 0;
122
                json.data = [];
123
                if (response.success) {
124
                    json.recordsTotal = response.data.total;
125
                    json.recordsFiltered = response.data.total;
126
                    json.data = response.data.items;
66 efrain 127
                } else {
935 geraldo 128
                    $.fn.showError(response.data)
66 efrain 129
                }
935 geraldo 130
                return JSON.stringify(json);
66 efrain 131
            }
935 geraldo 132
        },
133
        'language': {
134
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
135
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
136
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
137
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
138
            'sInfo': 'LABEL_DATATABLE_SINFO',
139
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
140
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
141
            'sInfoPostFix': '',
142
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
143
            'sUrl': '',
144
            'sInfoThousands': ',',
145
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
146
            'oPaginate': {
147
                'sFirst': 'LABEL_DATATABLE_SFIRST',
148
                'sLast': 'LABEL_DATATABLE_SLAST',
149
                'sNext': 'LABEL_DATATABLE_SNEXT',
150
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
151
            },
152
            'oAria': {
153
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
154
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
155
            },
156
        },
157
        'drawCallback': function(settings) {
158
            NProgress.done();
159
            $('button.btn-delete').confirmation({
160
                rootSelector: 'button.btn-delete',
161
                title: 'LABEL_ARE_YOU_SURE',
162
                singleton: true,
163
                btnOkLabel: 'LABEL_YES',
164
                btnCancelLabel: 'LABEL_NO',
165
                onConfirm: function(value) {
166
                    action = $(this).data('href');
167
                    NProgress.start();
168
                    $.ajax({
169
                        'dataType': 'json',
170
                        'accept': 'application/json',
171
                        'method': 'post',
172
                        'url': action,
173
                    }).done(function(response) {
174
                        if (response['success']) {
175
                            $.fn.showSuccess(response['data']);
176
                            gridTable.api().ajax.reload(null, false);
177
                        } else {
178
                            $.fn.showError(response['data']);
179
                        }
180
                    }).fail(function(jqXHR, textStatus, errorThrown) {
181
                        $.fn.showError(textStatus);
182
                    }).always(function() {
183
                        NProgress.done();
184
                    });
66 efrain 185
                },
935 geraldo 186
            });
187
        },
188
        'aoColumns': [{
189
                'mDataProp': 'name'
190
            },
191
            {
192
                'mDataProp': 'status'
193
            },
194
            {
195
                'mDataProp': 'actions'
196
            },
197
        ],
198
        'columnDefs': [{
199
                'targets': 0,
200
                'className': 'text-vertical-middle',
201
            },
202
            {
203
                'targets': -2,
204
                'orderable': false,
205
                'className': 'text-center',
206
                'render': function(data, type, row) {
207
                    checked = data == 'a' ? ' checked="checked" ' : '';
208
                    return '<div class="checkbox checkbox-success">' +
209
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
210
                        '<label ></label></div>';
66 efrain 211
                }
212
            },
935 geraldo 213
            {
214
                'targets': -1,
215
                'orderable': false,
216
                'render': function(data, type, row) {
217
                    s = '';
218
                    if (allowEdit) {
219
                        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;';
66 efrain 220
                    }
935 geraldo 221
                    if (allowDelete) {
222
                        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;';
66 efrain 223
                    }
935 geraldo 224
                    if (allowReport) {
225
                        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;';
226
                    }
227
                    return s;
66 efrain 228
                }
935 geraldo 229
            }
230
        ],
231
    });
232
    var validator = $('#form').validate({
233
        debug: true,
234
        onclick: false,
235
        onkeyup: false,
236
        ignore: [],
237
        rules: {
238
            'name': {
239
                required: true,
240
                maxlength: 64,
241
            },
242
            'functions': {
243
                updateCkeditor: function() {
244
                    CKEDITOR.instances.functions.updateElement();
66 efrain 245
                },
935 geraldo 246
                required: true,
247
            },
248
            'objectives': {
249
                updateCkeditor: function() {
250
                    CKEDITOR.instances.objectives.updateElement();
66 efrain 251
                },
935 geraldo 252
                required: true,
66 efrain 253
            },
935 geraldo 254
            'status': {
255
                required: false,
66 efrain 256
            },
935 geraldo 257
        },
258
        submitHandler: function(form) {
66 efrain 259
            $.ajax({
935 geraldo 260
                'dataType': 'json',
261
                'accept': 'application/json',
262
                'method': 'post',
263
                'url': $('#form').attr('action'),
264
                'data': $('#form').serialize()
66 efrain 265
            }).done(function(response) {
935 geraldo 266
                NProgress.start();
267
                if (response['success']) {
268
                    $.fn.showSuccess(response['data']);
269
                    $('#modal').modal('hide');
270
                    gridTable.api().ajax.reload(null, false);
271
                } else {
272
                    validator.resetForm();
273
                    if (jQuery.type(response['data']) == 'string') {
274
                        $.fn.showError(response['data']);
275
                    } else {
276
                        $.each(response['data'], function(fieldname, errors) {
277
                            $.fn.showFormErrorValidator('#form #' + fieldname, errors);
66 efrain 278
                        });
935 geraldo 279
                    }
66 efrain 280
                }
935 geraldo 281
            }).fail(function(jqXHR, textStatus, errorThrown) {
66 efrain 282
                $.fn.showError(textStatus);
283
            }).always(function() {
284
                NProgress.done();
285
            });
935 geraldo 286
            return false;
287
        },
288
        invalidHandler: function(form, validator) {}
289
    });
290
    $('body').on('click', 'button.btn-add', function(e) {
291
        e.preventDefault();
292
        NProgress.start();
293
        $.ajax({
294
            'dataType': 'json',
295
            'accept': 'application/json',
296
            'method': 'get',
297
            'url': '$routeAdd',
298
        }).done(function(response) {
299
            if (response['success']) {
300
                $('span[id="form-title"]').html('LABEL_ADD');
301
                $('#form').attr('action', '$routeAdd');
302
                $('#form #name').val('');
303
                $('#form #status').bootstrapToggle('on');
304
                CKEDITOR.instances.functions.setData('');
305
                CKEDITOR.instances.objectives.setData('');
306
                $('#tableCompetencies tbody').empty();
307
                var s = '';
308
                var first = true;
1160 geraldo 309
 
1164 geraldo 310
                competencies = response['data']['competencies'];
311
                competencies_type = response['data']['competency_types'];
312
                setCompetencySelect();
1160 geraldo 313
 
314
 
315
 
1164 geraldo 316
 
935 geraldo 317
                $('#tableSubordinates tbody').empty();
318
                $('#job_description_id_boss option:not(:first)').remove();
319
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
320
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
321
                    s = '<tr>' +
322
                        '<td>' +
323
                        '<div class="custom-control custom-checkbox">' +
324
                        '<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">' +
325
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
326
                        '</div>' +
327
                        '</td>' +
328
                        '</tr>';
329
                    $('#tableSubordinates tbody').append(s)
330
                });
331
                validator.resetForm();
332
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
333
                $('#modal').modal('show');
334
            } else {
335
                $.fn.showError(response['data']);
336
            }
337
        }).fail(function(jqXHR, textStatus, errorThrown) {
338
            $.fn.showError(textStatus);
339
        }).always(function() {
340
            NProgress.done();
66 efrain 341
        });
935 geraldo 342
    });
343
    $('body').on('click', 'button.btn-edit', function(e) {
344
        e.preventDefault();
345
        NProgress.start();
346
        var action = $(this).data('href');
347
        $.ajax({
348
            'dataType': 'json',
349
            'accept': 'application/json',
350
            'method': 'get',
351
            'url': action,
352
        }).done(function(response) {
353
            if (response['success']) {
354
                $('span[id="form-title"]').html('LABEL_EDIT');
355
                $('#form').attr('action', action);
356
                $('#form #name').val(response['data']['name']);
357
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
358
                CKEDITOR.instances.functions.setData(response['data']['functions']);
359
                CKEDITOR.instances.objectives.setData(response['data']['objectives']);
360
                $('#tableCompetencies tbody').empty();
361
                var s = '';
362
                var first = true;
363
                $.each(response['data']['competency_types'], function(index, rowCompetencyType) {
364
                    first = true;
365
                    $.each(response['data']['competencies'], function(index, rowCompetency) {
366
                        if (rowCompetencyType['competency_type_id'] == rowCompetency['competency_type_id']) {
367
                            if (first) {
368
                                first = false;
369
                                s = '<tr>' +
370
                                    '<td><big><b>' + rowCompetencyType['name'] + '</b></big></td>' +
371
                                    '</tr>';
372
                                $('#tableCompetencies tbody').append(s)
66 efrain 373
                            }
936 geraldo 374
                            checked = '';
945 geraldo 375
                            if (rowCompetency['level'] && rowCompetency['level'] != 0) {
938 geraldo 376
                                checked = ' checked="checked" ';
377
                            }
935 geraldo 378
                            s = '<tr>' +
379
                                '<td> ' +
66 efrain 380
                                '<div class="custom-control custom-checkbox">' +
935 geraldo 381
                                '<input class="custom-control-input" type="checkbox" ' + checked + ' name="competency_level' + rowCompetency['competency_id'] + '" id="competency_level' + rowCompetency['competency_id'] + '" value="1">' +
382
                                '<label for="competency_level' + rowCompetency['competency_id'] + '" class="custom-control-label">' + rowCompetency['name'] + '</label>' +
66 efrain 383
                                '</div>' +
935 geraldo 384
                                '<td>';
385
                            $('#tableCompetencies tbody').append(s)
386
                        }
66 efrain 387
                    });
935 geraldo 388
                });
389
                $('#tableSubordinates tbody').empty();
390
                $('#job_description_id_boss option:not(:first)').remove();
391
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
392
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
393
                    checked = '';
394
                    if ($.isArray(response['data']['subordinates'])) {
395
                        if ($.inArray(rowJobDescription['job_description_id'], response['data']['subordinates']) != -1) {
396
                            checked = ' checked="checked" ';
397
                        }
398
                    }
399
                    s = '<tr>' +
400
                        '<td>' +
401
                        '<div class="custom-control custom-checkbox">' +
402
                        '<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">' +
403
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
404
                        '</div>' +
405
                        '</td>' +
406
                        '</tr>';
407
                    $('#tableSubordinates tbody').append(s)
408
                });
409
                $('#job_description_id_boss').val(response['data']['job_description_id_boss']);
410
                validator.resetForm();
411
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
412
                $('#modal').modal('show');
413
            } else {
414
                $.fn.showError(response['data']);
415
            }
416
        }).fail(function(jqXHR, textStatus, errorThrown) {
417
            $.fn.showError(textStatus);
418
        }).always(function() {
419
            NProgress.done();
66 efrain 420
        });
935 geraldo 421
    });
422
    $('body').on('click', 'button.btn-refresh', function(e) {
423
        e.preventDefault();
424
        gridTable.api().ajax.reload(null, false);
425
    });
426
    $('body').on('click', 'button.btn-cancel', function(e) {
427
        e.preventDefault();
428
        $('#modal').modal('hide');
429
        $('#div-listing').show();
430
    });
431
    $('body').on('click', 'button.btn-import', function(e) {
432
        e.preventDefault();
433
        NProgress.start();
434
        $.ajax({
435
            'dataType': 'json',
436
            'method': 'post',
437
            'url': '$routeImport',
438
        }).done(function(response) {
439
            if (response['success']) {
440
                $.fn.showSuccess(response['data']);
441
                gridTable.api().ajax.reload(null, false);
442
            } else {
443
                $.fn.showError(response['data']);
444
            }
445
        }).fail(function(jqXHR, textStatus, errorThrown) {
446
            $.fn.showError(textStatus);
447
        }).always(function() {
448
            NProgress.done();
66 efrain 449
        });
935 geraldo 450
        return false;
66 efrain 451
    });
935 geraldo 452
    $('#form #status').bootstrapToggle({
453
        'on': 'LABEL_ACTIVE',
454
        'off': 'LABEL_INACTIVE',
455
        'width': '160px',
456
        'height': '40px'
457
    });
458
    CKEDITOR.replace('functions');
459
    CKEDITOR.replace('objectives');
1160 geraldo 460
 
461
 
1164 geraldo 462
    const setCompetencySelect = () =>{
463
        $.each(competencies, function(i, item) {
1160 geraldo 464
                if (filterItemById(item.competency_id).length <= 0) {
1164 geraldo 465
                     let type = filterTypeById(item.competency_type_id);
1160 geraldo 466
                    $('#select-competency').append($('<option>', {
467
                        value: item.competency_id,
1164 geraldo 468
                        text: `${type.name} ${item.name}`
1160 geraldo 469
                    }));
470
                }
471
            });
472
    }
473
 
474
    const filterItemById = (id) => [];
475
 
476
 
477
 
1164 geraldo 478
    const filterTypeById = (id) => behaviors.filter((item) => item.competency_type_id == id ? item : false)[0];
1160 geraldo 479
 
480
 
481
 
482
 
483
 
484
 
485
 
486
 
487
 
488
 
489
 
1161 geraldo 490
 
491
 
492
 
935 geraldo 493
});
1160 geraldo 494
 
495
 
496
 
497
 
66 efrain 498
JS;
499
$this->inlineScript()->captureEnd();
500
?>
501
 
502
<!-- Content Header (Page header) -->
503
<section class="content-header">
1101 geraldo 504
   <div class="container-fluid">
505
      <div class="row mb-2">
506
         <div class="col-sm-12">
507
            <h1>LABEL_JOBS_DESCRIPTION</h1>
508
         </div>
509
      </div>
510
   </div>
511
   <!-- /.container-fluid -->
66 efrain 512
</section>
513
<section class="content">
1101 geraldo 514
   <div class="container-fluid">
515
      <div class="row">
516
         <div class="col-12">
517
            <div class="card">
518
               <div class="card-body">
519
                  <table id="gridTable" class="table   table-hover">
520
                     <thead>
521
                        <tr>
522
                           <th>LABEL_NAME</th>
523
                           <th>LABEL_ACTIVE</th>
524
                           <th>LABEL_ACTIONS</th>
525
                        </tr>
526
                     </thead>
527
                     <tbody>
528
                     </tbody>
529
                  </table>
530
               </div>
531
               <div class="card-footer clearfix">
532
                  <div style="float:right;">
533
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
534
                     <?php if($allowAdd) : ?>
535
                     <?php if($allowImport) : ?>
536
                     <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
537
                     <?php endif; ?>
538
                     <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
539
                     <?php endif; ?>
540
                  </div>
541
               </div>
542
            </div>
543
         </div>
544
      </div>
545
   </div>
546
</section>
66 efrain 547
<!-- The Modal -->
548
<div class="modal" id="modal">
1101 geraldo 549
   <div class="modal-dialog  modal-xl">
550
      <div class="modal-content">
551
         <!-- Modal Header -->
552
         <div class="modal-header">
553
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
554
            <button type="button" class="close" data-dismiss="modal">&times;</button>
555
         </div>
556
         <!-- Modal body -->
557
         <div class="modal-body">
558
            <div class="card card-primary card-outline card-tabs">
559
               <div class="card-header p-0 pt-1 border-bottom-0">
560
                  <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
561
                     <li class="nav-item">
562
                        <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>
563
                     </li>
564
                     <li class="nav-item">
565
                        <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>
566
                     </li>
567
                     <li class="nav-item">
568
                        <a class="nav-link" id="custom-tabs-subordinates-tab" data-toggle="pill" href="#custom-tabs-subordinates" role="tab" aria-controls="custom-tabs-subordinates" aria-selected="false">LABEL_SUBORDINATES</a>
569
                     </li>
570
                  </ul>
571
               </div>
572
               <div class="card-body">
573
                  <?php
574
                     $form = $this->form;
575
                     $form->setAttributes([
576
                         'method'    => 'post',
577
                         'name'      => 'form',
578
                         'id'        => 'form'
579
                     ]);
73 steven 580
 
1101 geraldo 581
                     $form->prepare();
582
                     echo $this->form()->openTag($form);
583
                     ?>
584
                  <div class="tab-content" id="custom-tabs-three-tabContent">
585
                     <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
586
                        <div class="row">
587
                           <div class="col-md col-sm-12 col-12">
588
                              <div class="form-group m-0">
589
                                 <?php
590
                                    $element = $form->get('name');
591
                                    $element->setOptions(['label' => 'LABEL_NAME']);
66 efrain 592
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 593
 
66 efrain 594
                                    echo $this->formLabel($element);
1101 geraldo 595
                                    echo $this->formText($element);
66 efrain 596
                                    ?>
1101 geraldo 597
                              </div>
598
                           </div>
599
                           <div class="col-md col-sm-12 col-12">
600
                              <div class="form-group m-0">
601
                                 <?php
602
                                    $element = $form->get('job_description_id_boss');
603
                                    $element->setOptions(['label' => 'LABEL_BOSS']);
66 efrain 604
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 605
 
66 efrain 606
                                    echo $this->formLabel($element);
1101 geraldo 607
                                    echo $this->formSelect($element);
66 efrain 608
                                    ?>
1101 geraldo 609
                              </div>
610
                           </div>
611
                           <div
612
                              class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
613
                              >
614
                              <div class="form-group m-0">
615
                                 <label>LABEL_STATUS</label>
616
                                 <br />
617
                                 <?php
618
                                    $element = $form->get('status');
619
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
620
                                    // echo $this->formLabel($element);
621
                                    echo $this->formCheckbox($element);
622
                                    ?>
623
                              </div>
624
                           </div>
625
                        </div>
626
                        <div class="form-group">
627
                           <?php
628
                              $element = $form->get('objectives');
629
                              $element->setOptions(['label' => 'LABEL_OBJECTIVES']);
630
                              $element->setAttributes(['class' => 'form-control']);
631
 
632
                              echo $this->formLabel($element);
633
                              echo $this->formTextArea($element);
634
                              ?>
635
                        </div>
636
                        <div class="form-group">
637
                           <?php
638
                              $element = $form->get('functions');
639
                              $element->setOptions(['label' => 'LABEL_FUNCTIONS']);
640
                              $element->setAttributes(['class' => 'form-control']);
641
 
642
                              echo $this->formLabel($element);
643
                              echo $this->formTextArea($element);
644
                              ?>
645
                        </div>
646
                     </div>
1159 geraldo 647
                     <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
648
                     <div class="row">
1164 geraldo 649
<div class="col-md-8 col-sm-8 col-xs-12">
1158 geraldo 650
                              <select name="select-competency" id="select-competency" class="form-control">
651
                              </select>
652
                           </div>
653
                           <div class="col-md-4 col-sm-4 col-xs-12">
1160 geraldo 654
                              <button type="button" class="btn btn-primary" id="btn-select-competency" data-toggle="tooltip" title="LABEL_ADD LABEL_COMPETENCY">LABEL_ADD LABEL_COMPETENCY</button>
1158 geraldo 655
                           </div>
1164 geraldo 656
 
1158 geraldo 657
                    </div>
658
                    <div class="row">
659
                    <div class="col-md-12 col-sm-12 col-xs-12">
660
 
661
                    </div>
662
 
663
                    </div>
1101 geraldo 664
                     </div>
665
                     <div class="tab-pane fade" id="custom-tabs-subordinates" role="tabpanel" aria-labelledby="custom-tabs-subordinates-tab">
666
                        <table class="table table-hover"  id="tableSubordinates">
667
                           <thead>
668
                              <tr>
669
                                 <th>LABEL_SUBORDINATE</th>
670
                              </tr>
671
                           </thead>
672
                           <tbody>
673
                           </tbody>
674
                        </table>
675
                     </div>
676
                  </div>
677
               </div>
678
               <?php echo $this->form()->closeTag($form); ?>
679
               <!-- /.card -->
680
            </div>
681
         </div>
682
         <!-- Modal footer -->
683
         <div class="modal-footer">
684
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
685
            <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
686
         </div>
687
      </div>
688
   </div>
689
</div>
66 efrain 690
 
691
 
692
 
693
 
694
 
695
 
696
 
697
 
698
 
699
 
700
 
701