Proyectos de Subversion LeadersLinked - Backend

Rev

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