Ignore:
Timestamp:
05/28/12 21:17:51 (12 years ago)
Author:
acoutinho
Message:

Ticket #2795 - Problema ao tentar aceitar convite da agenda para a conta compartilhada

File:
1 edited

Legend:

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

    r6300 r6331  
    153153        delete DataLayer.tasks[this.clookRefresh]; 
    154154         
    155         this.clookRefresh = (parseInt(($.now()) / 1000) + this.timeRefresh); 
    156          
    157         DataLayer.task( this.clookRefresh , function(){ 
    158             Calendar.rerenderView(true); 
    159         }); 
    160  
     155        //Realiza agendamentos de atualização de view somente se o módulo aberto for expressoCalendar 
     156        if(User.moduleName == "expressoCalendar"){ 
     157            this.clookRefresh = (parseInt(($.now()) / 1000) + this.timeRefresh); 
     158 
     159            DataLayer.task( this.clookRefresh , function(){ 
     160                Calendar.rerenderView(true); 
     161            }); 
     162        } 
    161163    } 
    162164} 
     
    516518        var pref = User.preferences; 
    517519                 
    518         var Owner = decodeOwnerCalendar(evtObj.calendar);        
     520        var Owner = decodeOwnerCalendar(evtObj[0].calendar);     
    519521 
    520522        var res = $.map(evtObj, function( form ){ 
    521523                         
    522             return { 
     524            return DataLayer.merge({ 
    523525                id: form.idEvent, 
    524                 calendar: form.calendar, 
    525526                participants : $.map(form.attendee, function( attendee, i ){ 
    526527                    if(isNaN(attendee)){ 
     
    536537                        if(DataLayer.get('participant', attendee).user == Owner.id){ 
    537538                            var me = { 
    538                                 user: User.id, 
     539                                user: Owner.id, 
    539540                                status: form.status, 
    540541                                id: attendee, 
     
    580581                    }; 
    581582                }) 
    582             } 
     583            }, (Owner.id == User.me.id) ? (form.calendar != form.lastCalendar ? {calendar: form.calendar, lastCalendar: form.lastCalendar} : {}) : {}) 
    583584        }); 
    584585        return notArray ? res[0] : res; 
     
    641642                attachments: $.map(objEvent.attachments || [], function( attachment, i ){ 
    642643                    var attach = DataLayer.get('schedulableToAttachment', attachment, false); 
    643                     //TODO - Verificar na API retorno de id sobre os conceitos em que são utilizados tabelas de ligação 
     644                    //TODO - Verificar na API retorno de id sobre os conceitos em que s?o utilizados tabelas de liga??o 
    644645                    if(!attach.name) return(null);  
    645646                     
     
    838839            var Owner = decodeOwnerCalendar(form.calendar); 
    839840 
    840             return { 
     841            return DataLayer.merge({ 
    841842                "class": form["class"], 
    842843                startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd HH:mm:00'), 
     
    846847                location: form.location, 
    847848                category: form.category, 
    848                 calendar: form.calendar, 
    849849                summary: form.summary, 
    850850                description: form.description, 
     
    901901                    }; 
    902902                }) 
    903             }; 
     903            }, form.lastCalendar ? (( form.lastCalendar == form.calendar ) ? {} : {calendar: form.calendar, lastCalendar: form.lastCalendar}) : {calendar: form.calendar}); 
    904904        }); 
    905905 
Note: See TracChangeset for help on using the changeset viewer.