Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1166 | Rev 1168 | 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
 
1167 geraldo 53
jQuery(document).ready(function($) {
54
 
55
    let competencies = [];
1166 geraldo 56
let competencies_type = [];
57
let subordinates = [];
58
let competencies_selected = [];
59
let subordinates_selected = [];
1167 geraldo 60
 
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;
1164 geraldo 309
                competencies = response['data']['competencies'];
310
                competencies_type = response['data']['competency_types'];
311
                setCompetencySelect();
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');
1166 geraldo 455
    const setCompetencySelect = () => {
1164 geraldo 456
        $.each(competencies, function(i, item) {
1166 geraldo 457
            if (filterItemById(item.competency_id).length <= 0) {
458
                let type = filterTypeById(item.competency_type_id);
459
                $('#select-competency').append($('<option>', {
460
                    value: item.competency_id,
461
                    text: `${type.name} ${item.name}`
462
                }));
463
            }
464
        });
1160 geraldo 465
    }
1166 geraldo 466
    const filterItemById = (id) => competencies_selected.filter((item) => item.competency_id == id ? item : false)[0];
467
    const filterTypeById = (id) => competencies_type.filter((item) => item.competency_type_id == id ? item : false)[0];
935 geraldo 468
});
1160 geraldo 469
 
470
 
66 efrain 471
JS;
472
$this->inlineScript()->captureEnd();
473
?>
474
 
475
<!-- Content Header (Page header) -->
476
<section class="content-header">
1101 geraldo 477
   <div class="container-fluid">
478
      <div class="row mb-2">
479
         <div class="col-sm-12">
480
            <h1>LABEL_JOBS_DESCRIPTION</h1>
481
         </div>
482
      </div>
483
   </div>
484
   <!-- /.container-fluid -->
66 efrain 485
</section>
486
<section class="content">
1101 geraldo 487
   <div class="container-fluid">
488
      <div class="row">
489
         <div class="col-12">
490
            <div class="card">
491
               <div class="card-body">
492
                  <table id="gridTable" class="table   table-hover">
493
                     <thead>
494
                        <tr>
495
                           <th>LABEL_NAME</th>
496
                           <th>LABEL_ACTIVE</th>
497
                           <th>LABEL_ACTIONS</th>
498
                        </tr>
499
                     </thead>
500
                     <tbody>
501
                     </tbody>
502
                  </table>
503
               </div>
504
               <div class="card-footer clearfix">
505
                  <div style="float:right;">
506
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
507
                     <?php if($allowAdd) : ?>
508
                     <?php if($allowImport) : ?>
509
                     <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
510
                     <?php endif; ?>
511
                     <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
512
                     <?php endif; ?>
513
                  </div>
514
               </div>
515
            </div>
516
         </div>
517
      </div>
518
   </div>
519
</section>
66 efrain 520
<!-- The Modal -->
521
<div class="modal" id="modal">
1101 geraldo 522
   <div class="modal-dialog  modal-xl">
523
      <div class="modal-content">
524
         <!-- Modal Header -->
525
         <div class="modal-header">
526
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
527
            <button type="button" class="close" data-dismiss="modal">&times;</button>
528
         </div>
529
         <!-- Modal body -->
530
         <div class="modal-body">
531
            <div class="card card-primary card-outline card-tabs">
532
               <div class="card-header p-0 pt-1 border-bottom-0">
533
                  <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
534
                     <li class="nav-item">
535
                        <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>
536
                     </li>
537
                     <li class="nav-item">
538
                        <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>
539
                     </li>
540
                     <li class="nav-item">
541
                        <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>
542
                     </li>
543
                  </ul>
544
               </div>
545
               <div class="card-body">
546
                  <?php
547
                     $form = $this->form;
548
                     $form->setAttributes([
549
                         'method'    => 'post',
550
                         'name'      => 'form',
551
                         'id'        => 'form'
552
                     ]);
73 steven 553
 
1101 geraldo 554
                     $form->prepare();
555
                     echo $this->form()->openTag($form);
556
                     ?>
557
                  <div class="tab-content" id="custom-tabs-three-tabContent">
558
                     <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
559
                        <div class="row">
560
                           <div class="col-md col-sm-12 col-12">
561
                              <div class="form-group m-0">
562
                                 <?php
563
                                    $element = $form->get('name');
564
                                    $element->setOptions(['label' => 'LABEL_NAME']);
66 efrain 565
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 566
 
66 efrain 567
                                    echo $this->formLabel($element);
1101 geraldo 568
                                    echo $this->formText($element);
66 efrain 569
                                    ?>
1101 geraldo 570
                              </div>
571
                           </div>
572
                           <div class="col-md col-sm-12 col-12">
573
                              <div class="form-group m-0">
574
                                 <?php
575
                                    $element = $form->get('job_description_id_boss');
576
                                    $element->setOptions(['label' => 'LABEL_BOSS']);
66 efrain 577
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 578
 
66 efrain 579
                                    echo $this->formLabel($element);
1101 geraldo 580
                                    echo $this->formSelect($element);
66 efrain 581
                                    ?>
1101 geraldo 582
                              </div>
583
                           </div>
584
                           <div
585
                              class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
586
                              >
587
                              <div class="form-group m-0">
588
                                 <label>LABEL_STATUS</label>
589
                                 <br />
590
                                 <?php
591
                                    $element = $form->get('status');
592
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
593
                                    // echo $this->formLabel($element);
594
                                    echo $this->formCheckbox($element);
595
                                    ?>
596
                              </div>
597
                           </div>
598
                        </div>
599
                        <div class="form-group">
600
                           <?php
601
                              $element = $form->get('objectives');
602
                              $element->setOptions(['label' => 'LABEL_OBJECTIVES']);
603
                              $element->setAttributes(['class' => 'form-control']);
604
 
605
                              echo $this->formLabel($element);
606
                              echo $this->formTextArea($element);
607
                              ?>
608
                        </div>
609
                        <div class="form-group">
610
                           <?php
611
                              $element = $form->get('functions');
612
                              $element->setOptions(['label' => 'LABEL_FUNCTIONS']);
613
                              $element->setAttributes(['class' => 'form-control']);
614
 
615
                              echo $this->formLabel($element);
616
                              echo $this->formTextArea($element);
617
                              ?>
618
                        </div>
619
                     </div>
1159 geraldo 620
                     <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
621
                     <div class="row">
1164 geraldo 622
<div class="col-md-8 col-sm-8 col-xs-12">
1158 geraldo 623
                              <select name="select-competency" id="select-competency" class="form-control">
624
                              </select>
625
                           </div>
626
                           <div class="col-md-4 col-sm-4 col-xs-12">
1160 geraldo 627
                              <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 628
                           </div>
1164 geraldo 629
 
1158 geraldo 630
                    </div>
631
                    <div class="row">
632
                    <div class="col-md-12 col-sm-12 col-xs-12">
633
 
634
                    </div>
635
 
636
                    </div>
1101 geraldo 637
                     </div>
638
                     <div class="tab-pane fade" id="custom-tabs-subordinates" role="tabpanel" aria-labelledby="custom-tabs-subordinates-tab">
639
                        <table class="table table-hover"  id="tableSubordinates">
640
                           <thead>
641
                              <tr>
642
                                 <th>LABEL_SUBORDINATE</th>
643
                              </tr>
644
                           </thead>
645
                           <tbody>
646
                           </tbody>
647
                        </table>
648
                     </div>
649
                  </div>
650
               </div>
651
               <?php echo $this->form()->closeTag($form); ?>
652
               <!-- /.card -->
653
            </div>
654
         </div>
655
         <!-- Modal footer -->
656
         <div class="modal-footer">
657
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
658
            <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
659
         </div>
660
      </div>
661
   </div>
662
</div>
66 efrain 663
 
664
 
665
 
666
 
667
 
668
 
669
 
670
 
671
 
672
 
673
 
674