Changeset 5384


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

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

Location:
trunk/prototype
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/config/modulePreference.ini

    r5341 r5384  
    1111encodeURImodulePreference = modules/calendar/interceptors/DBMapping.php 
    1212encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 
     13 
     14[before.delete] 
     15encodeURImodulePreference = modules/calendar/interceptors/DBMapping.php 
    1316 
    1417[before.find] 
  • 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, 
  • trunk/prototype/modules/calendar/js/helpers.js

    r5381 r5384  
    597597                                         
    598598                                         
    599                                         var isExternal = (user) ? user.isExternal : 1; 
     599                                        var isExternal = (!!user && !!user.isExternal) ? 0 : 1; 
    600600 
    601601                                        /** 
     
    610610                                        if (user){ 
    611611                                                if (!skipAddNewLine) { 
    612                                                         user[0].id =  DataLayer.put('participant', {user: user[0].id, isExternal: 1}); 
     612                                                        user[0].id =  DataLayer.put('participant', {user: user[0].id, isExternal: isExternal}); 
    613613                                                        blkAddAtendee.find('dd.attendee-list ul.attendee-list').append( 
    614614                                                                DataLayer.render('templates/participants_add_itemlist.ejs', user) 
     
    10771077                                } 
    10781078                                DataLayer.remove('calendarSignature', signature); 
     1079                                if(idCalendar == User.preferences.defaultCalendar) 
     1080                                        DataLayer.remove( 'modulePreference', User.preferenceIds['defaultCalendar']); 
    10791081                                $('.positionHelper').css('display', 'none'); 
    10801082                        }else{ 
     
    11761178                                        user: User.me.id, 
    11771179                                        calendar: { 
    1178                                                 name: $('.qtip-active input').val(), 
     1180                                                name: Encoder.htmlEncode($('.qtip-active input').val()), 
    11791181                                                timezone: User.preferences.timezone                              
    11801182                                        }, 
     
    12391241                        } 
    12401242                         
    1241                         if(Calendar.currentView){ 
     1243                         if(Calendar.currentView){ 
    12421244                                var checkBox = $(this); 
    1243                                 Calendar.currentView[ checkBox.val() ].hidden = !checkBox.is(':checked'); 
    1244                                 $('#calendar').fullCalendar( 'refetchEvents' ); 
    1245                         }                
     1245                if(!!Calendar.currentView[ checkBox.val() ]){ 
     1246                                        Calendar.currentView[ checkBox.val() ].hidden = !checkBox.is(':checked'); 
     1247                                        $('#calendar').fullCalendar( 'refetchEvents' ); 
     1248                                } 
     1249                        } 
    12461250            }); 
    12471251      }); 
     
    15261530                        $('.import-event-form', UI.dialogs.importCalendar).submit();                     
    15271531                        UI.dialogs.importCalendar.dialog("close"); 
     1532                        isValidCalback = true; 
    15281533                        /** 
    15291534                         * TODO - implementar ação de importação 
Note: See TracChangeset for help on using the changeset viewer.