Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1159 | Rev 1161 | 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;
1160 geraldo 301
 
302
                setCompetencySelect(response['data']['competencies']);
303
 
304
 
305
 
306
 
307
 
308
 
309
 
310
 
311
 
312
 
935 geraldo 313
                $('#tableSubordinates tbody').empty();
314
                $('#job_description_id_boss option:not(:first)').remove();
315
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
316
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
317
                    s = '<tr>' +
318
                        '<td>' +
319
                        '<div class="custom-control custom-checkbox">' +
320
                        '<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">' +
321
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
322
                        '</div>' +
323
                        '</td>' +
324
                        '</tr>';
325
                    $('#tableSubordinates tbody').append(s)
326
                });
327
                validator.resetForm();
328
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
329
                $('#modal').modal('show');
330
            } else {
331
                $.fn.showError(response['data']);
332
            }
333
        }).fail(function(jqXHR, textStatus, errorThrown) {
334
            $.fn.showError(textStatus);
335
        }).always(function() {
336
            NProgress.done();
66 efrain 337
        });
935 geraldo 338
    });
339
    $('body').on('click', 'button.btn-edit', function(e) {
340
        e.preventDefault();
341
        NProgress.start();
342
        var action = $(this).data('href');
343
        $.ajax({
344
            'dataType': 'json',
345
            'accept': 'application/json',
346
            'method': 'get',
347
            'url': action,
348
        }).done(function(response) {
349
            if (response['success']) {
350
                $('span[id="form-title"]').html('LABEL_EDIT');
351
                $('#form').attr('action', action);
352
                $('#form #name').val(response['data']['name']);
353
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
354
                CKEDITOR.instances.functions.setData(response['data']['functions']);
355
                CKEDITOR.instances.objectives.setData(response['data']['objectives']);
356
                $('#tableCompetencies tbody').empty();
357
                var s = '';
358
                var first = true;
359
                $.each(response['data']['competency_types'], function(index, rowCompetencyType) {
360
                    first = true;
361
                    $.each(response['data']['competencies'], function(index, rowCompetency) {
362
                        if (rowCompetencyType['competency_type_id'] == rowCompetency['competency_type_id']) {
363
                            if (first) {
364
                                first = false;
365
                                s = '<tr>' +
366
                                    '<td><big><b>' + rowCompetencyType['name'] + '</b></big></td>' +
367
                                    '</tr>';
368
                                $('#tableCompetencies tbody').append(s)
66 efrain 369
                            }
936 geraldo 370
                            checked = '';
945 geraldo 371
                            if (rowCompetency['level'] && rowCompetency['level'] != 0) {
938 geraldo 372
                                checked = ' checked="checked" ';
373
                            }
935 geraldo 374
                            s = '<tr>' +
375
                                '<td> ' +
66 efrain 376
                                '<div class="custom-control custom-checkbox">' +
935 geraldo 377
                                '<input class="custom-control-input" type="checkbox" ' + checked + ' name="competency_level' + rowCompetency['competency_id'] + '" id="competency_level' + rowCompetency['competency_id'] + '" value="1">' +
378
                                '<label for="competency_level' + rowCompetency['competency_id'] + '" class="custom-control-label">' + rowCompetency['name'] + '</label>' +
66 efrain 379
                                '</div>' +
935 geraldo 380
                                '<td>';
381
                            $('#tableCompetencies tbody').append(s)
382
                        }
66 efrain 383
                    });
935 geraldo 384
                });
385
                $('#tableSubordinates tbody').empty();
386
                $('#job_description_id_boss option:not(:first)').remove();
387
                $.each(response['data']['jobs_description'], function(index, rowJobDescription) {
388
                    $('#job_description_id_boss').append(new Option(rowJobDescription['name'], rowJobDescription['job_description_id']));
389
                    checked = '';
390
                    if ($.isArray(response['data']['subordinates'])) {
391
                        if ($.inArray(rowJobDescription['job_description_id'], response['data']['subordinates']) != -1) {
392
                            checked = ' checked="checked" ';
393
                        }
394
                    }
395
                    s = '<tr>' +
396
                        '<td>' +
397
                        '<div class="custom-control custom-checkbox">' +
398
                        '<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">' +
399
                        '<label for="job_description_id_subordinate' + rowJobDescription['job_description_id'] + '" class="custom-control-label">' + rowJobDescription['name'] + '</label>' +
400
                        '</div>' +
401
                        '</td>' +
402
                        '</tr>';
403
                    $('#tableSubordinates tbody').append(s)
404
                });
405
                $('#job_description_id_boss').val(response['data']['job_description_id_boss']);
406
                validator.resetForm();
407
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
408
                $('#modal').modal('show');
409
            } else {
410
                $.fn.showError(response['data']);
411
            }
412
        }).fail(function(jqXHR, textStatus, errorThrown) {
413
            $.fn.showError(textStatus);
414
        }).always(function() {
415
            NProgress.done();
66 efrain 416
        });
935 geraldo 417
    });
418
    $('body').on('click', 'button.btn-refresh', function(e) {
419
        e.preventDefault();
420
        gridTable.api().ajax.reload(null, false);
421
    });
422
    $('body').on('click', 'button.btn-cancel', function(e) {
423
        e.preventDefault();
424
        $('#modal').modal('hide');
425
        $('#div-listing').show();
426
    });
427
    $('body').on('click', 'button.btn-import', function(e) {
428
        e.preventDefault();
429
        NProgress.start();
430
        $.ajax({
431
            'dataType': 'json',
432
            'method': 'post',
433
            'url': '$routeImport',
434
        }).done(function(response) {
435
            if (response['success']) {
436
                $.fn.showSuccess(response['data']);
437
                gridTable.api().ajax.reload(null, false);
438
            } else {
439
                $.fn.showError(response['data']);
440
            }
441
        }).fail(function(jqXHR, textStatus, errorThrown) {
442
            $.fn.showError(textStatus);
443
        }).always(function() {
444
            NProgress.done();
66 efrain 445
        });
935 geraldo 446
        return false;
66 efrain 447
    });
935 geraldo 448
    $('#form #status').bootstrapToggle({
449
        'on': 'LABEL_ACTIVE',
450
        'off': 'LABEL_INACTIVE',
451
        'width': '160px',
452
        'height': '40px'
453
    });
454
    CKEDITOR.replace('functions');
455
    CKEDITOR.replace('objectives');
1160 geraldo 456
 
457
 
458
    const setCompetencySelect = (data) =>{
459
        $.each(data, function(i, item) {
460
                if (filterItemById(item.competency_id).length <= 0) {
461
                    $('#select-competency').append($('<option>', {
462
                        value: item.competency_id,
463
                        text: item.name
464
                    }));
465
                }
466
            });
467
    }
468
 
469
    const filterItemById = (id) => [];
470
 
471
 
472
 
473
 
474
 
475
 
476
 
477
 
478
 
479
 
480
 
481
 
482
 
483
 
935 geraldo 484
});
1160 geraldo 485
 
486
 
487
 
488
 
66 efrain 489
JS;
490
$this->inlineScript()->captureEnd();
491
?>
492
 
493
<!-- Content Header (Page header) -->
494
<section class="content-header">
1101 geraldo 495
   <div class="container-fluid">
496
      <div class="row mb-2">
497
         <div class="col-sm-12">
498
            <h1>LABEL_JOBS_DESCRIPTION</h1>
499
         </div>
500
      </div>
501
   </div>
502
   <!-- /.container-fluid -->
66 efrain 503
</section>
504
<section class="content">
1101 geraldo 505
   <div class="container-fluid">
506
      <div class="row">
507
         <div class="col-12">
508
            <div class="card">
509
               <div class="card-body">
510
                  <table id="gridTable" class="table   table-hover">
511
                     <thead>
512
                        <tr>
513
                           <th>LABEL_NAME</th>
514
                           <th>LABEL_ACTIVE</th>
515
                           <th>LABEL_ACTIONS</th>
516
                        </tr>
517
                     </thead>
518
                     <tbody>
519
                     </tbody>
520
                  </table>
521
               </div>
522
               <div class="card-footer clearfix">
523
                  <div style="float:right;">
524
                     <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
525
                     <?php if($allowAdd) : ?>
526
                     <?php if($allowImport) : ?>
527
                     <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
528
                     <?php endif; ?>
529
                     <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
530
                     <?php endif; ?>
531
                  </div>
532
               </div>
533
            </div>
534
         </div>
535
      </div>
536
   </div>
537
</section>
66 efrain 538
<!-- The Modal -->
539
<div class="modal" id="modal">
1101 geraldo 540
   <div class="modal-dialog  modal-xl">
541
      <div class="modal-content">
542
         <!-- Modal Header -->
543
         <div class="modal-header">
544
            <h4 class="modal-title">LABEL_JOB_DESCRIPTION - <span id="form-title"></span></h4>
545
            <button type="button" class="close" data-dismiss="modal">&times;</button>
546
         </div>
547
         <!-- Modal body -->
548
         <div class="modal-body">
549
            <div class="card card-primary card-outline card-tabs">
550
               <div class="card-header p-0 pt-1 border-bottom-0">
551
                  <ul class="nav nav-tabs" id="custom-tabs" role="tablist">
552
                     <li class="nav-item">
553
                        <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>
554
                     </li>
555
                     <li class="nav-item">
556
                        <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>
557
                     </li>
558
                     <li class="nav-item">
559
                        <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>
560
                     </li>
561
                  </ul>
562
               </div>
563
               <div class="card-body">
564
                  <?php
565
                     $form = $this->form;
566
                     $form->setAttributes([
567
                         'method'    => 'post',
568
                         'name'      => 'form',
569
                         'id'        => 'form'
570
                     ]);
73 steven 571
 
1101 geraldo 572
                     $form->prepare();
573
                     echo $this->form()->openTag($form);
574
                     ?>
575
                  <div class="tab-content" id="custom-tabs-three-tabContent">
576
                     <div class="tab-pane fade show active" id="custom-tabs-general" role="tabpanel" aria-labelledby="custom-tabs-general-tab">
577
                        <div class="row">
578
                           <div class="col-md col-sm-12 col-12">
579
                              <div class="form-group m-0">
580
                                 <?php
581
                                    $element = $form->get('name');
582
                                    $element->setOptions(['label' => 'LABEL_NAME']);
66 efrain 583
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 584
 
66 efrain 585
                                    echo $this->formLabel($element);
1101 geraldo 586
                                    echo $this->formText($element);
66 efrain 587
                                    ?>
1101 geraldo 588
                              </div>
589
                           </div>
590
                           <div class="col-md col-sm-12 col-12">
591
                              <div class="form-group m-0">
592
                                 <?php
593
                                    $element = $form->get('job_description_id_boss');
594
                                    $element->setOptions(['label' => 'LABEL_BOSS']);
66 efrain 595
                                    $element->setAttributes(['class' => 'form-control']);
1101 geraldo 596
 
66 efrain 597
                                    echo $this->formLabel($element);
1101 geraldo 598
                                    echo $this->formSelect($element);
66 efrain 599
                                    ?>
1101 geraldo 600
                              </div>
601
                           </div>
602
                           <div
603
                              class="col-md col-sm-12 col-12 d-flex align-items-center justify-content-center"
604
                              >
605
                              <div class="form-group m-0">
606
                                 <label>LABEL_STATUS</label>
607
                                 <br />
608
                                 <?php
609
                                    $element = $form->get('status');
610
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
611
                                    // echo $this->formLabel($element);
612
                                    echo $this->formCheckbox($element);
613
                                    ?>
614
                              </div>
615
                           </div>
616
                        </div>
617
                        <div class="form-group">
618
                           <?php
619
                              $element = $form->get('objectives');
620
                              $element->setOptions(['label' => 'LABEL_OBJECTIVES']);
621
                              $element->setAttributes(['class' => 'form-control']);
622
 
623
                              echo $this->formLabel($element);
624
                              echo $this->formTextArea($element);
625
                              ?>
626
                        </div>
627
                        <div class="form-group">
628
                           <?php
629
                              $element = $form->get('functions');
630
                              $element->setOptions(['label' => 'LABEL_FUNCTIONS']);
631
                              $element->setAttributes(['class' => 'form-control']);
632
 
633
                              echo $this->formLabel($element);
634
                              echo $this->formTextArea($element);
635
                              ?>
636
                        </div>
637
                     </div>
1159 geraldo 638
                     <div class="tab-pane fade" id="custom-tabs-compentencies" role="tabpanel" aria-labelledby="custom-tabs-compentencies-tab">
639
                     <div class="row">
1158 geraldo 640
<div class="col-md-4 col-sm-4 col-xs-12">
641
                              <select name="select-competency" id="select-competency" class="form-control">
642
                              </select>
643
                           </div>
644
                           <div class="col-md-4 col-sm-4 col-xs-12">
1160 geraldo 645
                              <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 646
                           </div>
647
                           <div class="col-md-4 col-sm-4 col-xs-12"></div>
648
                    </div>
649
                    <div class="row">
650
                    <div class="col-md-12 col-sm-12 col-xs-12">
651
 
652
                    </div>
653
 
654
                    </div>
1101 geraldo 655
                     </div>
656
                     <div class="tab-pane fade" id="custom-tabs-subordinates" role="tabpanel" aria-labelledby="custom-tabs-subordinates-tab">
657
                        <table class="table table-hover"  id="tableSubordinates">
658
                           <thead>
659
                              <tr>
660
                                 <th>LABEL_SUBORDINATE</th>
661
                              </tr>
662
                           </thead>
663
                           <tbody>
664
                           </tbody>
665
                        </table>
666
                     </div>
667
                  </div>
668
               </div>
669
               <?php echo $this->form()->closeTag($form); ?>
670
               <!-- /.card -->
671
            </div>
672
         </div>
673
         <!-- Modal footer -->
674
         <div class="modal-footer">
675
            <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
676
            <button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
677
         </div>
678
      </div>
679
   </div>
680
</div>
66 efrain 681
 
682
 
683
 
684
 
685
 
686
 
687
 
688
 
689
 
690
 
691
 
692