Index: branches/2.5/prototype/modules/calendar/js/activity.helpers.js
===================================================================
--- branches/2.5/prototype/modules/calendar/js/activity.helpers.js	(revision 7977)
+++ branches/2.5/prototype/modules/calendar/js/activity.helpers.js	(revision 8232)
@@ -222,9 +222,53 @@
     }
     */
-	UI.dialogs.addActivity.find('select[name="activityStatus"], input[name="allDay"]').removeAttr('disabled');
-    canDiscardActivityDialog = true;
-	
-	UI.dialogs.addActivity.children().find('form.form-addactivity').submit();
-	UI.dialogs.addActivity.dialog("close");
+	//Código o qual será chamado para o salvamento da Atividade. 
+	var handler_save = function (objsToSave){ 
+		UI.dialogs.addActivity.find('select[name="activityStatus"], input[name="allDay"]').removeAttr('disabled'); 
+		canDiscardActivityDialog = true; 
+
+		var activity_tst = DataLayer.form( UI.dialogs.addActivity.children().find('form') ); 
+		if(objsToSave) 
+			objsToSave[objsToSave.length] = activity_tst; 
+		
+		else  
+			objsToSave = activity_tst; 
+		DataLayer.put('schedulable', objsToSave); 
+		 
+		UI.dialogs.addActivity.dialog("close"); 
+	} 
+
+	//Verifica se o grupo da atividade mudou 
+	if (group.id != UI.dialogs.addActivity.children().find('form select[name="group"] :selected').val() && typeof group.id != 'undefined') { 
+		//Janela de dialogo 
+		$.Zebra_Dialog('Você alterou o grupo da atividade, deseja alterar também o grupo das tarefas pertencentes à essa atividade?', { 
+			'type':     'question', 
+			'overlay_opacity': '0.5', 
+			'modal': true, 
+			'buttons':  ['Não Alterar', 'Alterar'], 
+			'onClose':  function(clicked) { 
+				if(clicked == 'Não Alterar') { 
+				   
+					handler_save(); 
+				}else{ 
+					var objsToSave = []; 
+					//percorre as tarefas da atividade para verificar se o grupo mudou 
+					for(var t in objActivity.tasks){ 
+						if(typeof objActivity.tasks[t].group != 'undefined') 
+							if (objActivity.tasks[t].group != UI.dialogs.addActivity.children().find('form select[name="group"] :selected').val()){ 
+								objActivity.tasks[t].group = UI.dialogs.addActivity.children().find('form select[name="group"] :selected').val(); 
+								objsToSave[objsToSave.length] = {'calendar' : objActivity.tasks[t].group, 'id': t}; 
+							} 
+					} 
+					handler_save(objsToSave); 
+					 
+				} 
+				 
+			} 
+		}); 
+						 
+	 
+	} else { 
+		handler_save(); 
+	}
 
 }).end()
@@ -259,5 +303,5 @@
                     ['=', 'type', '2'], 
                     ['>=','startTime', $.now()], 
-                    ['in', 'calendar', [$('div.new-activity-win.active select[name="groupFilter"]').val()]] 
+                    ['in', 'calendar', [$('div.new-activity-win.active select[name="groupFilter"]').val()]]
                 ], criteria: {filterTasks: true, deepness: 2}
         };
@@ -410,9 +454,9 @@
     updateActivity = false;
 
-    var idTask = UI.dialogs.addActivity.find('input[name="idActivity"]').val(); 
- 
-    getSchedulable( idTask ); 
- 
-    var objActivity = DataLayer.get('schedulable:activity', idTask ); 
+    var idTask = UI.dialogs.addActivity.find('input[name="idActivity"]').val();
+
+    getSchedulable( idTask );
+
+    var objActivity = DataLayer.get('schedulable:activity', idTask );
     var blkAddTask = UI.dialogs.addActivity.find('#group_addactivity_details8');
     var blkAuto = UI.dialogs.addActivity.find('#group_addactivity_details1');
@@ -673,9 +717,9 @@
             text: false
         }).click(function () {
- 
-            var idTask = $(this).parents('li').find('input[name="idtask[]"]').val() 
-            getSchedulable(idTask); 
-            var task = DataLayer.get('schedulable:task', idTask); 
-            taskDetails(task, true, '',true, null, true); 
+
+            var idTask = $(this).parents('li').find('input[name="idtask[]"]').val()
+            getSchedulable(idTask);
+            var task = DataLayer.get('schedulable:task', idTask);
+            taskDetails(task, true, '',true, null, true);
         })
         .addClass('tiny disable ui-button-disabled ui-state-disabled')
