Changeset 5901


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

Ticket #2602 - Inconsistencia com importacao de eventos no expressoCalendar

Location:
trunk/prototype/modules/calendar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/css/layout.css

    r5879 r5901  
    390390    font-size: 0.9em; 
    391391} 
     392 
     393.import-export-win .button.remove-attachment {margin: -2px 0 0px 10px;} 
     394 
    392395.import-export-win form { padding: 10px; } 
    393396.import-export-win p.input-group * { float:left; } 
     
    461464    overflow-x: hidden !important; 
    462465    overflow-y: auto !important;  
     466    height: 210px; 
    463467} 
    464468 
    465469.user-acls-shared-calendar{ 
    466         width: 130px; 
    467         float: right; 
    468         margin-right: 2px; 
     470    width: 130px; 
     471    float: right; 
     472    position: absolute; 
     473    left: 190px; 
     474    background: white; 
    469475} 
    470476 
  • trunk/prototype/modules/calendar/js/calendar.codecs.js

    r5835 r5901  
    267267Calendar.load(); 
    268268 
    269 /* Todo será implementado funcionalidades ajax no calback de importacao de eventos */ 
    270 isValidCalback = false; 
    271  
    272269/*Todo Melhorias serão feitas na API*/ 
    273270//DataLayer.poll( "schedulable" ); 
     
    285282                }); 
    286283    } 
    287 }); 
    288  
    289 DataLayer.listen( "calendarToSchedulable", function( status, updateData){ 
    290    
    291     if( status === 'client' ){ 
    292                 if(updateData && isValidCalback){ 
    293                         isValidCalback = false; 
    294                         $.Zebra_Dialog('Evento(s) importados com sucesso!', { 
    295                                 'overlay_opacity': '0.5', 
    296                                 'onClose':  function(clicked) {                          
    297                                         Calendar.rerenderView(); 
    298                                 } 
    299                         }); 
    300                 }else if(updateData == false){ 
    301                         $.Zebra_Dialog('Erro ao importar evento(s)!', { 
    302                                 'overlay_opacity': '0.5'         
    303                         }); 
    304                 } 
    305     };   
    306284}); 
    307285 
  • 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 
  • trunk/prototype/modules/calendar/templates/import_export.ejs

    r5409 r5901  
    1818                <p class="input-group"> 
    1919                        <label for="data">Arquivo:</label> 
     20                                                <span class="hidden file-add"></span> 
    2021                        <input type="file" name="data" value=""/> 
    2122                        <span class="tip">Escolha o arquivo que contenha um ou vários eventos. A Agenda do Expresso pode importar informações de evento no formato iCal.</span> 
Note: See TracChangeset for help on using the changeset viewer.