Proyectos de Subversion LeadersLinked - Backend

Rev

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