Proyectos de Subversion LeadersLinked - Backend

Rev

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