Changeset 5384 for trunk/prototype/modules/calendar/js/calendar.codecs.js
- Timestamp:
- 01/17/12 14:07:38 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/js/calendar.codecs.js
r5381 r5384 111 111 this.signatureOf[ this.calendarIds[i] = ( this.calendars[ this.calendars.length ] = this.signatures[i].calendar ).id ] = this.signatures[i]; 112 112 } 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 113 127 delete Calendar.currentViewKey; 114 128 } … … 175 189 Calendar.load(); 176 190 191 /* Todo será implementado funcionalidades ajax no calback de importacao de eventos */ 192 isValidCalback = false; 193 194 177 195 //DataLayer.poll( "schedulable" ); 178 196 … … 180 198 181 199 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(); 191 202 //Atualiza a listagem de eventos apenas se estiver na aba de listagem 192 203 if($tabs.tabs('option' ,'selected') == 1) 193 204 pageselectCallback("", 0); 194 205 }); 195 } 206 } 207 }); 208 209 DataLayer.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 }; 196 227 }); 197 228 … … 668 699 calendars: Calendar.calendars, 669 700 calendar: objEvent.calendar, 670 summary: objEvent.summary,701 summary: Encoder.htmlEncode(objEvent.summary), 671 702 description: objEvent.description, 672 703 timezone: objEvent.timezone,
Note: See TracChangeset
for help on using the changeset viewer.