Index: sandbox/2.4.2-expresso1/prototype/services/iCal.php
===================================================================
--- sandbox/2.4.2-expresso1/prototype/services/iCal.php	(revision 6891)
+++ sandbox/2.4.2-expresso1/prototype/services/iCal.php	(revision 6951)
@@ -184,5 +184,4 @@
                 
                 }
-            
 
             if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0)
@@ -617,7 +616,7 @@
         switch ($method) {
             case 'PUBLISH':
-                //Caso a tarefa nÃ£o exista o mesmo cria um novo evento, se jÃ¡ existir o mesmo referencia o evento com agenda
+                //Caso a tarefa não exista o mesmo cria um novo evento, se já existir o mesmo referencia o evento com agenda
                 if (!$schedulable = self::_getSchedulable($uid))
-                    $interation = self::_makeVEVENT($schedulable, $component, $params);
+                    $interation = self::_makeVTODO($schedulable, $component, $params);
                 else{
                     $links = Controller::read(array('concept' => 'calendarToSchedulable'), array('id'), array('filter' =>
@@ -1291,5 +1290,5 @@
     }
 
-    static private function _makeVEVENT($schedulable, $component, $params) {
+        static private function _makeVEVENT($schedulable, $component, $params) {
 	$interation = array();
 	$eventID = isset($schedulable['id']) ? $schedulable['id'] : mt_rand() . '(Formatter)';
@@ -1312,5 +1311,5 @@
 	    $schedulable['allDay'] = 1;
 	    $schedulable['startTime'] = self::date2timestamp($startTime['value']) - self::_getTzOffset('UTC', $schedulable['timezone'], '@' . self::date2timestamp($startTime['value'])) . '000';
-	} elseif ($tzid && !isset($startTime['value']['tz'])) {/* Caso nÃ£o tenha um tz na data mais exista um parametro TZID deve ser aplicado o timezone do TZID a data */
+	} elseif ($tzid && !isset($startTime['value']['tz'])) {/* Caso não tenha um tz na data mais exista um parametro TZID deve ser aplicado o timezone do TZID a data */
 	    $schedulable['startTime'] = self::date2timestamp($startTime['value']) - self::_getTzOffset('UTC', $tzid, '@' . self::date2timestamp($startTime['value'])) . '000';
 	    $schedulable['allDay'] = 0;
@@ -1392,5 +1391,5 @@
 	$participantsInEvent = array();
 
-	//TODO: Participants com delegated nÃ£o estao sendo levados em conta
+	//TODO: Participants com delegated nao estao sendo levados em conta
 	while ($property = $component->getProperty('attendee', FALSE, TRUE)) {
 	    $participant = array();
@@ -1570,4 +1569,262 @@
 
 	$interation['schedulable://' . $eventID] = $schedulable;
+
+	return $interation;
+    }
+    
+    static private function _makeVTODO($schedulable, $component, $params) {
+	$interation = array();
+	$todoID = isset($schedulable['id']) ? $schedulable['id'] : mt_rand() . '(Formatter)';
+
+	/* Data de Inicio */
+	$startTime = $component->getProperty('dtstart', false, true);
+
+	$tzid = (isset($startTime['params']['TZID']) ? $startTime['params']['TZID'] : $params['X-WR-TIMEZONE']);
+
+	/* Tiem zone do evento */
+	if ($tzid){
+	    $tzid = self::nomalizeTZID($tzid);
+	    $schedulable['timezone'] = $tzid;
+	}else
+	    $schedulable['timezone'] = isset($params['calendar_timezone']) ? $params['calendar_timezone'] : 'America/Sao_Paulo';
+
+	$objTimezone = new DateTimeZone($schedulable['timezone']);
+
+	if (isset($startTime['params']['VALUE']) && $startTime['params']['VALUE'] === 'DATE' && isset($params['calendar_timezone'])) {
+	    $schedulable['allDay'] = 1;
+	    $schedulable['startTime'] = self::date2timestamp($startTime['value']) - self::_getTzOffset('UTC', $schedulable['timezone'], '@' . self::date2timestamp($startTime['value'])) . '000';
+	} elseif ($tzid && !isset($startTime['value']['tz'])) {/* Caso não tenha um tz na data mais exista um parametro TZID deve ser aplicado o timezone do TZID a data */
+	    $schedulable['startTime'] = self::date2timestamp($startTime['value']) - self::_getTzOffset('UTC', $tzid, '@' . self::date2timestamp($startTime['value'])) . '000';
+	    $schedulable['allDay'] = 0;
+	} else {
+	    $schedulable['startTime'] = self::date2timestamp($startTime['value']) . '000';
+	    if (strpos($params['prodid'], 'Outlook') !== false) {
+		//Se o ics veio em utc nÃ£o aplicar horario de verÃ£o
+		$sTime = new DateTime('@' . (int) ($schedulable['startTime'] / 1000), new DateTimeZone('UTC'));
+		$sTime->setTimezone($objTimezone);
+		if ($sTime->format('I')) //Se o ics veio em utc nÃ£o aplicar horario de verÃ£o
+		    $schedulable['startTime'] = $schedulable['startTime'] - 3600000;
+	    }
+	}
+
+	/* Data de Termino */
+	$endTime = $component->getProperty('dtend', false, true);
+
+	$tzid = isset($endTime['params']['TZID']) ? $endTime['params']['TZID'] : $params['X-WR-TIMEZONE'];
+	
+	if($tzid)
+	    $tzid = self::nomalizeTZID($tzid);
+
+	if (isset($endTime['params']['VALUE']) && $endTime['params']['VALUE'] === 'DATE')
+	    $schedulable['endTime'] = self::date2timestamp($endTime['value']) - self::_getTzOffset('UTC', $schedulable['timezone'], '@' . self::date2timestamp($endTime['value'])) . '000';
+	else if ($tzid && !isset($endTime['value']['tz'])) /* Caso nÃ£o tenha um tz na data mais exista um parametro TZID deve ser aplicado o timezone do TZID a data */
+	    $schedulable['endTime'] = self::date2timestamp($endTime['value']) - self::_getTzOffset('UTC', $tzid, '@' . self::date2timestamp($endTime['value'])) . '000';
+	else {
+	    $schedulable['endTime'] = self::date2timestamp($endTime['value']) . '000';
+	    if (strpos($params['prodid'], 'Outlook') !== false) {
+		//Se o ics veio em utc nÃ£o aplicar horario de verÃ£o
+		$eTime = new DateTime('@' . (int) ($schedulable['endTime'] / 1000), new DateTimeZone('UTC'));
+		$eTime->setTimezone($objTimezone);
+		if ($eTime->format('I'))
+		    $schedulable['endTime'] = $schedulable['endTime'] - 3600000;
+	    }
+	}
+
+	$schedulable['type'] = '2'; //type schedulable
+	$schedulable['summary'] = mb_convert_encoding($component->getProperty('summary', false, false), 'ISO-8859-1', 'UTF-8,ISO-8859-1');
+
+	/* Definindo Description */
+	if ($desc = $component->getProperty('description', false, false))
+	    $schedulable['description'] = mb_convert_encoding(str_ireplace(array('\n', '\t'), array("\n", "\t"), $desc), 'ISO-8859-1', 'UTF-8,ISO-8859-1');
+
+	/* Definindo Class */
+	$class = $component->getProperty('class', false, false);
+	if ($class && defined(constant(strtoupper('CLASS_' . $class))))
+	    $schedulable['class'] = constant(strtoupper('CLASS_' . $class));
+	else if (!isset($schedulable['class']))
+	    $schedulable['class'] = CLASS_PRIVATE; // padrão classe private
+
+	$schedulable['calendar'] = $params['calendar'];
+
+	$participantsInTodo = array();
+
+	//TODO: Participants com delegated nao estao sendo levados em conta
+	while ($property = $component->getProperty('attendee', FALSE, TRUE)) {
+	    $participant = array();
+
+	    $mailUser = trim(str_replace('MAILTO:', '', $property['value']));
+
+	    $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ? $tpID : mt_rand() . '2(Formatter)';
+	    $participant['schedulable'] = $eventID;
+
+	    if (isset($params['status']) && $mailUser == Config::me('mail'))
+		$participant['status'] = $params['status'];
+	    else
+		$participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED;
+
+
+	    $participant['isOrganizer'] = '0';
+
+	    /* Verifica se este usuario Ã© um usuario interno do ldap */
+	    $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser))));
+
+	    $user = null;
+	    if ($intUser && count($intUser) > 0) {
+		$participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0;
+		$participant['user'] = $intUser[0]['id'];
+	    } else {
+		$participant['isExternal'] = 1;
+		/* Gera um randon id para o contexto formater */
+		$userID = mt_rand() . '4(Formatter)';
+
+		$user['mail'] = $mailUser;
+		$user['isExternal'] = '1';
+		$user['name'] = ( isset($property['params']['CN']) ) ? $property['params']['CN'] : '';
+		$user['participants'] = array($participantID);
+		$participant['user'] = $userID;
+		$interation['user://' . $userID] = $user;
+	    }
+
+	    $interation['participant://' . $participantID] = $participant;
+	    $schedulable['participants'][] = $participantID;
+	};
+
+	if ($property = $component->getProperty('organizer', FALSE, TRUE)) {
+	    $participant = array();
+	    $mailUser = trim(str_replace('MAILTO:', '', $property['value']));
+
+	    $participantID = mt_rand() . '2(Formatter)';
+
+	    $participant['schedulable'] = $eventID;
+	    $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED;
+	    $participant['isOrganizer'] = '1';
+	    $participant['acl'] = 'rowi';
+
+	    /* Verifica se este usuario Ã© um usuario interno do ldap */
+	    $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser))));
+
+	    $user = null;
+	    if ($intUser && count($intUser) > 0) {
+		$participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0;
+		$participant['user'] = $intUser[0]['id'];
+	    } else {
+		$participant['isExternal'] = 1;
+		/* Gera um randon id para o contexto formater */
+		$userID = mt_rand() . '4(Formatter)';
+
+		$user['mail'] = $mailUser;
+		$user['name'] = ( isset($property['params']['CN']) ) ? $property['params']['CN'] : '';
+		$user['participants'] = array($participantID);
+		$user['isExternal'] = '1';
+		$participant['user'] = $userID;
+		$interation['user://' . $userID] = $user;
+	    }
+
+	    $interation['participant://' . $participantID] = $participant;
+	    $schedulable['participants'][] = $participantID;
+	    } else if (!isset($schedulable['participants']) || !is_array($schedulable['participants']) || count($schedulable['participants']) < 1) {//caso nÃ£o tenha organizador o usuario se torna organizador
+	    $user = Controller::read(array('concept' => 'user', 'id' => $params['owner']), array('mail'));
+
+	    if (!self::_getParticipantByMail($user['mail'], $schedulable['participants'])) {
+		$participantID = mt_rand() . '2(Formatter)';
+
+		$participant['schedulable'] = $todoID;
+		$participant['status'] = STATUS_CONFIRMED;
+		$participant['isOrganizer'] = '1';
+		$participant['acl'] = 'rowi';
+		$participant['isExternal'] = 0;
+		$participant['user'] = $params['owner'];
+		$interation['participant://' . $participantID] = $participant;
+		$schedulable['participants'][] = $participantID;
+	    }
+	}
+	
+	$alarms = array();
+	
+	/* Definindo ALARMES */
+	while ($alarmComp = $component->getComponent('valarm'))
+	{
+		$alarm = array();
+		$alarmID = mt_rand() . '6(Formatter)';
+		$action =  $alarmComp->getProperty('action', false, true);
+		$trygger = $alarmComp->getProperty('trigger', false, true);
+		$alarm['type'] = self::decodeAlarmAction($action['value']);
+
+		 if(isset($trygger['value']['day']))
+		{
+			$alarm['time'] = $trygger['value']['day'];
+			$alarm['unit'] = 'd';
+		}
+		else if(isset($trygger['value']['hour']))
+		{
+			$alarm['time'] = $trygger['value']['hour'];
+			$alarm['unit'] = 'h';
+ 		}
+		else if(isset($trygger['value']['min']))
+		{
+			$alarm['time'] = $trygger['value']['min'];
+			$alarm['unit'] = 'm';
+		}
+		
+		foreach ($interation as $iint => &$vint)
+		{
+			if(isset($vint['user']) && $vint['user'] == Config::me('uidNumber'))
+			{
+				$alarm['participant'] = str_replace('participant://', '', $iint);	
+				$vint['alarms'][] = $alarmID;
+			}
+		}
+		$alarm['schedulable'] = $eventID;
+				
+		$interation['alarm://' . $alarmID ] = $alarm;
+		
+	}
+	
+	
+	/* Definindo DTSTAMP */
+	if ($dtstamp = self::_getTime($component, 'dtstamp'))
+	    $schedulable['dtstamp'] = $dtstamp;
+
+	/* Definindo TRANSP */
+	if (($tranp = $component->getProperty('transp', false, true)) && $tranp && is_string($tranp) && strtoupper($tranp) == 'OPAQUE')
+	    $schedulable['transparent'] = 1;
+
+	/* Definindo last_update */
+	if ($lastUpdate = self::_getTime($component, 'LAST-MODIFIED'))
+	    $schedulable['lastUpdate'] = $lastUpdate;
+
+
+	if ($sequence = $component->getProperty('SEQUENCE', false, false))
+	    $schedulable['sequence'] = $sequence;
+
+	if ($uid = $component->getProperty('uid', false, false))
+	    ;
+	$schedulable['uid'] = $uid;
+
+	while ($attach = $component->getProperty('ATTACH', FALSE, TRUE)) {
+
+	    $attachCurrent = array('name' => $attach['params']['X-FILENAME'],
+		'size' => strlen($attach['value']),
+		'type' => self::_getContentType($attach['params']['X-FILENAME'])
+	    );
+
+	    $ids = Controller::find(array('concept' => 'attachment'), array('id'), array('filter' => array('AND', array('=', 'name', $attachCurrent['name']), array('=', 'size', $attachCurrent['size']), array('=', 'type', $attachCurrent['type']))));
+
+	    if (!is_array($ids)) {
+		$attachCurrent['source'] = $attach['value'];
+		//insere o anexo no banco e pega id para colcar no relacionamento				
+		$idAttachment = Controller::create(array('concept' => 'attachment'), $attachCurrent);
+	    }else
+		$idAttachment = array('id' => $ids[0]['id']);
+
+	    $calendarToAttachmentId = mt_rand() . '2(Formatter)';
+	    $calendarToAttachment['attachment'] = $idAttachment['id'];
+	    $calendarToAttachment['schedulable'] = $eventID;
+	    $interation['schedulableToAttachment://' . $calendarToAttachmentId] = $calendarToAttachment;
+
+	    $schedulable['attachments'][] = $calendarToAttachmentId;
+	}
+
+	$interation['schedulable://' . $todoID] = $schedulable;
 
 	return $interation;
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/export.php
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/export.php	(revision 5863)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/export.php	(revision 6951)
@@ -46,13 +46,13 @@
 {    
     $event = Controller::read(array('concept' => 'schedulable' , 'id' => $params['event']));
-	$attachmentRelation = Controller::find( array( 'concept' => 'schedulableToAttachment' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $event['id']) )); 
-	if(is_array($attachmentRelation)){
-		$attachments = array();
-		foreach($attachmentRelation as $key => $value)
-			if(isset($value['attachment']) || !!$value['attachment'])
-				$attachments[$key]  = $value['attachment'];
-		//Pega os anexos sem source
-		$event['attachments'] = Controller::find( array( 'concept' => 'attachment' ) , false ,array( 'filter' => array('IN', 'id' , $attachments) )); 
-	}
+    $attachmentRelation = Controller::find( array( 'concept' => 'schedulableToAttachment' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $event['id']) )); 
+    if(is_array($attachmentRelation)){
+	    $attachments = array();
+	    foreach($attachmentRelation as $key => $value)
+		    if(isset($value['attachment']) || !!$value['attachment'])
+			    $attachments[$key]  = $value['attachment'];
+	    //Pega os anexos sem source
+	    $event['attachments'] = Controller::find( array( 'concept' => 'attachment' ) , false ,array( 'filter' => array('IN', 'id' , $attachments) )); 
+    }
         
     $repeat = Controller::find( array( 'concept' => 'repeat' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $event['id']) ));    
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js	(revision 6945)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js	(revision 6951)
@@ -946,5 +946,5 @@
                     startHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date( parseInt(task.startTime)), task.timezone, task.calendar, obj.DayLigth, 'startTime'), User.preferences.hourFormat),
                     endDate: new Date( parseInt(task.endTime) - (!!parseInt(task.allDay) ? 86400000 : 0)  ).setTimezoneOffset( Timezone.timezone( task.timezone ) ).toString( User.preferences.dateFormat ),
-                    endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(task.endTime)),  task.timezone, obj.calendar, obj.DayLigth, 'endTime'), User.preferences.hourFormat),
+                    endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(task.endTime)),  task.timezone, obj.calendar, obj.DayLigth, 'endTime'), User.preferences.hourFormat)
                 }
 
@@ -1005,5 +1005,5 @@
                 })
             };
-        }),
+        })
 
         };
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js	(revision 6945)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/activity.helpers.js	(revision 6951)
@@ -138,5 +138,5 @@
                         } ) ),
                         title: {
-                            text:'InformaÃ§Ãµes',
+                            text:'Informações',
                             button: '<a class="button close" href="#">close</a>'
                         }
@@ -206,12 +206,12 @@
 
     /**
-	 * canDiscardEventDialog deve ser true se nÃ£o houver alteraÃ§Ãµes no evento
+	 * canDiscardActivityDialog deve ser true se não houver alterações no evento
 	 */
-    canDiscardEventDialog = true;
+    canDiscardActivityDialog = true;
     /**
-	 * zebraDiscardEventDialog Ã© uma flag indicando que uma janela de confirmaÃ§Ã£o (Zebra_Dialog)
-	 * jÃ¡ estÃ¡ aberta na tela, uma vez que nÃ£o Ã© possivel acessar o evento ESC utilizado para fechÃ¡-la
+	 * zebraDiscardActivityDialog Ã© uma flag indicando que uma janela de confirmação (Zebra_Dialog)
+	 * já está aberta na tela, uma vez que não Ã© possivel acessar o evento ESC utilizado para fechá-la
 	 */
-    zebraDiscardEventDialog = false;
+    zebraDiscardActivityDialog = false;
 	
 	var html = DataLayer.render( path+'templates/activity_add.ejs', {
@@ -238,16 +238,16 @@
     		beforeClose: function(event, ui) {
     		
-    		    if (!canDiscardEventDialog && !zebraDiscardEventDialog) {
-        			zebraDiscardEventDialog = true;
+    		    if (!canDiscardActivityDialog && !zebraDiscardActivityDialog) {
+        			zebraDiscardActivityDialog = true;
         			window.setTimeout(function() {
-        			    $.Zebra_Dialog('Suas alteraÃ§Ãµes na atividade nÃ£o foram salvas. Deseja descartar as alteraÃ§Ãµes?', {
+        			    $.Zebra_Dialog('Suas alterações na atividade não foram salvas. Deseja descartar as alterações?', {
         				'type':     'question',
         				'overlay_opacity': '0.5',
-        				'buttons':  ['Descartar alteraÃ§Ãµes', 'Continuar editando'],
+        				'buttons':  ['Descartar alterações', 'Continuar editando'],
         				'onClose':  function(clicked) {
-        				    if(clicked == 'Descartar alteraÃ§Ãµes') {
-            					canDiscardEventDialog = true;
+        				    if(clicked == 'Descartar alterações') {
+            					canDiscardActivityDialog = true;
             					/**
-            					*RemoÃ§Ã£o dos anexos do eventos caso seja cancelado a ediÃ§Ã£o
+            					*Remoção dos anexos do eventos caso seja cancelado a edição
             					*/
             					DataLayer.rollback();
@@ -264,16 +264,16 @@
             					UI.dialogs.addActivity.dialog('close');
         				    }else{
-        					   zebraDiscardEventDialog = false;
+        					   zebraDiscardActivityDialog = false;
         				    }
         										
         				    /**
-        				    * Uma vez aberta uma janela de confirmaÃ§Ã£o (Zebra_Dialog), ao fechÃ¡-la
-        				    * com ESC, para que o evento ESC nÃ£o seja propagado para fechamento da
-        				    * janela de ediÃ§Ã£o de eventos, deve ser setada uma flag indicando que
-        				    * jÃ¡ existe uma janela de confirmaÃ§Ã£o aberta.
+        				    * Uma vez aberta uma janela de confirmação (Zebra_Dialog), ao fechá-la
+        				    * com ESC, para que o evento ESC não seja propagado para fechamento da
+        				    * janela de edição de eventos, deve ser setada uma flag indicando que
+        				    * já existe uma janela de confirmação aberta.
         				    */
         				    if (!clicked) {
             					window.setTimeout(function() {
-            					    zebraDiscardEventDialog = false;
+            					    zebraDiscardActivityDialog = false;
             					}, 200);
         				    }
@@ -284,5 +284,5 @@
     	    }
     	    //DataLayer.rollback();
-    	    return canDiscardEventDialog;
+    	    return canDiscardActivityDialog;
     	},
     	dragStart: function(event, ui) {
@@ -353,5 +353,5 @@
         });
 
-/*Seleciona a agenda padrÃ£o para visualizaÃ§Ã£o/ediÃ§Ã£o de um evento*/
+/*Seleciona a agenda padrão para visualização/edição de um evento*/
 if(objActivity.id)
     UI.dialogs.addActivity.find('option[value="'+objActivity.group+'"]').attr('selected','selected').trigger('change');
@@ -387,8 +387,8 @@
 	'type':     'question',
 	'overlay_opacity': '0.5',
-	'buttons':  ['Sim', 'NÃ£o'],
+	'buttons':  ['Sim', 'Não'],
 	'onClose':  function(clicked) {
 	    if(clicked == 'Sim'){
-		canDiscardEventDialog = true;
+		canDiscardActivityDialog = true;
 		/* Remove por filtro */
 		DataLayer.removeFilter('schedulable', {filter: ['AND', ['=', 'id', objActivity.id], ['=', 'group', objActivity.group], ['=','user',(objActivity.me.user ? objActivity.me.user.id : objActivity.me.id)]]});
@@ -406,5 +406,5 @@
 	    
 .children(".save").click(function(){
-    /* ValidaÃ§Ã£o 
+    /* Validação 
     var msg = false;			
     if(msg = validDateEvent()){
@@ -413,5 +413,5 @@
     }
     */
-    canDiscardEventDialog = true;
+    canDiscardActivityDialog = true;
 			
 	UI.dialogs.addActivity.children().find('form.form-addactivity').submit();
@@ -463,6 +463,6 @@
     var result = DataLayer.get('schedulable:taskSearch', filter, true)
 	/**
-    * TODO: trocar por template
-    */
+	* TODO: trocar por template
+	*/
 	blkAddTask.find('ul.search-result-list').empty().css('overflow', 'hidden');
 	if (!result) {
@@ -487,26 +487,16 @@
                     dueTime: old_item.find('[name="taskDueTime"]').val(),
                     allDay: old_item.find('[name="taskAllDay"]').val(),
-                    percentage: old_item.find('[name="taskPercentage"]').val(),
+                    percentage: old_item.find('[name="taskPercentage"]').val()
                 };
 
                 tasks.length += 1;
-
-    /*
-        		newTaskToActivity = DataLayer.put('taskToActivity', {
-        		    owner: User.me.id,
-                    task: old_item.find('.id').html(), 
-        		    activity: 'VER ISSO AQUI'
-        		});
-    */  							
-        		//attendees[old_item.find('.id').html()] = old_item.find('.name').html();
         							
-        		blkAddTask.find('dd.task-activity-list ul.task-activity-list')
-        		.append(DataLayer.render(path+'templates/task_add_itemlist.ejs', [{
-                    idTask: old_item.find('[name="id"]').val(),
+		blkAddTask.find('dd.task-activity-list ul.task-activity-list')
+		    .append(DataLayer.render(path+'templates/task_add_itemlist.ejs', [{
+			idTask: old_item.find('[name="id"]').val(),
         		    description: old_item.find('.description').html()
-        		 }]))
+			}]))
         		.scrollTo('max');
-
-        	    callbackTask();
+		callbackTask();
                 registerStatus();
                 blkAddTask.find('.not-activity').addClass('hidden');
@@ -514,11 +504,10 @@
     	    }
     	});
-
-    }
-	event.preventDefault();
-    }
-});
-
-/*Carrega as tarefas jÃ¡ existentes em uma atividade*/
+    }
+    event.preventDefault();
+    }
+});
+
+/*Carrega as tarefas já existentes em uma atividade*/
 if(objActivity.tasks.length){
     tasks = objActivity.tasks;
@@ -549,5 +538,5 @@
 	'type':     'question',
 	'overlay_opacity': '0.5',
-	'buttons':  ['Sim', 'NÃ£o'],
+	'buttons':  ['Sim', 'Não'],
 	'onClose':  function(clicked) {
 	    if(clicked == 'Sim'){
@@ -706,4 +695,12 @@
 });
 
+UI.dialogs.addActivity.find(':input').change(function(event){
+    if (event.keyCode != '27' && event.keyCode != '13')
+	canDiscardActivityDialog = false;
+}).keydown(function(event){
+    if (event.keyCode != '27' && event.keyCode != '13')
+	canDiscardActivityDialog = false;
+});
+
 UI.dialogs.addActivity.dialog('open');
 }
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6945)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6951)
@@ -2741,8 +2741,8 @@
 }
 
-function show_modal_import_export(tab, calendarId) {
+function show_modal_import_export(tab, calendarId, typeView){
     $('.qtip.qtip-blue').remove();
     DataLayer.render( 'templates/import_export.ejs', {
-	calendars: Calendar.calendars, 
+	calendars: typeView == 0 ? Calendar.calendars : Calendar.groups, 
 	owner: User.me.id
 	}, function( html ){
@@ -2750,5 +2750,5 @@
 	if (!UI.dialogs.importCalendar) {
 	    UI.dialogs.importCalendar = jQuery('#div-import-export-calendar')
-	    .append('<div title="Importar e Exportar Eventos" class="import-export import-export-win active"> <div>')
+	    .append('<div title="Importar e Exportar "' + (typeView == 0 ? 'Eventos' : 'Tarefas') + '" class="import-export import-export-win active"> <div>')
 	    .find('.import-export-win.active').html(html).dialog({
 		resizable: false, 
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6945)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6951)
@@ -239,5 +239,11 @@
     		    			startTime: new Date().toString('yyyy-MM-dd 00:00:00'),
     		    			endTime: new Date().toString('yyyy-MM-dd 00:00:00'),
-    		    			allDay: '1'
+    		    			allDay: '1',
+					participants: 
+					[{  
+					    user: User.me.id, 
+					    isOrganizer: 1,
+					    acl: 'row'
+					}]
     		    		});
     			    	
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js	(revision 6946)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js	(revision 6951)
@@ -804,4 +804,11 @@
     });
 
+    UI.dialogs.addTask.find(':input').change(function(event){
+	if (event.keyCode != '27' && event.keyCode != '13')
+	    canDiscardTaskDialog = false;
+    }).keydown(function(event){
+	if (event.keyCode != '27' && event.keyCode != '13')
+	    canDiscardTaskDialog = false;
+    });
 
     UI.dialogs.addTask.dialog('open');
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_list.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_list.ejs	(revision 6820)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_list.ejs	(revision 6951)
@@ -34,5 +34,9 @@
                     <ul>
                         <li><a href="#" onclick="add_tab_configure_calendar(<%= signatures['taskGroup'][i].calendar.id%>, 1);">Configurações</a></li>
-                        <li><a href="#" onclick="remove_calendar(1);">Remover Grupo</a></li>
+			<li><a href="#" onclick="show_modal_import_export(0,<%= signatures['taskGroup'][i].calendar.id%>, 1);">Importar</a></li>
+                        <li><a href="#" onclick="show_modal_import_export(1,<%= signatures['taskGroup'][i].calendar.id%>, 1);">Exportar</a></li>
+                        <%if(signatures['taskGroup'][i].type == '0'){%>
+			    <li><a href="#" onclick="remove_calendar(1);">Remover Grupo</a></li>
+			<%}%>
                     </ul>
 
@@ -65,6 +69,6 @@
                     <ul>
                         <li><a href="#" onclick="add_tab_configure_calendar(<%= signatures['calendar'][i].calendar.id%>, 0);">Configurações</a></li>
-                        <li><a href="#" onclick="show_modal_import_export(0, <%= signatures['calendar'][i].calendar.id%>);">Importar</a></li>
-                        <li><a href="#" onclick="show_modal_import_export(1, <%= signatures['calendar'][i].calendar.id%>);">Exportar</a></li>
+                        <li><a href="#" onclick="show_modal_import_export(0, <%= signatures['calendar'][i].calendar.id%>, 0);">Importar</a></li>
+                        <li><a href="#" onclick="show_modal_import_export(1, <%= signatures['calendar'][i].calendar.id%>, 0);">Exportar</a></li>
                         <li><a href="#" onclick="show_modal_shared(<%= signatures['calendar'][i].calendar.id%>);">Compartilhar agenda</a></li>
                         <li><a href="#" onclick="remove_calendar(0);">Remover agenda</a></li>
@@ -95,6 +99,6 @@
                     <ul>
                         <li><a href="#" onclick="add_tab_configure_calendar(<%= signatures['sharedCalendar'][i].calendar.id %>, 0);">Configurações</a></li>
-                        <li><a href="#" onclick="show_modal_import_export(0, <%= signatures['sharedCalendar'][i].calendar.id %>);">Importar</a></li>
-                        <li><a href="#" onclick="show_modal_import_export(1, <%= signatures['sharedCalendar'][i].calendar.id %>);">Exportar</a></li>
+                        <li><a href="#" onclick="show_modal_import_export(0, <%= signatures['sharedCalendar'][i].calendar.id%>, 0);">Importar</a></li>
+                        <li><a href="#" onclick="show_modal_import_export(1, <%= signatures['sharedCalendar'][i].calendar.id%>, 0);">Exportar</a></li>
                         <%if(!signatures['sharedCalendar'][i].permission.acl['required']){%>
                             <li><a href="#" onclick="cancel_signatures['sharedCalendar'](<%= signatures['sharedCalendar'][i].id %>);">Cancelar assinatura</a></li>
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs	(revision 6946)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs	(revision 6951)
@@ -237,5 +237,5 @@
 </div>
 	<form action="../prototype/modules/calendar/export.php" method="GET" class="form-export content">
-		<input type="hidden" class="id-task" name="task" value="<%= data.task.id %>"/>
+		<input type="hidden" class="id-task" name="event" value="<%= data.task.id %>"/>
 	</form>
 <!--	<div id="calendar_addtask_addattendee"></div>-->
Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add_itemlist.ejs
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add_itemlist.ejs	(revision 6945)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add_itemlist.ejs	(revision 6951)
@@ -1,12 +1,11 @@
-<%console.log(data)%>
 <li class="task"> 
-	<div style="overflow:hidden; width:100%; display:table;">	
-		<div class="activity-options" style="float: right; margin: 0 10px 0 0;">
-			<a class="button info activity-options-button-edit new ui-icon-notice">InformaÃ§Ãµes</a>
-			<a class="button close new">Remover</a>
-		</div>	
-		<input class="new" type="checkbox" value="<%= data[0].idTask %>">
+    <div style="overflow:hidden; width:100%; display:table;">	
+	<div class="activity-options" style="float: right; margin: 0 10px 0 0;">
+	    <a class="button info activity-options-button-edit new ui-icon-notice">Informaçõess</a>
+	    <a class="button close new">Remover</a>
+	</div>	
+	<input class="new" type="checkbox" value="<%= data[0].idTask %>">
         <input type="hidden" name="idtask[]" value="<%= data[0].idTask %>">
-		<input type="hidden" name="idTaskToActivity[]" value="<%= data[0].idTaskToActivity %>">
-		<label title="<%= data[0].description %>" class="name"><%= data[0].description %></label>
+	<input type="hidden" name="idTaskToActivity[]" value="<%= data[0].idTaskToActivity %>">
+	<label title="<%= data[0].description %>" class="name"><%= data[0].description %></label>
 </li>
