Proyectos de Subversion LeadersLinked - Backend

Rev

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