Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 16776 Rev 16777
Línea 202... Línea 202...
202
 
202
 
Línea 203... Línea 203...
203
    },
203
    },
204
 
204
 
205
    $.fn.recursiveTree = function(items) {
-
 
206
        var s  = '';     
205
    $.fn.recursiveTree = function(items) {
207
 
-
 
208
        $.each(items, function(i, item) {
206
        var s  = '';     
Línea 209... Línea 207...
209
 
207
        $.each(items, function(i, item) {
210
            s = s + $('#listJobDescriptionTemplate').render(item);
-
 
211
 
-
 
212
        });
208
            s = s + $('#listJobDescriptionTemplate').render(item);
213
 
209
 
Línea 214... Línea -...
214
 
-
 
215
        return s;
-
 
216
    };
210
        });
217
 
211
        return s;
218
    
212
    };
219
 
213
 
220
    $.fn.refreshTree = function() {
214
    $.fn.refreshTree = function() {
221
        NProgress.start();
215
        NProgress.start();
222
        $.ajax({
216
        $.ajax({
223
            'dataType': 'json',
217
            'dataType': 'json',
224
            'accept': 'application/json',
218
            'accept': 'application/json',
-
 
219
            'method': 'get',
-
 
220
            'url': '$routeDatatable',
-
 
221
        }).done(function(response) {
-
 
222
            if (response['success']) {
Línea 225... Línea 223...
225
            'method': 'get',
223
                if(response['data'].items.length == 0) {
Línea -... Línea 224...
-
 
224
                    $('#divNoRecordsAvailable').show();
226
            'url': '$routeDatatable',
225
                } else {
227
        }).done(function(response) {
226
                    $('#divNoRecordsAvailable').hide();
228
            if (response['success']) {
227
 
229
 
228
                }
230
                var s = ''; 
229
 
231
 
-
 
232
                $.each(response['data'], function(i, item) {
230
                var s = ''; 
233
                    s = s +  $.fn.recursiveTree(item);
231
                $.each(response['data'], function(i, item) {
234
                });
232
                    s = s +  $.fn.recursiveTree(item);
235
 
233
                });
236
                $.fn.setGroupSortable(s);
234
    
237
 
235
                $.fn.setGroupSortable(s);
238
            } else {
236
            } else {
239
                $.fn.showError(response['data']);
237
                $.fn.showError(response['data']);
240
            }
-
 
241
        }).fail(function(jqXHR, textStatus, errorThrown) {
238
            }
Línea 242... Línea -...
242
            $.fn.showError(textStatus);
-
 
243
         }).always(function() {
-
 
244
            NProgress.done();
239
        }).fail(function(jqXHR, textStatus, errorThrown) {
245
        });
240
            $.fn.showError(textStatus);
246
 
241
         }).always(function() {
247
    }
242
            NProgress.done();
248
 
243
        });
Línea 578... Línea 573...
578
        }
573
        }
579
    });
574
    });
Línea 580... Línea 575...
580
 
575
 
581
    $('body').on('click', 'i.btn-delete-job-description', function(e) {
576
    $('body').on('click', 'i.btn-delete-job-description', function(e) {
582
        e.preventDefault();
577
        e.preventDefault();
-
 
578
        var action = $(this).data('link');
-
 
579
 
-
 
580
        bootbox.confirm({
-
 
581
            message: 'LABEL_ARE_YOU_SURE',
-
 
582
            buttons: {
-
 
583
                confirm: {
-
 
584
                    label: 'LABEL_YES',
-
 
585
                    className: 'btn-success'
-
 
586
                },
-
 
587
                cancel: {
-
 
588
                    label: 'LABEL_NO',
-
 
589
                    className: 'btn-danger'
-
 
590
                }
-
 
591
            },
-
 
592
            callback: function (result) {
583
        action = $(this).data('link');
593
                if(result) {
584
        NProgress.start();
594
                    NProgress.start();
585
        $.ajax({
595
                    $.ajax({
586
            'dataType': 'json',
596
                        'dataType': 'json',
587
            'accept': 'application/json',
597
                        'accept': 'application/json',
588
            'method': 'post',
598
                        'method': 'post',
589
            'url': action,
599
                        'url': action,
590
        }).done(function(response) {
600
                    }).done(function(response) {
591
            if (response['success']) {
601
                        if (response['success']) {
592
                $.fn.showSuccess(response['data']);
602
                            $.fn.showSuccess(response['data']);
593
               $.fn.refreshTree();
603
                           $.fn.refreshTree();
594
            } else {
604
                        } else {
-
 
605
                            $.fn.showError(response['data']);
-
 
606
                        }
-
 
607
                    }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
608
                        $.fn.showError(textStatus);
-
 
609
                    }).always(function() {
-
 
610
                        NProgress.done();
-
 
611
                    });
595
                $.fn.showError(response['data']);
612
                }
596
            }
-
 
597
        }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
598
            $.fn.showError(textStatus);
-
 
599
        }).always(function() {
-
 
600
            NProgress.done();
613
            }
-
 
614
        });
-
 
615
 
-
 
616
       
601
        });
617
 
Línea 602... Línea 618...
602
    });
618
    });
603
 
619
 
Línea 729... Línea 745...
729
        <div class="row">
745
        <div class="row">
730
            <div class="col-12">
746
            <div class="col-12">
731
                <div class="card">
747
                <div class="card">
732
                    <div class="card-body">
748
                    <div class="card-body">
Línea -... Línea 749...
-
 
749
 
-
 
750
                   	  <div id="divNoRecordsAvailable" class="text-center" style="display: none"><h3>LABEL_NO_RECORDS_AVAILABLE</h3></div>
Línea 733... Línea 751...
733
 
751
                        
Línea 734... Línea 752...
734
                        
752
                        
Línea 735... Línea 753...
735
                       <ol id="ol-jobs-descriptions" class="default vertical">
753
                       <ol id="ol-jobs-descriptions" class="default vertical" style="padding-left: 0px;">
736
 
754