Proyectos de Subversion LeadersLinked - Backend

Rev

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