Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 16777 | Rev 16779 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 16777 Rev 16778
Línea 64... Línea 64...
64
// JsRender //
64
// JsRender //
65
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
65
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
Línea 66... Línea 66...
66
 
66
 
-
 
67
 
Línea 67... Línea 68...
67
 
68
$status_active = JobDescription::STATUS_ACTIVE;
68
$status_active = JobDescription::STATUS_ACTIVE;
69
$status_inactive = JobDescription::STATUS_INACTIVE;
Línea 170... Línea 171...
170
                _super(\$item, container);
171
                _super(\$item, container);
171
            },
172
            },
172
            onDrop: function(\$item, container, _super) {
173
            onDrop: function(\$item, container, _super) {
173
                var data = $.groupSortable.sortable('serialize').get();
174
                var data = $.groupSortable.sortable('serialize').get();
174
                var jsonString = JSON.stringify(data, null, ' ');
175
                var jsonString = JSON.stringify(data, null, ' ');
175
 
176
/*
176
                $.ajax({
177
                $.ajax({
177
                    'dataType': 'json',
178
                    'dataType': 'json',
178
                    'accept': 'application/json',
179
                    'accept': 'application/json',
179
                    'method': 'post',
180
                    'method': 'post',
180
                    'url': '$routeDatatable',
181
                    'url': '$routeDatatable',
Línea 187... Línea 188...
187
                    if (!response['success']) {
188
                    if (!response['success']) {
188
                        $.fn.showError(response['data']);
189
                        $.fn.showError(response['data']);
189
                    }
190
                    }
190
                }).fail(function(jqXHR, textStatus, errorThrown) {
191
                }).fail(function(jqXHR, textStatus, errorThrown) {
191
                    $.fn.showError(textStatus);
192
                    $.fn.showError(textStatus);
192
                })
193
                })*/
Línea 193... Línea 194...
193
 
194
 
194
 
195
 
Línea 265... Línea 266...
265
                required: false,
266
                required: false,
266
            },
267
            },
267
        },
268
        },
268
        submitHandler: function(form) {
269
        submitHandler: function(form) {
Línea -... Línea 270...
-
 
270
    
-
 
271
 
269
    
272
  
270
            var data = {
273
            var data = {
271
                name : $('#form #name').val(),
274
                name : $('#form #name').val(),
272
                functions : $('#form #functions').val(),
275
                functions : $('#form #functions').val(),
273
                objectives : $('#form #objectives').val(),
276
                objectives : $('#form #objectives').val(),
274
                status :  $('#form #status').val(),
277
                status :  $('#form #status').prop('checked') ?  '$status_active' : '$status_inactive',
275
                competencies_selected : new Array(),
278
                competencies_selected : new Array(),
Línea 276... Línea 279...
276
            };
279
            };
Línea 352... Línea 355...
352
 
355
 
353
    $('body').on('click', 'button.btn-add-job-description', function(e) {
356
    $('body').on('click', 'button.btn-add-job-description', function(e) {
Línea 354... Línea 357...
354
        e.preventDefault();
357
        e.preventDefault();
355
 
-
 
356
        var link = $(this).data('link');
-
 
357
        NProgress.start();
-
 
358
        $.ajax({
-
 
359
            'dataType': 'json',
-
 
360
            'accept': 'application/json',
-
 
361
            'method': 'get',
-
 
362
            'action' : link,
-
 
363
        }).done(function(response) {
-
 
364
 
-
 
365
            if (response['success']) {
-
 
366
 
-
 
367
 
-
 
368
                behaviors = response['data']['behaviors'];
-
 
369
                competency_types = response['data']['competency_types'];
-
 
370
                competencies = response['data']['competencies'];
-
 
371
 
-
 
372
 
-
 
373
                competencies_selected = [];
-
 
374
 
-
 
375
 
-
 
376
                $.each(competencies, function(i, competency) {
-
 
377
                    $.each(competency.behaviors, function(j, behavior) {
-
 
378
                        competencies[i].behaviors[j].level = 0;
-
 
379
                    });
-
 
380
                });
-
 
381
 
-
 
382
                $.fn.renderCompetencies();
-
 
383
                $.fn.comboCompetencies();
-
 
384
 
-
 
385
                $('span[id="form-title"]').html('LABEL_ADD');
-
 
386
                $('#form').attr('action', link);
-
 
387
                $('#form #name').val('');
-
 
388
                $('#form #status').bootstrapToggle('on');
-
 
389
                    
-
 
390
                $('#form #functions').val('');
-
 
391
                $('#form #objectives').val('');
358
 
392
 
-
 
393
                validator.resetForm();
-
 
394
 
-
 
395
 
-
 
396
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
-
 
Línea 397... Línea -...
397
                $('#row-lists').hide();
-
 
398
                $('#row-form').show();
-
 
399
 
-
 
400
           } else   {                      
-
 
401
                $.fn.showError(response['data']);
-
 
402
            }
-
 
403
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
404
            $.fn.showError(textStatus);
-
 
405
        }).always(function() {
-
 
406
            NProgress.done();
359
        var link = $(this).data('link');
407
        });
360
        $.fn.defaultValuesAdd(link);
Línea 408... Línea 361...
408
       
361
 
409
        return false
362
        return false
Línea 410... Línea -...
410
    });
-
 
411
 
-
 
412
    $('body').on('click', 'i.btn-add-job-description', function(e) {
-
 
413
        e.preventDefault();
-
 
414
 
-
 
415
        var link = $(this).data('link');
-
 
416
        NProgress.start();
-
 
417
        $.ajax({
-
 
418
            'dataType': 'json',
-
 
419
            'accept': 'application/json',
-
 
420
            'method': 'get',
-
 
421
            'action' : link,
-
 
422
        }).done(function(response) {
-
 
423
 
-
 
424
            if (response['success']) {
-
 
Línea -... Línea 363...
-
 
363
    });
-
 
364
 
-
 
365
    $('body').on('click', 'i.btn-add-job-description', function(e) {
-
 
366
        e.preventDefault();
-
 
367
 
Línea 425... Línea 368...
425
 
368
 
Línea -... Línea 369...
-
 
369
        var link = $(this).data('link');
-
 
370
        $.fn.defaultValuesAdd(link);
-
 
371
       
-
 
372
        return false
-
 
373
    });
-
 
374
 
-
 
375
    $.fn.defaultValuesAdd = function(action) {
-
 
376
 
-
 
377
 
-
 
378
        setTimeout(() => {
-
 
379
            NProgress.start();
-
 
380
            $.ajax({
-
 
381
                'dataType': 'json',
-
 
382
                'accept': 'application/json',
-
 
383
                'method': 'get',
-
 
384
                'url' : action,
-
 
385
            }).done(function(response) {
-
 
386
    
-
 
387
                if (response['success']) {
-
 
388
    
426
 
389
    
427
                behaviors = response['data']['behaviors'];
390
                    behaviors = response['data']['behaviors'];
428
                competency_types = response['data']['competency_types'];
391
                    competency_types = response['data']['competency_types'];
-
 
392
                    competencies = response['data']['competencies'];
429
                competencies = response['data']['competencies'];
393
    
430
 
-
 
431
 
394
    
432
                competencies_selected = [];
395
                    competencies_selected = [];
433
 
396
    
434
 
397
    
435
                $.each(competencies, function(i, competency) {
398
                    $.each(competencies, function(i, competency) {
436
                    $.each(competency.behaviors, function(j, behavior) {
399
                        $.each(competency.behaviors, function(j, behavior) {
437
                        competencies[i].behaviors[j].level = 0;
400
                            competencies[i].behaviors[j].level = 0;
438
                    });
401
                        });
439
                });
402
                    });
440
 
403
    
441
                $.fn.renderCompetencies();
404
                    $.fn.renderCompetencies();
442
                $.fn.comboCompetencies();
405
                    $.fn.comboCompetencies();
443
 
406
    
444
                $('span[id="form-title"]').html('LABEL_ADD');
407
                    $('span[id="form-title"]').html('LABEL_ADD');
445
                $('#form').attr('action', link);
408
                    $('#form').attr('action', action);
446
                $('#form #name').val('');
409
                    $('#form #name').val('');
447
                $('#form #status').bootstrapToggle('on');
410
                    $('#form #status').bootstrapToggle('on');
448
                    
411
                        
-
 
412
                    $('#form #functions').val('');
-
 
413
                    $('#form #objectives').val('');
-
 
414
    
-
 
415
                    validator.resetForm();
-
 
416
    
-
 
417
    
-
 
418
                    $('#custom-tabs #custom-tabs-general-tab').tab('show');
-
 
419
                    $('#row-lists').hide();
-
 
420
                    $('#row-form').show();
-
 
421
    
-
 
422
               } else   {                      
Línea 449... Línea -...
449
                $('#form #functions').val('');
-
 
450
                $('#form #objectives').val('');
-
 
451
 
-
 
452
                validator.resetForm();
-
 
453
 
-
 
454
 
-
 
455
                $('#custom-tabs #custom-tabs-general-tab').tab('show');
-
 
456
                $('#row-lists').hide();
-
 
457
                $('#row-form').show();
-
 
458
 
-
 
459
           } else   {                      
423
                    $.fn.showError(response['data']);
Línea 460... Línea 424...
460
                $.fn.showError(response['data']);
424
                }
461
            }
425
    
Línea 888... Línea 852...
888
</section>
852
</section>
Línea 889... Línea 853...
889
 
853
 
890
 
854
 
891
<!--start modal behavior-->
855
<!--start modal behavior-->
892
<div id="modal-behavior" class="modal" tabindex="-1" role="dialog">
856
<div id="modal-behavior" class="modal" tabindex="-1" role="dialog">
893
    <div class="modal-dialog modal-lg" role="document">
857
	<form action="#" name="form-behavior" id="form-behavior">
894
        <form action="#" name="form-behavior" id="form-behavior">
858
        <div class="modal-dialog " role="document">
895
            <input type="hidden" id="behavior-uuid" name="behavior-uuid" value="" />
859
    		<input type="hidden" id="behavior-uuid" name="behavior-uuid" value="" />
896
            <input type="hidden" id="competency-uuid" name="competency-uuid value="" />
860
       		<input type="hidden" id="competency-uuid" name="competency-uuid value="" />
897
         <div class=" modal-content">
861
       		<div class=" modal-content">
898
            <div class="modal-header">
862
                <div class="modal-header">
899
                <h4 class="modal-title">LABEL_EDIT LABEL_LEVEL</h4>
863
                    <h4 class="modal-title">LABEL_EDIT LABEL_LEVEL</h4>
900
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
864
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
901
                    <span aria-hidden="true">&times;</span>
865
                        <span aria-hidden="true">&times;</span>
902
                </button>
866
                    </button>
903
            </div>
867
                </div>
904
            <div class="modal-body">
868
                <div class="modal-body">
905
               <div class="form-group">
869
                       <div class="form-group">
906
                  <label for="behavior-value">LABEL_LEVEL</label>
870
                          <label for="behavior-value">LABEL_LEVEL</label>
907
                  <input type="number" step="1" min="0" max="100" id="level" name="level">
871
                          <input type="number" step="1" min="0" max="100" id="level" name="level">
908
            </div>
872
                    </div>
909
            <div class="modal-footer">
873
                    <div class="modal-footer">
-
 
874
                        <button type="button" class="btn btn-primary btn-behavior-submit">LABEL_SAVE</button>
910
                <button type="button" class="btn btn-primary btn-behavior-submit">LABEL_SAVE</button>
875
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
911
                <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
876
                    </div>
912
            </div>
877
            	</div>
913
    </div>
878
        	</div>
914
    </form>
879
    	</div>
Línea 915... Línea 880...
915
</div>
880
	</form>
Línea 1031... Línea 996...
1031
   </div>
996
   </div>
1032
</div>
997
</div>
1033
</script>
998
</script>
Línea 1034... Línea 999...
1034
 
999
 
1035
<script id="listJobDescriptionTemplate" type="text/x-jsrender">
1000
<script id="listJobDescriptionTemplate" type="text/x-jsrender">
1036
	<li data-id="{{:uuid}}">
1001
	<li data-id="{{:uuid}}" {{if status == '<?php echo JobDescription::STATUS_INACTIVE ?>' }} class="inactive" {{/if}}>
1037
        {{>name}}
1002
        {{>name}} 
-
 
1003
        <div class="float-right">
1038
        <div class="float-right">
1004
            {{if status == '<?php echo JobDescription::STATUS_ACTIVE ?>' }} 
1039
            {{if link_add }}
1005
            {{if link_add }}
1040
            <i class="fa fa-plus btn-add-job-description" data-link="{{:link_add}}"></i>&nbsp;
1006
            <i class="fa fa-plus btn-add-job-description" data-link="{{:link_add}}"></i>&nbsp;
-
 
1007
            {{/if}}
1041
            {{/if}}
1008
            {{/if}}
1042
            {{if link_edit }}
1009
            {{if link_edit }}
1043
            <i class="fa fa-pencil btn-edit-job-description" data-link="{{:link_edit}}"></i>&nbsp;
1010
            <i class="fa fa-pencil btn-edit-job-description" data-link="{{:link_edit}}"></i>&nbsp;
1044
            {{/if}}
1011
            {{/if}}
1045
            {{if link_delete }}
1012
            {{if link_delete }}
1046
            <i class="fa fa-trash btn-delete-job-description" data-link="{{:link_delete}}"></i>&nbsp;
1013
            <i class="fa fa-trash btn-delete-job-description" data-link="{{:link_delete}}"></i>&nbsp;
-
 
1014
            {{/if}}
1047
            {{/if}}
1015
            {{if status == '<?php echo JobDescription::STATUS_ACTIVE ?>' }} 
1048
            {{if link_report }}
1016
            {{if link_report }}
1049
            <i class="fa fa-file-o btn-pdf-job-description" data-link="{{:link_report}}"></i>&nbsp;
1017
            <i class="fa fa-file-o btn-pdf-job-description" data-link="{{:link_report}}"></i>&nbsp;
-
 
1018
            {{/if}}
1050
            {{/if}}
1019
            {{/if}}
1051
        </div>
1020
        </div>
1052
        <ol>	
1021
        <ol>	
1053
	   {{for children tmpl="#listJobDescriptionTemplate"/}}
1022
	   {{for children tmpl="#listJobDescriptionTemplate"/}}
1054
	   </ol> 
1023
	   </ol>