Index: /trunk/prototype/services/iCal.php
===================================================================
--- /trunk/prototype/services/iCal.php	(revision 7006)
+++ /trunk/prototype/services/iCal.php	(revision 7028)
@@ -107,7 +107,6 @@
 
 			    $vevent->setProperty('uid', $v['uid']);  
-			    
-			    break;
-            case TASK_ID:
+			    break;
+            case TODO_ID:
 
                 $todo = $ical->newComponent('todo');
@@ -138,12 +137,11 @@
                 }
 
-                if(isset($v['due']) && $v['due'] != ''){
+                if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){
                     $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone);
                     $dueTime->setTimezone($apTimezoneOBJ);
 
                     $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));
-                }
-                
-                $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));
+                    $todo->setProperty('dueTime', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));
+                }                
                        
                 if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0)
@@ -186,5 +184,4 @@
 		}	
 
-	
 		return $ical->createCalendar();
     }
@@ -269,5 +266,5 @@
 			    break;
 		    	
-        case TASK_ID:
+        case TODO_ID:
 
             $todo = $ical->newComponent('todo');
@@ -298,5 +295,5 @@
             }
 
-            if(isset($v['due']) && $v['due'] != ''){
+            if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){
                 $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone);
                 $dueTime->setTimezone($apTimezoneOBJ);
@@ -304,6 +301,4 @@
                 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));
             }
-            
-            $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));
                    
             if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0)
@@ -838,14 +833,20 @@
                                $user = Controller::Read(array('concept' => 'user'), false, array('filter' => array('=', 'id', $params['owner'])) );                     
                                 $pID = self::_getParticipantByMail($user[0]['mail'], $schedulable['participants']);
-                            }else
+                            }else{
                                 $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']);
-                            //Verifica a importação de eventos em que não participo
-                            if ($pID) {
-                                $interation['participant://' . $pID]['status'] = $params['status'];
+                                //Verifica a importação de tarefas em que não participo
+                                if ($pID) {
+                                    $pID =  mt_rand() . '2(Formatter)';
+                                    $interation['participant://' . $pID]['status'] = $params['status'];
+                                    $interation['participant://' . $pID]['user'] = $params['owner'];
+                                    $interation['participant://' . $pID]['isOrganizer'] = '0';
+                                    $interation['participant://' . $pID]['schedulable'] = $schedulable['id'];
+                                }else
+                                    $interation['participant://' . $pID]['status'] = $params['status'];
                             }
                         }
                     }
 		} else { // Importar tarefa
-		    $interation = self::_makeVEVENT(array(), $component, $params);
+		    $interation = self::_makeVTODO(array(), $component, $params);
 
 		    if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora
@@ -915,8 +916,4 @@
             if ($percentage = $component->getProperty('percent-complete', false, false))
                 $sc['percentage'] = mb_convert_encoding(str_ireplace(array('\n', '\t'), array("\n", "\t"), $percentage), 'UTF-8', 'UTF-8,ISO-8859-1');
-
-            $todo->setProperty('priority', $v['priority']);
-            $todo->setProperty('percent-complete', $v['percentage']);
-            $todo->setProperty('status', $this->_getStatusTodo($v['status']));
 
 			/* Definindo location */
@@ -1331,5 +1328,5 @@
     );
 
-    return isset($a[$id]) ? $a[$id] : 'STATUS_TODO_NEED_ACTION';
+    return isset($a[$action]) ? $a[$action] : 'STATUS_TODO_NEED_ACTION';
     
     }
@@ -1834,5 +1831,5 @@
 
 	    $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ? $tpID : mt_rand() . '2(Formatter)';
-	    $participant['schedulable'] = $eventID;
+	    $participant['schedulable'] = $todoID;
 
 	    if (isset($params['status']) && $mailUser == Config::me('mail'))
@@ -1874,5 +1871,5 @@
 	    $participantID = mt_rand() . '2(Formatter)';
 
-	    $participant['schedulable'] = $eventID;
+	    $participant['schedulable'] = $todoID;
 	    $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED;
 	    $participant['isOrganizer'] = '1';
Index: /trunk/prototype/modules/calendar/interceptors/DBMapping.php
===================================================================
--- /trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 7006)
+++ /trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 7028)
@@ -781,5 +781,5 @@
 		$DayLigth['calendar']['endTime'] = $Time->format('I') ? 1 : 0;
 
-		if ($currentTimezone != $v['timezone']) {
+		if (!isset($currentTimezone) || ($currentTimezone != $v['timezone'])) {
 		    $currentTimezone = $v['timezone'];
 		    $Time->setTimezone(new DateTimeZone($v['timezone']));
Index: /trunk/prototype/modules/calendar/constants.php
===================================================================
--- /trunk/prototype/modules/calendar/constants.php	(revision 6996)
+++ /trunk/prototype/modules/calendar/constants.php	(revision 7028)
@@ -2,5 +2,5 @@
 
 define('EVENT_ID', 1);
-define('TASK_ID', 2);
+define('TODO_ID', 2);
 
 define('SIGNATURE_TYPE_NORMAL', 0);
Index: /trunk/prototype/modules/calendar/js/init.js
===================================================================
--- /trunk/prototype/modules/calendar/js/init.js	(revision 7022)
+++ /trunk/prototype/modules/calendar/js/init.js	(revision 7028)
@@ -176,5 +176,5 @@
     					text: $('<div></div>').html( DataLayer.render( 'templates/task_quick_add.ejs', {"componente" : componente} ) ),
     					title: {
-    						text:'Nova tarefa', 
+    						text:'Nova Tarefa', 
     						button: '<a class="button close" href="#">close</a>'
     					}
Index: /trunk/prototype/modules/calendar/js/task.helpers.js
===================================================================
--- /trunk/prototype/modules/calendar/js/task.helpers.js	(revision 7006)
+++ /trunk/prototype/modules/calendar/js/task.helpers.js	(revision 7028)
@@ -252,5 +252,5 @@
     if (!UI.dialogs.addTask) {
 
-        UI.dialogs.addTask = jQuery('#sandbox').append('<div title="Criar tarefa" class="new-task-win active"> <div>').find('.new-task-win.active').html(html).dialog({
+        UI.dialogs.addTask = jQuery('#sandbox').append('<div title="Criar Tarefa" class="new-task-win active"> <div>').find('.new-task-win.active').html(html).dialog({
             resizable: false,
             modal: true,
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 7016)
+++ /trunk/expressoMail1_2/js/main.js	(revision 7028)
@@ -4329,5 +4329,5 @@
 					    "Importar" : function(){
 						    $.ajax({
-							url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner(),
+							url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&status='+$("#select-status option:selected").val()+'&uidAccount='+decodeOwner()+'&cirus_delimiter='+cyrus_delimiter,
 							success: function(msg){
 							    var alt = ( (msg = connector.unserialize(msg)) == "ok") ? "Importado com sucesso para " : "Ocorreu um erro ao importar o evento/tarefa para a agenda ";
@@ -4356,5 +4356,5 @@
 				case 5:
 				    $.ajax({
-					url: "controller.php?action="+import_url+'&from_ajax=true&selected=true',
+					url: 'controller.php?action='+import_url+'&from_ajax=true&selected=true&cirus_delimiter='+cyrus_delimiter,
 					success: function(msg){
 					    alert( ( ( connector.unserialize(msg)) == "ok") ? "Seu evento/tarefa foi Atualizado com sucesso" : "Ocorreu um erro ao atualizar evento/tarefa" );
