Proyectos de Subversion LeadersLinked - Backend

Rev

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