Index: trunk/prototype/modules/calendar/js/init.js
===================================================================
--- trunk/prototype/modules/calendar/js/init.js	(revision 5592)
+++ trunk/prototype/modules/calendar/js/init.js	(revision 5746)
@@ -231,29 +231,92 @@
 		},
 
-		eventDrop: function( event ){
-			if(!event.disableDragging){
-				DataLayer.put( "schedulable:calendar", event );
+		eventDrop: function( evt, event, view  ){
+			evt.id = evt.id.split('-')[0];
+                        if(!evt.disableDragging){
+                            
+                             if(evt.isRepeat){
+                                 var schedulable = copyAndMoveTo(false , evt.id , false, "3", evt);
+                                 
+                                 var repeat = mount_exception(evt.id, evt.occurrence);
+                                 DataLayer.remove('repeat', false);
+                                 DataLayer.put('repeat', repeat);
+                                 DataLayer.commit('repeat', false, function(data){
+                                     
+                                    DataLayer.put('schedulable', schedulable);
+                                     
+                                 });
+
+                             }else{                                 
+                                DataLayer.put( "schedulable:calendar", evt );
 
 				event.editable = false;
 				event.className = "blocked-event";
-				calendar.fullCalendar( 'updateEvent', event );
+				calendar.fullCalendar( 'updateEvent', evt );
+                             }
+                             
+			}else
+                            Calendar.rerenderView(true);
+		},
+
+		eventResize: function( evt, event, view ){
+                        evt.id = evt.id.split('-')[0];
+			if(!evt.disableDragging){
+                             if(evt.isRepeat){
+                                 var schedulable = copyAndMoveTo(false , evt.id , false, "3", evt);
+                                 
+                                 //Normaliza a data para o backend
+                                 schedulable.startTime = new Date(parseInt(schedulable.startTime)).toString('yyyy-MM-dd hh:mm:00');
+                                 schedulable.endTime = new Date(parseInt(schedulable.endTime)).toString('yyyy-MM-dd hh:mm:00');
+                                 
+                                 var repeat = mount_exception(evt.id, evt.occurrence);
+                                 
+                                 DataLayer.remove('repeat', false);
+                                 DataLayer.put('repeat', repeat);
+                                 DataLayer.commit('repeat', false, function(data){
+                                     
+                                    DataLayer.put('schedulable', schedulable);
+                                     
+                                 });
+                             }else{                                 
+                                DataLayer.put( "schedulable:calendar", evt );   
+                                evt.editable = false;
+                                evt.className = "blocked-event";
+                                calendar.fullCalendar( 'updateEvent', evt );
+                             }
+                        
 			}else
 				Calendar.rerenderView(true);
 		},
 
-		eventResize: function( event ){
-			if(!event.disableDragging){
-			DataLayer.put( "schedulable:calendar", event );
-
-			event.editable = false;
-			event.className = "blocked-event";
-			calendar.fullCalendar( 'updateEvent', event );
-			}else
-				Calendar.rerenderView(true);
-		},
-
 		eventClick: function( evt, event, view ){
-			if(evt.selectable)
-				eventDetails( DataLayer.get( "schedulable", evt.id), true);
+			evt.id = evt.id.split('-')[0];
+                        if(evt.selectable){
+                            if(evt.isRepeat){
+                                $.Zebra_Dialog(evt.title + ' é um evento com repetição.', {
+                                        'type':     'question',
+                                        'overlay_opacity': '0.5',
+                                        'buttons':  ['Editar todas ocorrências', 'Editar essa ocorrência'],
+                                        'onClose':  function(clicked) {
+                                                if(clicked == 'Editar todas ocorrências') {
+                                                    eventDetails( DataLayer.get( "schedulable", evt.id), true);
+                                                }else{
+                                                    /*
+                                                    * TODO - repeat foi adicionado pois melhorias devem ser feitas no rollback do
+                                                    *DataLayer, repeat somente é usado quando se trata da criação de um evento
+                                                    *pela edição de uma ocorrência.
+                                                    */      
+                                                    var repeat = mount_exception(evt.id, evt.occurrence);
+                                                                                                  
+                                                    $('.calendar-copy-move input[name="typeEvent"]').val("3");
+                                                    
+                                                    eventDetails(copyAndMoveTo(false , evt.id , false, "3", evt), true, '', false, repeat);
+                                                }       
+                                        }
+                                });
+                                
+                            }else
+                                eventDetails( DataLayer.get( "schedulable", evt.id), true);
+                                
+                        }
 		}
 	}, dateCalendar));
