Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16804 | Rev 16822 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
15443 efrain 1
<?php
2
 
3
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
4
$currentUser    = $this->currentUserHelper();
5
$roleName       = $currentUser->getUserTypeId();
6
 
7
$routeDatatable = $this->url( 'activities-center/performance-evaluation');
8
 
9
 
10
$allowTakeaTest = $acl->isAllowed($roleName, 'activities-center/performance-evaluation/take-a-test') ? 1 : 0;
11
$allowReport =  $acl->isAllowed($roleName, 'activities-center/performance-evaluation/report') ? 1 : 0;
12
 
13
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
14
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
15
 
16803 efrain 16
//$this->headLink()->appendStylesheet('https://fonts.googleapis.com/icon?family=Material+Icons');
15443 efrain 17
 
18
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
19
 
20
 
21
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-maxlenght/bootstrap-maxlength.min.js'));
22
 
23
 
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
27
 
28
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
29
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
30
 
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
35
 
36
 
37
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
38
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
39
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
42
//$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
43
//$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
44
 
45
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datepicker/js/bootstrap-datepicker.js'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datepicker/js/bootstrap-datepicker.es.js'));
47
 
48
 
49
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datepicker/css/bootstrap-datepicker.css'));
50
 
51
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
52
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
53
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.min.js'));
54
 
55
// JsRender //
56
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
57
 
58
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
59
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
60
 
61
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
62
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
63
 
64
 
65
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
66
 
16803 efrain 67
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-wizard/jquery.smartWizard.min.js'));
68
$this->headLink()->appendStylesheet($this->basePath('plugins/jquery-wizard/smart_wizard_all.min.css'));
69
 
70
$this->headLink()->appendStylesheet($this->basePath('css/activity-center-accordion.css'));
71
 
72
 
15443 efrain 73
$this->inlineScript()->captureStart();
74
echo <<<JS
75
 
76
 
77
jQuery( document ).ready(function( $ ) {
78
 
79
    var allowTakeaTest = $allowTakeaTest;
80
    var allowReport = $allowReport
81
 
82
    var competencies_selected = new Array();
83
    var subordinates_selected = new Array();
84
 
85
    var competency_types = new Array();
86
    var competencies = new Array();
87
    var behaviors = new Array();
88
 
89
 
90
    $.fn.renderJobDescription = function(data) {
91
 
92
        $('#div-job-description').html($('#job-description-template').render(data));
93
    }
94
 
95
 
96
    $.fn.renderCompetencies = function() {
97
 
98
        if(competencies_selected.length > 0) {
99
 
16803 efrain 100
             $('#accordion').html($('#competencyTemplate').render(competencies_selected, {
15443 efrain 101
                getCompetencyType: (uuid) => competency_types.filter((item) => item.uuid == uuid ? item : false)[0],
102
                getCompetency: (uuid) => competencies.filter((item) => item.uuid == uuid ? item : false)[0],
103
                getBehavior: (uuid) => behaviors.filter((item) => item.uuid == uuid ? item : false)[0]
104
            }));
105
        } else {
106
 
107
 
16803 efrain 108
             $('#accordion').empty();
15443 efrain 109
        }
16803 efrain 110
 
111
 
112
    	$('.collapse.show').each(function(){
113
    		$(this).siblings('.card-header').find('.btn i').attr('class', 'fa fa-minus');
114
    	});
115
 
116
    	$('.collapse').on('show.bs.collapse', function(){
117
        	$(this).parent().find('.card-header .btn i').attr('class', 'fa fa-minus');
118
    	}).on('hide.bs.collapse', function(){
119
    		$(this).parent().find('.card-header .btn i').attr('class', 'fa fa-plus');
120
    	});
121
 
15443 efrain 122
    }
123
 
124
 
125
 
126
    $.validator.setDefaults({
127
        debug: true,
128
        highlight: function(element) {
129
            $(element).addClass('is-invalid');
130
        },
131
        unhighlight: function(element) {
132
            $(element).removeClass('is-invalid');
133
        },
134
        errorElement: 'span',
135
        errorClass: 'error invalid-feedback',
136
        errorPlacement: function(error, element) {
137
            if(element.parent('.form-group').length) {
138
                error.insertAfter(element);
139
            } else if(element.parent('.toggle').length) {
140
                error.insertAfter(element.parent().parent());
141
            } else {
142
                error.insertAfter(element.parent());
143
            }
144
        }
145
    });
146
 
147
 
148
 
149
    $.fn.showFormErrorValidator = function(fieldname, errors) {
150
        var field = $(fieldname);
151
        if(field) {
152
            $(field).addClass('form-group-has-error');
153
 
154
            var error = $('<div id="' + fieldname +'-error" class="form-group-invalid-feedback">' + errors + '</div>');
155
            if(field.parent('.form-group').length) {
156
                error.insertAfter(field.parent());
157
            } else {
158
                error.insertAfter(field);
159
            }
160
        }
161
    };
162
 
163
 
164
 
165
        var gridTable = $('#gridTable').dataTable( {
166
            'processing': true,
167
            'serverSide': true,
168
            'searching': true,
169
            'search' : {
170
                'search' : '$search',
171
            },
172
 
173
            'order': [[ 1, 'asc' ]],
174
            'ordering':  true,
175
            'ordenable' : true,
176
            'responsive': true,
177
            'select' : false,
178
                'paging': true,
179
            'pagingType': 'simple_numbers',
180
            'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, 'All'] ],
181
 
182
                'ajax': {
183
                        'url' : '$routeDatatable',
184
                        'type' : 'get',
185
                'data': function ( d ) {
186
 
187
 
188
                },
189
                'beforeSend': function (request) {
190
                  NProgress.start();
191
                },
192
                'dataFilter': function(response) {
193
                    var response = jQuery.parseJSON( response );
194
 
195
                    var json                = {};
196
                    json.recordsTotal       = 0;
197
                    json.recordsFiltered    = 0;
198
                    json.data               = [];
199
 
200
                    if(response.success) {
201
                                               json.recordsTotal       = response.data.total;
202
                        json.recordsFiltered    = response.data.total;
203
                        json.data               = response.data.items;
204
                    } else {
205
                        $.fn.showError(response.data)
206
                    }
207
 
208
                    return JSON.stringify( json );
209
                }
210
                },
211
            'language' : {
212
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
213
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
214
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
215
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
216
                'sInfo':           'LABEL_DATATABLE_SINFO',
217
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
218
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
219
                'sInfoPostFix':    '',
220
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
221
                'sUrl':            '',
222
                'sInfoThousands':  ',',
223
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
224
                'oPaginate': {
225
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
226
                    'sLast':     'LABEL_DATATABLE_SLAST',
227
                    'sNext':     'LABEL_DATATABLE_SNEXT',
228
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
229
                },
230
                'oAria': {
231
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
232
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
233
                },
234
            },
235
            'drawCallback': function( settings ) {
236
                NProgress.done();
237
                $('button.btn-delete').confirmation({
238
                    rootSelector: 'button.btn-delete',
239
                    title : 'LABEL_ARE_YOU_SURE',
240
                    singleton : true,
241
                    btnOkLabel: 'LABEL_YES',
242
                    btnCancelLabel: 'LABEL_NO',
243
                    onConfirm: function(value) {
244
                        action = $(this).data('href');
245
                        NProgress.start();
246
                        $.ajax({
247
                            'dataType'  : 'json',
248
                            'accept'    : 'application/json',
249
                            'method'    : 'post',
250
                            'url'       :  action,
251
                        }).done(function(response) {
252
                            if(response['success']) {
253
                                $.fn.showSuccess(response['data']);
254
                                gridTable.api().ajax.reload(null, false);
255
                            } else {
256
                                $.fn.showError(response['data']);
257
                            }
258
                        }).fail(function( jqXHR, textStatus, errorThrown) {
259
                            $.fn.showError(textStatus);
260
                        }).always(function() {
261
                            NProgress.done();
262
                        });
263
                    },
264
                });
265
 
266
 
267
            },
268
            'aoColumns': [
269
                { 'mDataProp': 'last_date' },
270
                { 'mDataProp': 'form' },
271
                { 'mDataProp': 'supervisor_first_name' },
272
                { 'mDataProp': 'employee_last_name' },
273
                { 'mDataProp': 'status' },
274
 
275
            ],
276
            'columnDefs': [
277
                {
278
                    'targets': 0,
279
                    'render' : function ( data, type, row ) {
280
                        var s = row['last_date'] + '<br>' + row['type'];
281
 
282
                        return s;
283
 
284
 
285
                     }
286
                },
287
                {
288
                    'targets': 1,
289
                    'render' : function ( data, type, row ) {
290
                        var s = row['form'];
291
 
292
                        if (allowTakeaTest && row['actions']['link_take_a_test']) {
293
 
294
                            s = s + '<br><button class="btn btn-default btn-take-the-test" data-href="' + row['actions']['link_take_a_test'] + '" data-toggle="tooltip" title="LABEL_PERFORMANCE_EVALUATION_TAKE_TEST"><i class="fa fa-pencil"></i> LABEL_PERFORMANCE_EVALUATION_TAKE_TEST </button>&nbsp;';
295
                        }
296
 
297
                        if (allowReport && row['actions']['link_pdf']) {
298
                            s = s + '<br><button class="btn btn-default btn-pdf" data-href="' + row['actions']['link_pdf'] + '" data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-pdf"></i> LABEL_PDF </button>&nbsp;';
299
                        }
300
 
301
                        return s;
302
 
303
 
304
                     }
305
                },
306
                {
307
                    'targets': 2,
308
                    'render' : function ( data, type, row ) {
309
                        var s = row['supervisor_first_name'] + ' ' + row['supervisor_last_name'];
310
 
311
                        return s;
312
 
313
 
314
                     }
315
                },
316
                {
317
                    'targets': 3,
318
                    'render' : function ( data, type, row ) {
319
                        var s = row['employee_first_name'] + ' ' + row['employee_last_name'];
320
 
321
                        return s;
322
 
323
 
324
                     }
325
                },
326
 
327
              ],
328
        });
329
 
330
 
331
 
332
    $('body').on('click', 'button.btn-save', function(e) {
333
        e.preventDefault();
334
 
335
        var ok = $('#comment').val().trim().length > 0
336
        $.each($('input.input-behavior-comment'), function(index, element) {
337
            ok = ok && $(element).val().trim().length > 0;
338
        });
339
 
340
        if(!ok) {
341
            $.fn.showError('ERROR_PERFORMANCE_SOMEONE_COMMENT_IS_EMPTY');
342
            return false;
343
        }
344
 
345
        bootbox.confirm({
346
            message: 'LABEL_PERFORMANCE_EVALUATION_TEST_IS_COMPLETED',
347
            buttons: {
348
                confirm: {
349
                    label: 'LABEL_YES',
350
                    className: 'btn-success'
351
                },
352
                cancel: {
353
                    label: 'LABEL_NO',
354
                    className: 'btn-warning'
355
                }
356
            },
357
            callback: function (result) {
358
                if(result) {
359
                    var data = new Array()
360
                    data['comment'] = $('#comment').val().trim();
361
                    data['points'] = $('#points').val();
362
                    $.each($('input.input-behavior-comment'), function(index, element) {
363
                        k = $(this).attr('name');
364
                        v = $(this).val().trim();
365
 
366
                        data[k] = v;
367
                    });
368
                    $.each($('input.input-behavior-level'), function(index, element) {
369
                        k = $(this).attr('name');
370
                        v = $(this).val();
371
 
372
                        data[k] = v;
373
                    });
374
 
375
 
376
 
377
                    var action = $('#form').attr('action');
378
                    $.ajax({
379
                        'dataType': 'json',
380
                        'accept': 'application/json',
381
                        'method': 'post',
382
                        'url': action,
383
                        'data' : $('#form').serialize()
384
                    }).done(function(response) {
385
                        if (response['success']) {
386
                            $('#row-test').hide();
387
                            $('#row-header').show();
388
                            $('#row-table').show();
389
 
390
                            gridTable.api().ajax.reload(null, false);
391
                        } else {
392
                            $.fn.showError(response['data']);
393
                        }
394
                    }).fail(function(jqXHR, textStatus, errorThrown) {
395
                        $.fn.showError(textStatus);
396
                    });
397
                }
398
            }
399
        });
400
 
401
 
402
    });
403
 
404
    $('body').on('click', 'button.btn-refresh', function(e) {
405
        e.preventDefault();
406
        gridTable.api().ajax.reload(null, false);
407
    });
408
 
409
 
410
   $('body').on('click', 'button.btn-pdf', function(e) {
411
        e.preventDefault();
412
        var action   = $(this).data('href');
413
 
414
 
415
        NProgress.start();
416
        $.ajax({
417
            'dataType'  : 'json',
418
            'method'    : 'get',
419
            'url'       :  action,
420
        }).done(function(response) {
421
            if(response['success']) {
422
                var anchor = window.document.createElement("a");
423
                anchor.href = 'data:application/octet-stream;charset=utf-8;base64,' + response['data']['content'] ;
424
                anchor.download = response['data']['basename'];
425
                document.body.appendChild(anchor);
426
                anchor.click();  // IE: "Access is denied"; see: https://connect.microsoft.com/IE/feedback/details/797361/ie-10-treats-blob-url-as-cross-origin-and-denies-access
427
                document.body.removeChild(anchor);
428
            } else {
429
                $.fn.showError(response['data']);
430
            }
431
        }).fail(function( jqXHR, textStatus, errorThrown) {
432
            $.fn.showError(textStatus);
433
        }).always(function() {
434
            NProgress.done();
435
        });
436
 
437
 
438
 
439
    });
440
 
441
    $('body').on('click', 'button.btn-cancel', function(e) {
442
        e.preventDefault();
443
 
444
        $('#row-test').hide();
445
        $('#row-header').show();
446
        $('#row-table').show();
447
 
448
    });
449
 
450
 
451
    $('body').on('click', 'button.btn-take-the-test', function(e) {
452
        e.preventDefault();
453
 
16817 efrain 454
         NProgress.done();
455
 
15443 efrain 456
        var action   = $(this).data('href');
16817 efrain 457
 
458
 
459
 
15443 efrain 460
        $.getJSON(action, function(response) {
461
            if(response['success']) {
462
 
463
                $('#form').attr('action', action);
464
 
465
                behaviors = response['data']['behaviors'];
466
                competency_types = response['data']['competency_types'];
467
                competencies = response['data']['competencies'];
468
                competencies_selected = response['data']['competencies_selected'];
469
                subordinates_selected = response['data']['subordinates_selected'];
470
 
471
                $.fn.renderCompetencies();
472
 
16803 efrain 473
                $('#form-title').html( response['data']['form'])
15443 efrain 474
 
16803 efrain 475
 
15443 efrain 476
                var data = {
477
                    name: response['data']['name'],
478
                    functions : response['data']['functions'],
479
                    objectives : response['data']['objectives'],
480
                    form : response['data']['form'],
481
                    type : response['data']['type'],
482
                    supervisor : response['data']['supervisor'],
483
                    employee : response['data']['employee'],
484
                    last_date : response['data']['last_date'],
485
                }
486
                $.fn.renderJobDescription(data);
487
 
488
 
489
 
490
                $('input.input-behavior-level').inputNumberFormat({decimal: 0});
491
                $('input.input-behavior-level').change(function(e) {
492
                    e.preventDefault();
493
 
494
                    var v = parseInt($(this).val());
495
                    if(isNaN(v)) {
496
                        $(this).val('0');
497
                    } else {
498
                        if(v > 100) {
499
                            $(this).val('100');
500
                        }
501
                    }
502
                });
503
 
504
 
15450 efrain 505
                $('#comment').val('');
506
                $('#points').val('');
15443 efrain 507
                $('#row-header').hide();
508
                $('#row-table').hide();
509
                $('#row-test').show();
510
 
16804 efrain 511
                $('#stepwizard').smartWizard('reset');
512
 
15443 efrain 513
 
514
            } else {
515
                $.fn.showError(response['data'])
516
            }
517
        }).fail(function( jqXHR, textStatus, errorThrown) {
518
                    $.fn.showError(textStatus);
519
                }).always(function() {
520
                    NProgress.done();
521
                });
522
 
523
 
524
    });
525
 
526
 
527
    $('#form #comment').maxlength({
528
        alwaysShow: true,
529
        validate: true
530
    });
531
 
532
 
533
 
534
    $('#points').inputNumberFormat({decimal: 0});
535
    $('#points').change(function(e) {
536
        e.preventDefault();
537
 
538
        var v = parseInt($(this).val());
539
        if(isNaN(v)) {
540
            $(this).val('0');
541
        } else {
542
            if(v > 100) {
543
                $(this).val('100');
544
            }
545
        }
546
    });
547
 
16803 efrain 548
 
549
    $('#stepwizard').smartWizard({
550
        selected: 0,
551
        // autoAdjustHeight: false,
552
        theme: 'arrows', // basic, arrows, square, round, dots
553
        transition: {
554
            animation:'none'
555
        },
556
        lang: {
557
            next: 'LABEL_NEXT',
558
            previous: 'LABEL_PREVIOUS',
559
        },
560
        toolbar: {
561
            showNextButton: true, // show/hide a Next button
562
            showPreviousButton: true, // show/hide a Previous button
563
            position: 'bottom', // none/ top/ both bottom
564
            extraHtml: `<button type="button" class="btn btn-primary btn-save">LABEL_SAVE</button>`
565
                + `<button type="button" class="btn btn-secondary btn-cancel">LABEL_CANCEL</button>`
566
        },
567
        anchor: {
568
            enableNavigation: true, // Enable/Disable anchor navigation
569
            enableNavigationAlways: false, // Activates all anchors clickable always
570
            enableDoneState: true, // Add done state on visited steps
571
            markPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
572
            unDoneOnBackNavigation: true, // While navigate back, done state will be cleared
573
            enableDoneStateNavigation: true // Enable/Disable the done state navigation
574
        },
575
    });
576
 
577
    $('#stepwizard').smartWizard('reset');
578
 
15443 efrain 579
 
580
});
581
JS;
582
$this->inlineScript()->captureEnd();
583
?>
584
 
585
<!-- Content Header (Page header) -->
586
<section id="row-header" class="content-header">
587
    <div class="container-fluid">
588
        <div class="row mb-2">
589
            <div class="col-sm-12">
590
                <h1>LABEL_PERFORMANCE_EVALUATIONS</h1>
591
            </div>
592
        </div>
593
    </div>
594
    <!-- /.container-fluid -->
595
</section>
596
<section id="row-table" class="content">
597
    <div class="container-fluid" id="row-lists">
598
        <div class="row">
599
            <div class="col-12">
600
                <div class="card">
601
                    <div class="card-body">
602
                        <table id="gridTable" class="table   table-hover">
603
                            <thead>
604
                                <tr>
605
                                    <th style="width:15%">LABEL_LAST_DATE</th>
606
                                    <th style="width:35%">LABEL_FORM_NAME</th>
607
                                    <th style="width:35%">LABEL_SUPERVISOR</th>
608
                                    <th style="width:35%">LABEL_EVALUATED</th>
609
                                    <th style="width:15%">LABEL_STATUS</th>
610
 
611
                                </tr>
612
                            </thead>
613
                            <tbody></tbody>
614
                        </table>
615
                    </div>
616
                    <div class="card-footer clearfix">
617
                        <div style="float:right;">
618
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
619
                        </div>
620
                    </div>
621
                </div>
622
            </div>
623
        </div>
624
    </div>
625
</section>
626
 
627
 
628
<section id="row-test" style="display: none;">
16803 efrain 629
	<div class="container-fluid">
15443 efrain 630
        <div class="row p-2">
16803 efrain 631
			<div class="col-12">
632
				<h4 class="text-center" id="form-title"></h4>
633
				<?php
634
                $form->setAttributes([
635
                    'method' => 'post',
636
                    'name' => 'form',
637
                    'id' => 'form',
638
                ]);
639
                $form->prepare();
640
                echo $this->form()->openTag($form);
641
                ?>
642
 
643
        		<div id="stepwizard" class="border border-gray p-4 mt-2">
644
            		<ul class="nav">
645
                    	<li class="nav-item">
646
                        	<a class="nav-link" href="#step-1">
647
                            	<div class="num">1</div>
648
                              	LABEL_GENERAL
649
                         	</a>
650
                    	</li>
651
                        <li class="nav-item">
652
                        	<a class="nav-link" href="#step-2">
653
                            	<div class="num">2</div>
654
                               	LABEL_COMPETENCIES
655
                            </a>
656
                    	</li>
657
                        <li class="nav-item">
658
                        	<a class="nav-link" href="#step-3">
659
                            	<span class="num">3</span>
660
                              	LABEL_CONCLUTION
661
                            </a>
662
                     	</li>
663
  					</ul>
664
                    <div class="tab-content">
665
    					<div id="step-1" class="tab-pane" role="tabpanel" aria-labelledby="step-1">
666
                        	<div class="w-100">
667
                            	<div class="mf-field w-100 d-flex justify-content-between p-3 align-items-center">
668
                            		<div class="form-group w-100">
669
    									<h5 id="interview"></h5>
670
                                      	<div id="div-job-description"></div>
671
                                  	</div>
672
    							</div>
673
    						</div>
674
            			</div>
675
            		    <div id="step-2" class="tab-pane" role="tabpanel" aria-labelledby="step-2">
676
                            <div class="w-100">
677
                         		 <div class="accordion mt-5 w-100" id="accordion" style="height: 500px; overflow-y: auto;">
678
                            	</div>
679
                          	</div>
680
    					</div>
681
						<div id="step-3" class="tab-pane" role="tabpanel" aria-labelledby="step-3">
682
							<div class="form-group w-100">
683
                            	<?php
684
                                $element = $form->get('comment');
685
                                $element->setOptions(['label' => 'LABEL_COMMENT']);
686
                                $element->setAttributes(['class' => 'form-control']);
687
                                echo $this->formLabel($element);
688
                                echo $this->formTextArea($element);
689
                                ?>
690
                     		</div>
691
                  			<div class="form-group w-100">
692
                          		<?php
693
                                $element = $form->get('points');
694
                                $element->setAttributes(['class' => 'form-control']);
695
                                $element->setOptions(['label' => 'LABEL_EVALUATION']);
696
                                echo $this->formLabel($element);
697
                                echo $this->formNumber($element);
698
                                ?>
699
                   			</div>
700
						</div>
701
					</div>
702
            	</div>
703
        	</div>
704
			<?php echo $this->form()->closeTag($form); ?>
705
 		</div>
706
	</div>
707
</section>
15443 efrain 708
 
16803 efrain 709
 
15443 efrain 710
 
711
<script id="job-description-template" type="text/x-jsrender">
712
    <div class="card">
713
        <div class="card-body">
16803 efrain 714
 
15443 efrain 715
            <table class="table table-bordered">
716
                <tr>
717
                    <th>LABEL_LAST_DATE</th>
718
                    <th>LABEL_TYPE</th>
719
                </tr>
720
                <tr>
721
                    <td>{{:last_date}}</td>
722
                    <td>{{:type}}</td>
723
                </tr>
724
 
725
                <tr>
726
                    <th>LABEL_SUPERVISOR</th>
727
                    <th>LABEL_EMPLOYEE</th>
728
                </tr>
729
                <tr>
730
                    <td>{{:supervisor}}</td>
731
                    <td>{{:employee}}</td>
732
                </tr>
733
            </table>
734
            <br/>
735
 
736
            <p class="card-text"><b>LABEL_OBJECTIVES</b></p>
737
            <p class="card-text">{{:objectives}}</p>
738
            <p class="card-text"><b>LABEL_FUNCTIONS</b></p>
739
            <p class="card-text">{{:functions}}</p>
740
 
741
        </div>
742
    </div>
743
</script>
744
 
745
 
746
<script id="competencyTemplate" type="text/x-jsrender">
16803 efrain 747
<div class="card">
748
    <div class="card-header" id="heading-{{:uuid}}">
749
        <h2 class="clearfix mb-0">
750
            <a class="btn btn-link" data-toggle="collapse" data-target="#collapse-{{:uuid}}" aria-expanded="true" aria-controls="collapse-{{:uuid}}">
751
                <i class="fa fa-plus"></i> {{:~getCompetencyType(competency_type_uuid).name}} - {{:~getCompetency(uuid).name}}
752
            </a>
753
        </h2>
754
    </div>
755
    <div id="collapse-{{:uuid}}" class="collapse" aria-labelledby="heading-{{:uuid}}" data-parent="#accordion">
756
        <div class="card-body">
757
            <div class="table-responsive">
758
                <table class="table table-bordered">
759
                    <thead>
760
                        <tr>
761
                            <th style="width: 30%;">LABEL_ELEMENT</th>
762
                            <th style="width: 50%;">LABEL_TITLE</th>
763
                            <th style="width: 10%;">LABEL_LEVEL</th>
764
                            <th style="width: 10%;">LABEL_POINTS</th>
765
                         </tr>
766
                    </thead>
767
                    <tbody>
768
                        <tr>
769
                            <td class="text-left">LABEL_COMPETENCY</td>
770
                            <td class="text-left">{{:name}}</td>
771
                            <td>&nbsp;</td>
772
                            <td>&nbsp;</td>
773
                        </tr>
774
                        {{for behaviors}}
775
                        <tr >
776
                            <td class="text-left">--LABEL_BEHAVIOR</td>
777
                                <td class="text-left">
778
                            {{:~getBehavior(uuid).description}}
779
                            </td>
780
                            <td class="text-right">
781
                                {{:level}}
782
                            </td>
783
                            <td class="text-right">
784
                                <input type="number" class="form-control input-behavior-level " value="0" step="1" min="0" max="100" name="{{:competency_uuid}}-{{:uuid}}-points" id="{{:competency_uuid}}-{{:uuid}}-points" ></input>
785
                            </td>
786
                        </tr>
787
                        <tr >
788
                            <td colspan="4">
789
                                LABEL_COMMENT
790
                                <input type="text" class="form-control input-behavior-comment" value="" maxlength="128" name="{{:competency_uuid}}-{{:uuid}}-comment" id="{{:competency_uuid}}-{{:uuid}}-comment" ></input>
791
                            </td>
792
                        </tr >
793
                        {{/for}}
794
                    </tbody>
795
                </table>
796
            </div>
797
        </div>
798
    </div>
799
</div>
15443 efrain 800
 
801
</script>
802
 
803