Proyectos de Subversion LeadersLinked - Backend

Rev

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

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