Ignore:
Timestamp:
04/09/12 17:55:40 (12 years ago)
Author:
acoutinho
Message:

Ticket #2602 - Inconsistencia com importacao de eventos no expressoCalendar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/js/helpers.js

    r5863 r5901  
    21612161                tabsImportExport.find('option[value="'+calendarId+'"]').attr('selected','selected').trigger('change'); 
    21622162                 
    2163                  
     2163                var form = false; 
     2164                $('.import-event-form').fileupload({ 
     2165                sequentialUploads: true, 
     2166                        add: function (e, data) { 
     2167                                form = data 
     2168                                var name = form.files[0].name; 
     2169                                $('.import-event-form').find('input[type="file"]').hide(); 
     2170                                $('.import-event-form').find('span.file-add').removeClass('hidden'); 
     2171                                $('.import-event-form').find('span.file-add').append('<span>'+ name +'</span><a class="button remove-attachment tiny"></a>'); 
     2172                                $('.import-event-form').find('.button.remove-attachment').button({ 
     2173                                        icons: { 
     2174                                                primary: "ui-icon-close" 
     2175                                        }, 
     2176                                        text: false 
     2177                                }).click(function (event){ 
     2178                                        $('.import-event-form').find('input[type="file"]').show(); 
     2179                                        $('.import-event-form').find('span.file-add').addClass('hidden').html(''); 
     2180                                        form = false; 
     2181                                }); 
     2182                                 
     2183                                 
     2184                        }, 
     2185                        done: function(e, data){ 
     2186                                var msg = ''; 
     2187                                var type = ''; 
     2188 
     2189                                if(!!data.result && data.result == "[][[]]"){ 
     2190                                        msg = 'Não foram encontrados novos eventos na importação!'; 
     2191                                        type = 'information'; 
     2192                                }else if(!!data.result && data.result == '[][false]'){ 
     2193                                        msg = 'Erro ao realizar a importação, por favor verifique o arquivo .ics'; 
     2194                                        type = 'warning'; 
     2195                                }else{ 
     2196                                        msg = 'Importação realizada com sucesso!'; 
     2197                                        type = 'confirmation'; 
     2198                                        Calendar.rerenderView(true); 
     2199                                } 
     2200 
     2201                                $.Zebra_Dialog(msg, { 
     2202                                        'type':     type, 
     2203                                        'overlay_opacity': '0.5', 
     2204                                        'buttons':  ['Fechar'] 
     2205                                }); 
     2206                        } 
     2207                }); 
     2208 
    21642209        UI.dialogs.importCalendar.find(".menu-import-event")         
    21652210            .children(".import").click(function(data){ 
     
    21682213                            Calendar.signatureOf[$('.import-event-form option:selected').val()].calendar.timezone 
    21692214                            +'"/>') 
    2170  
    2171                         $('.import-event-form', UI.dialogs.importCalendar).submit();                     
     2215                        if(form) 
     2216                                form.submit();                   
    21722217                        UI.dialogs.importCalendar.dialog("close"); 
    2173                         isValidCalback = true; 
    21742218                        /** 
    21752219                         * TODO - implementar ação de importação 
Note: See TracChangeset for help on using the changeset viewer.