Changeset 5384
- Timestamp:
- 01/17/12 14:07:38 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/config/modulePreference.ini
r5341 r5384 11 11 encodeURImodulePreference = modules/calendar/interceptors/DBMapping.php 12 12 encodeCreateConcept = modules/calendar/interceptors/DBMapping.php 13 14 [before.delete] 15 encodeURImodulePreference = modules/calendar/interceptors/DBMapping.php 13 16 14 17 [before.find] -
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, -
trunk/prototype/modules/calendar/js/helpers.js
r5381 r5384 597 597 598 598 599 var isExternal = ( user) ? user.isExternal: 1;599 var isExternal = (!!user && !!user.isExternal) ? 0 : 1; 600 600 601 601 /** … … 610 610 if (user){ 611 611 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}); 613 613 blkAddAtendee.find('dd.attendee-list ul.attendee-list').append( 614 614 DataLayer.render('templates/participants_add_itemlist.ejs', user) … … 1077 1077 } 1078 1078 DataLayer.remove('calendarSignature', signature); 1079 if(idCalendar == User.preferences.defaultCalendar) 1080 DataLayer.remove( 'modulePreference', User.preferenceIds['defaultCalendar']); 1079 1081 $('.positionHelper').css('display', 'none'); 1080 1082 }else{ … … 1176 1178 user: User.me.id, 1177 1179 calendar: { 1178 name: $('.qtip-active input').val(),1180 name: Encoder.htmlEncode($('.qtip-active input').val()), 1179 1181 timezone: User.preferences.timezone 1180 1182 }, … … 1239 1241 } 1240 1242 1241 if(Calendar.currentView){1243 if(Calendar.currentView){ 1242 1244 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 } 1246 1250 }); 1247 1251 }); … … 1526 1530 $('.import-event-form', UI.dialogs.importCalendar).submit(); 1527 1531 UI.dialogs.importCalendar.dialog("close"); 1532 isValidCalback = true; 1528 1533 /** 1529 1534 * TODO - implementar ação de importação
Note: See TracChangeset
for help on using the changeset viewer.