Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16803 | Rev 16817 | 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
 
454
        var action   = $(this).data('href');
455
        $.getJSON(action, function(response) {
456
            if(response['success']) {
457
 
458
                $('#form').attr('action', action);
459
 
460
                behaviors = response['data']['behaviors'];
461
                competency_types = response['data']['competency_types'];
462
                competencies = response['data']['competencies'];
463
                competencies_selected = response['data']['competencies_selected'];
464
                subordinates_selected = response['data']['subordinates_selected'];
465
 
466
                $.fn.renderCompetencies();
467
 
16803 efrain 468
                $('#form-title').html( response['data']['form'])
15443 efrain 469
 
16803 efrain 470
 
15443 efrain 471
                var data = {
472
                    name: response['data']['name'],
473
                    functions : response['data']['functions'],
474
                    objectives : response['data']['objectives'],
475
                    form : response['data']['form'],
476
                    type : response['data']['type'],
477
                    supervisor : response['data']['supervisor'],
478
                    employee : response['data']['employee'],
479
                    last_date : response['data']['last_date'],
480
                }
481
                $.fn.renderJobDescription(data);
482
 
483
 
484
 
485
                $('input.input-behavior-level').inputNumberFormat({decimal: 0});
486
                $('input.input-behavior-level').change(function(e) {
487
                    e.preventDefault();
488
 
489
                    var v = parseInt($(this).val());
490
                    if(isNaN(v)) {
491
                        $(this).val('0');
492
                    } else {
493
                        if(v > 100) {
494
                            $(this).val('100');
495
                        }
496
                    }
497
                });
498
 
499
 
15450 efrain 500
                $('#comment').val('');
501
                $('#points').val('');
15443 efrain 502
                $('#row-header').hide();
503
                $('#row-table').hide();
504
                $('#row-test').show();
505
 
16804 efrain 506
                $('#stepwizard').smartWizard('reset');
507
 
15443 efrain 508
 
509
            } else {
510
                $.fn.showError(response['data'])
511
            }
512
        }).fail(function( jqXHR, textStatus, errorThrown) {
513
                    $.fn.showError(textStatus);
514
                }).always(function() {
515
                    NProgress.done();
516
                });
517
 
518
 
519
    });
520
 
521
 
522
    $('#form #comment').maxlength({
523
        alwaysShow: true,
524
        validate: true
525
    });
526
 
527
 
528
 
529
    $('#points').inputNumberFormat({decimal: 0});
530
    $('#points').change(function(e) {
531
        e.preventDefault();
532
 
533
        var v = parseInt($(this).val());
534
        if(isNaN(v)) {
535
            $(this).val('0');
536
        } else {
537
            if(v > 100) {
538
                $(this).val('100');
539
            }
540
        }
541
    });
542
 
16803 efrain 543
 
544
    $('#stepwizard').smartWizard({
545
        selected: 0,
546
        // autoAdjustHeight: false,
547
        theme: 'arrows', // basic, arrows, square, round, dots
548
        transition: {
549
            animation:'none'
550
        },
551
        lang: {
552
            next: 'LABEL_NEXT',
553
            previous: 'LABEL_PREVIOUS',
554
        },
555
        toolbar: {
556
            showNextButton: true, // show/hide a Next button
557
            showPreviousButton: true, // show/hide a Previous button
558
            position: 'bottom', // none/ top/ both bottom
559
            extraHtml: `<button type="button" class="btn btn-primary btn-save">LABEL_SAVE</button>`
560
                + `<button type="button" class="btn btn-secondary btn-cancel">LABEL_CANCEL</button>`
561
        },
562
        anchor: {
563
            enableNavigation: true, // Enable/Disable anchor navigation
564
            enableNavigationAlways: false, // Activates all anchors clickable always
565
            enableDoneState: true, // Add done state on visited steps
566
            markPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
567
            unDoneOnBackNavigation: true, // While navigate back, done state will be cleared
568
            enableDoneStateNavigation: true // Enable/Disable the done state navigation
569
        },
570
    });
571
 
572
    $('#stepwizard').smartWizard('reset');
573
 
15443 efrain 574
 
575
});
576
JS;
577
$this->inlineScript()->captureEnd();
578
?>
579
 
580
<!-- Content Header (Page header) -->
581
<section id="row-header" class="content-header">
582
    <div class="container-fluid">
583
        <div class="row mb-2">
584
            <div class="col-sm-12">
585
                <h1>LABEL_PERFORMANCE_EVALUATIONS</h1>
586
            </div>
587
        </div>
588
    </div>
589
    <!-- /.container-fluid -->
590
</section>
591
<section id="row-table" class="content">
592
    <div class="container-fluid" id="row-lists">
593
        <div class="row">
594
            <div class="col-12">
595
                <div class="card">
596
                    <div class="card-body">
597
                        <table id="gridTable" class="table   table-hover">
598
                            <thead>
599
                                <tr>
600
                                    <th style="width:15%">LABEL_LAST_DATE</th>
601
                                    <th style="width:35%">LABEL_FORM_NAME</th>
602
                                    <th style="width:35%">LABEL_SUPERVISOR</th>
603
                                    <th style="width:35%">LABEL_EVALUATED</th>
604
                                    <th style="width:15%">LABEL_STATUS</th>
605
 
606
                                </tr>
607
                            </thead>
608
                            <tbody></tbody>
609
                        </table>
610
                    </div>
611
                    <div class="card-footer clearfix">
612
                        <div style="float:right;">
613
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
614
                        </div>
615
                    </div>
616
                </div>
617
            </div>
618
        </div>
619
    </div>
620
</section>
621
 
622
 
623
<section id="row-test" style="display: none;">
16803 efrain 624
	<div class="container-fluid">
15443 efrain 625
        <div class="row p-2">
16803 efrain 626
			<div class="col-12">
627
				<h4 class="text-center" id="form-title"></h4>
628
				<?php
629
                $form->setAttributes([
630
                    'method' => 'post',
631
                    'name' => 'form',
632
                    'id' => 'form',
633
                ]);
634
                $form->prepare();
635
                echo $this->form()->openTag($form);
636
                ?>
637
 
638
        		<div id="stepwizard" class="border border-gray p-4 mt-2">
639
            		<ul class="nav">
640
                    	<li class="nav-item">
641
                        	<a class="nav-link" href="#step-1">
642
                            	<div class="num">1</div>
643
                              	LABEL_GENERAL
644
                         	</a>
645
                    	</li>
646
                        <li class="nav-item">
647
                        	<a class="nav-link" href="#step-2">
648
                            	<div class="num">2</div>
649
                               	LABEL_COMPETENCIES
650
                            </a>
651
                    	</li>
652
                        <li class="nav-item">
653
                        	<a class="nav-link" href="#step-3">
654
                            	<span class="num">3</span>
655
                              	LABEL_CONCLUTION
656
                            </a>
657
                     	</li>
658
  					</ul>
659
                    <div class="tab-content">
660
    					<div id="step-1" class="tab-pane" role="tabpanel" aria-labelledby="step-1">
661
                        	<div class="w-100">
662
                            	<div class="mf-field w-100 d-flex justify-content-between p-3 align-items-center">
663
                            		<div class="form-group w-100">
664
    									<h5 id="interview"></h5>
665
                                      	<div id="div-job-description"></div>
666
                                  	</div>
667
    							</div>
668
    						</div>
669
            			</div>
670
            		    <div id="step-2" class="tab-pane" role="tabpanel" aria-labelledby="step-2">
671
                            <div class="w-100">
672
                         		 <div class="accordion mt-5 w-100" id="accordion" style="height: 500px; overflow-y: auto;">
673
                            	</div>
674
                          	</div>
675
    					</div>
676
						<div id="step-3" class="tab-pane" role="tabpanel" aria-labelledby="step-3">
677
							<div class="form-group w-100">
678
                            	<?php
679
                                $element = $form->get('comment');
680
                                $element->setOptions(['label' => 'LABEL_COMMENT']);
681
                                $element->setAttributes(['class' => 'form-control']);
682
                                echo $this->formLabel($element);
683
                                echo $this->formTextArea($element);
684
                                ?>
685
                     		</div>
686
                  			<div class="form-group w-100">
687
                          		<?php
688
                                $element = $form->get('points');
689
                                $element->setAttributes(['class' => 'form-control']);
690
                                $element->setOptions(['label' => 'LABEL_EVALUATION']);
691
                                echo $this->formLabel($element);
692
                                echo $this->formNumber($element);
693
                                ?>
694
                   			</div>
695
						</div>
696
					</div>
697
            	</div>
698
        	</div>
699
			<?php echo $this->form()->closeTag($form); ?>
700
 		</div>
701
	</div>
702
</section>
15443 efrain 703
 
16803 efrain 704
 
15443 efrain 705
 
706
<script id="job-description-template" type="text/x-jsrender">
707
    <div class="card">
708
        <div class="card-body">
16803 efrain 709
 
15443 efrain 710
            <table class="table table-bordered">
711
                <tr>
712
                    <th>LABEL_LAST_DATE</th>
713
                    <th>LABEL_TYPE</th>
714
                </tr>
715
                <tr>
716
                    <td>{{:last_date}}</td>
717
                    <td>{{:type}}</td>
718
                </tr>
719
 
720
                <tr>
721
                    <th>LABEL_SUPERVISOR</th>
722
                    <th>LABEL_EMPLOYEE</th>
723
                </tr>
724
                <tr>
725
                    <td>{{:supervisor}}</td>
726
                    <td>{{:employee}}</td>
727
                </tr>
728
            </table>
729
            <br/>
730
 
731
            <p class="card-text"><b>LABEL_OBJECTIVES</b></p>
732
            <p class="card-text">{{:objectives}}</p>
733
            <p class="card-text"><b>LABEL_FUNCTIONS</b></p>
734
            <p class="card-text">{{:functions}}</p>
735
 
736
        </div>
737
    </div>
738
</script>
739
 
740
 
741
<script id="competencyTemplate" type="text/x-jsrender">
16803 efrain 742
<div class="card">
743
    <div class="card-header" id="heading-{{:uuid}}">
744
        <h2 class="clearfix mb-0">
745
            <a class="btn btn-link" data-toggle="collapse" data-target="#collapse-{{:uuid}}" aria-expanded="true" aria-controls="collapse-{{:uuid}}">
746
                <i class="fa fa-plus"></i> {{:~getCompetencyType(competency_type_uuid).name}} - {{:~getCompetency(uuid).name}}
747
            </a>
748
        </h2>
749
    </div>
750
    <div id="collapse-{{:uuid}}" class="collapse" aria-labelledby="heading-{{:uuid}}" data-parent="#accordion">
751
        <div class="card-body">
752
            <div class="table-responsive">
753
                <table class="table table-bordered">
754
                    <thead>
755
                        <tr>
756
                            <th style="width: 30%;">LABEL_ELEMENT</th>
757
                            <th style="width: 50%;">LABEL_TITLE</th>
758
                            <th style="width: 10%;">LABEL_LEVEL</th>
759
                            <th style="width: 10%;">LABEL_POINTS</th>
760
                         </tr>
761
                    </thead>
762
                    <tbody>
763
                        <tr>
764
                            <td class="text-left">LABEL_COMPETENCY</td>
765
                            <td class="text-left">{{:name}}</td>
766
                            <td>&nbsp;</td>
767
                            <td>&nbsp;</td>
768
                        </tr>
769
                        {{for behaviors}}
770
                        <tr >
771
                            <td class="text-left">--LABEL_BEHAVIOR</td>
772
                                <td class="text-left">
773
                            {{:~getBehavior(uuid).description}}
774
                            </td>
775
                            <td class="text-right">
776
                                {{:level}}
777
                            </td>
778
                            <td class="text-right">
779
                                <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>
780
                            </td>
781
                        </tr>
782
                        <tr >
783
                            <td colspan="4">
784
                                LABEL_COMMENT
785
                                <input type="text" class="form-control input-behavior-comment" value="" maxlength="128" name="{{:competency_uuid}}-{{:uuid}}-comment" id="{{:competency_uuid}}-{{:uuid}}-comment" ></input>
786
                            </td>
787
                        </tr >
788
                        {{/for}}
789
                    </tbody>
790
                </table>
791
            </div>
792
        </div>
793
    </div>
794
</div>
15443 efrain 795
 
796
</script>
797
 
798