Proyectos de Subversion LeadersLinked - Backend

Rev

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