Proyectos de Subversion LeadersLinked - Backend

Rev

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