Ignore:
Timestamp:
01/17/12 14:07:38 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Melhorias e correcoes de bugs na nova agenda

File:
1 edited

Legend:

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

    r5381 r5384  
    111111              this.signatureOf[ this.calendarIds[i] = ( this.calendars[ this.calendars.length ] = this.signatures[i].calendar ).id ] = this.signatures[i]; 
    112112          } 
     113          this.rerenderView = function(){ 
     114                delete Calendar.currentViewKey; 
     115                $('#calendar').fullCalendar( 'refetchEvents' ); 
     116                 
     117                var calendarNotSelected = getNotSelectedCalendars(); 
     118                for(var i = 0; i < calendarNotSelected.length; i++) 
     119                        if(!!Calendar.currentView[ calendarNotSelected[i] ]) 
     120                                Calendar.currentView[ calendarNotSelected[i] ].hidden = true; 
     121         
     122                //Necessita ser chamado novamente para atualizar os eventos na tela para o usuário 
     123                //de acordo com as a agendas selecionadas 
     124                $('#calendar').fullCalendar( 'refetchEvents' );  
     125          }; 
     126           
    113127          delete Calendar.currentViewKey; 
    114128      } 
     
    175189Calendar.load(); 
    176190 
     191/* Todo será implementado funcionalidades ajax no calback de importacao de eventos */ 
     192isValidCalback = false; 
     193 
     194 
    177195//DataLayer.poll( "schedulable" ); 
    178196 
     
    180198   
    181199    if( status === 'serverclient' ){ 
    182                 DataLayer.commit( false, false, function(){ 
    183                         delete Calendar.currentViewKey; 
    184                         $('#calendar').fullCalendar( 'refetchEvents' ); 
    185                         var calendarNotSelected = getNotSelectedCalendars(); 
    186                         for(var i = 0; i < calendarNotSelected.length; i++) 
    187                                 Calendar.currentView[ calendarNotSelected[i] ].hidden = true; 
    188                         //Necessita ser chamado novamente para atualizar os eventos na tela para o usuário 
    189                         //de acordo com as a agendas selecionadas 
    190                         $('#calendar').fullCalendar( 'refetchEvents' ); 
     200                DataLayer.commit( false, false, function(){      
     201                        Calendar.rerenderView(); 
    191202                        //Atualiza a listagem de eventos apenas se estiver na aba de listagem 
    192203                        if($tabs.tabs('option' ,'selected') == 1) 
    193204                                pageselectCallback("", 0); 
    194205                }); 
    195     }    
     206    } 
     207}); 
     208 
     209DataLayer.listen( "calendarToSchedulable", function( status, updateData){ 
     210   
     211    if( status === 'client' ){ 
     212                if(updateData && isValidCalback){ 
     213                        isValidCalback = false; 
     214                        $.Zebra_Dialog('Evento(s) importados com sucesso!', { 
     215                                'overlay_opacity': '0.5', 
     216                                'onClose':  function(clicked) {                          
     217                                        Calendar.rerenderView(); 
     218                                } 
     219                        }); 
     220                        isValidCalback = false; 
     221                }else if(updateData == false){ 
     222                        $.Zebra_Dialog('Erro ao importar evento(s)!', { 
     223                                'overlay_opacity': '0.5'         
     224                        }); 
     225                } 
     226    };   
    196227}); 
    197228 
     
    668699                              calendars: Calendar.calendars, 
    669700                              calendar: objEvent.calendar, 
    670                               summary: objEvent.summary, 
     701                              summary: Encoder.htmlEncode(objEvent.summary), 
    671702                              description: objEvent.description, 
    672703                              timezone: objEvent.timezone, 
Note: See TracChangeset for help on using the changeset viewer.