Proyectos de Subversion LeadersLinked - Backend

Rev

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