Index: /trunk/prototype/services/iCal.php
===================================================================
--- /trunk/prototype/services/iCal.php	(revision 7028)
+++ /trunk/prototype/services/iCal.php	(revision 7068)
@@ -58,6 +58,4 @@
 			    $sTime = new DateTime('@' . (int) ($v['startTime'] / 1000), $timezone);
 			    $sTime->setTimezone($apTimezoneOBJ);
-			    $eTime = new DateTime('@' . (int) ($v['endTime'] / 1000), $timezone);
-			    $eTime->setTimezone($apTimezoneOBJ);
 
 			    if (( isset($v['repeat']) ) && ( isset($v['repeat']['frequency']) && $v['repeat']['frequency'] && $v['repeat']['frequency'] != 'none' )) 
@@ -65,12 +63,12 @@
 			    
 
-			    if (isset($v['allDay']) && $v['allDay'] == 1) {
-				$vevent->setProperty('dtstart', $sTime->format(DATE_RFC822), array("VALUE" => "DATE"));
-				$vevent->setProperty('dtend', $eTime->format(DATE_RFC822), array("VALUE" => "DATE"));
-				$vevent->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'TRUE');
-			    } else {
-				$vevent->setProperty('dtstart', $sTime->format(DATE_RFC822), array('TZID' => $apTimezone));
-				$vevent->setProperty('dtend', $eTime->format(DATE_RFC822), array('TZID' => $apTimezone));
-				$vevent->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'FALSE');
+			    if (isset($v['allDay']) && $v['allDay'] == 1)
+                {
+                    $vevent->setProperty('dtstart', $sTime->format(DATE_RFC822), array("VALUE" => "DATE"));
+                    $vevent->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'TRUE');
+			    } else
+                {
+                    $vevent->setProperty('dtstart', $sTime->format(DATE_RFC822), array('TZID' => $apTimezone));
+                    $vevent->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'FALSE');
 			    }
 			   		    
@@ -137,4 +135,12 @@
                 }
 
+                ob_start();
+                print_r( "\n dtStart \n");
+                print_r($sTime->format(DATE_RFC822));
+                print_r( "\n dtEnd \n");
+                print_r( $eTime->format(DATE_RFC822));
+                $output = ob_get_clean();
+                file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND);
+
                 if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){
                     $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone);
@@ -182,5 +188,11 @@
 			    break;
 		    }
-		}	
+		}
+
+        ob_start();
+        print_r( "\n Ical Gerado \n");
+        print_r( $ical->createCalendar());
+        $output = ob_get_clean();
+        file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND);
 
 		return $ical->createCalendar();
@@ -282,14 +294,10 @@
             $sTime = new DateTime('@' . (int) ($v['startTime'] / 1000), $timezone);
             $sTime->setTimezone($apTimezoneOBJ);
-            $eTime = new DateTime('@' . (int) ($v['endTime'] / 1000), $timezone);
-            $eTime->setTimezone($apTimezoneOBJ);
 
             if (isset($v['allDay']) && $v['allDay'] == 1) {
                 $todo->setProperty('dtstart', $sTime->format(DATE_RFC822), array("VALUE" => "DATE"));
-                $todo->setProperty('dtend', $eTime->format(DATE_RFC822), array("VALUE" => "DATE"));
                 //$todo->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'TRUE');
             } else {
                 $todo->setProperty('dtstart', $sTime->format(DATE_RFC822), array('TZID' => $apTimezone));
-                $todo->setProperty('dtend', $eTime->format(DATE_RFC822), array('TZID' => $apTimezone));
                 //$todo->setProperty('X-MICROSOFT-CDO-ALLDAYEVENT', 'FALSE');
             }
@@ -372,5 +380,5 @@
     public function createAlarms($alarms, &$vevent)
     {	
-	    foreach ($alarms as $ia => $va)
+	    foreach ($alarms as $va)
 	    {
 	    	$valarm = new valarm();
@@ -1741,8 +1749,4 @@
     	$interation['schedulable://' . $eventID] = $schedulable;
 
-
-
-
-
     	return $interation;
     }
@@ -1784,25 +1788,29 @@
 
 	/* 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;
-	    }
-	}
+	if($due = $component->getProperty('due', false, true)){
+
+        $tzid = isset($due['params']['TZID']) ? $due['params']['TZID'] : $params['X-WR-TIMEZONE'];
+
+        if($tzid)
+            $tzid = self::nomalizeTZID($tzid);
+
+        if (isset($due['params']['VALUE']) && $due['params']['VALUE'] === 'DATE')
+            $schedulable['due'] = self::date2timestamp($due['value']) - self::_getTzOffset('UTC', $schedulable['timezone'], '@' . self::date2timestamp($due['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['due'] = self::date2timestamp($due['value']) - self::_getTzOffset('UTC', $tzid, '@' . self::date2timestamp($due['value'])) . '000';
+        else {
+            $schedulable['due'] = self::date2timestamp($due['value']) . '000';
+            if (strpos($params['prodid'], 'Outlook') !== false) {
+            //Se o ics veio em utc não aplicar horario de verão
+            $dueTime = new DateTime('@' . (int) ($schedulable['due'] / 1000), new DateTimeZone('UTC'));
+            $dueTime->setTimezone($objTimezone);
+
+            if ($dueTime->format('I'))
+                $schedulable['due'] = $schedulable['due'] - 3600000;
+            }
+        }
+        $schedulable['endTime'] = $schedulable['due'];
+    }else
+        $schedulable['endTime'] = $schedulable['startTime'];
 
 	$schedulable['type'] = '2'; //type schedulable
@@ -2003,5 +2011,5 @@
 	$interation['schedulable://' . $todoID] = $schedulable;
 
-	return $interation;
+    return $interation;
     }
 
Index: /trunk/prototype/modules/calendar/js/calendar.contentMenu.js
===================================================================
--- /trunk/prototype/modules/calendar/js/calendar.contentMenu.js	(revision 6533)
+++ /trunk/prototype/modules/calendar/js/calendar.contentMenu.js	(revision 7068)
@@ -8,46 +8,53 @@
                 
 		var classes = $(this).attr('class').split(" ");
-		var idEvent = false, idRecurrence = false, idCalendar = false;
+		var idEvent = false, typeEvent = false,idRecurrence = false, idCalendar = false;
                 
 		//recupera o id do calendar eo id do evento para tratamento
 		for(var i = 0; i < classes.length; i++){
-                    if (classes[i].indexOf("event-id-") >= 0 ){
-                        idEvent = classes[i].replace(/[a-zA-Z-]+/g, '');
-                        continue;
-                    }else if (classes[i].indexOf("Recurrence-id-") >= 0 ){
-                        idRecurrence = classes[i].replace(/[a-zA-Z-]+/g, '');
-                        continue;
-                    }else if (classes[i].indexOf("calendar-id-") >= 0 ){
-                        idCalendar = classes[i].replace(/[a-zA-Z-]+/g, '');
-                        continue;
-                    }
-                }
+			if (classes[i].indexOf("event-id-") >= 0 ){
+				idEvent = classes[i].replace(/[a-zA-Z-]+/g, '');
+				continue;
+			}else if (classes[i].indexOf("Recurrence-id-") >= 0 ){
+				idRecurrence = classes[i].replace(/[a-zA-Z-]+/g, '');
+				continue;
+			}else if (classes[i].indexOf("calendar-id-") >= 0 ){
+				idCalendar = classes[i].replace(/[a-zA-Z-]+/g, '');
+				continue;
+			}else if (classes[i].indexOf("event-type-") >= 0 ){
+				typeEvent = classes[i].replace(/[a-zA-Z-]+/g, '');
+				continue;
+			}
+		}
 
-                var schedulable = DataLayer.get('schedulable', idEvent);
-
+		var schedulable = DataLayer.get('schedulable', idEvent);
 		var isRecurrence = DataLayer.get('repeat', schedulable.repeat).frequency || false;
 
 		var top = $('#divAppbox').scrollTop();
 
-		var template = DataLayer.render( 'templates/menu_context_event.ejs', {event: schedulable.id ,
-                    top: (event.clientY - 135 + top), left: (event.clientX - 445), 
+		var template = DataLayer.render( 'templates/menu_context_event.ejs', 
+		{
+			event: schedulable.id ,
+			top: (event.clientY - 135 + top), 
+			left: (event.clientX - 445), 
 		    signature: Calendar.signatureOf[idCalendar],
-                    calendars: Calendar.calendars, isRecurrence: (!isRecurrence || isRecurrence == 'none') ? false : true,
-                    idRecurrence: idRecurrence
-                });
+			calendars: Calendar[parseInt(typeEvent) == 1 ? 'calendars' : 'groups'], 
+			isRecurrence: (!isRecurrence || isRecurrence == 'none') ? false : true,
+			idRecurrence: idRecurrence,
+			typeEvent: typeEvent
+		});
 
 		$('#context-menu-event').html(template);
 
-                var method = function(value){
-                    switch (value){
-                        case "ocurrency":
-                            return '2'
-                        case "copy":
-                            return '1';
-                        case "move": 
-                            return '0';
-                    }
-                }
-		
+		var method = function(value){
+			switch (value){
+				case "ocurrency":
+					return '2'
+				case "copy":
+					return '1';
+				case "move": 
+					return '0';
+			}
+		}
+
 		$('#context-menu-event').find('li.menu-item').hover(
 			function () {
Index: /trunk/prototype/modules/calendar/js/calendar.codecs.js
===================================================================
--- /trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 7041)
+++ /trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 7068)
@@ -703,7 +703,9 @@
         "class": form["class"],
         startTime: Date.parseExact(form.startDate + " "+$.trim(form.startHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
-        endTime:  Date.parseExact(form.endDate + " "+$.trim(form.endHour), formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),  //+ (!!form.allDay ? 86400000 : 0) ,
-        due: (form.dueDate == '' )? 0 : Date.parseExact(form.dueDate + " "+$.trim(form.dueTime) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
-        allDay: ( !!form.allDay ? 1 : 0 ),      
+        endTime: (form.dueDate == '' ) ?
+            Date.parseExact(form.startDate + " "+$.trim(form.startHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00') :
+            Date.parseExact(form.dueDate + " "+$.trim(form.dueTime) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
+        due: (form.dueDate == '' ) ? 0 : Date.parseExact(form.dueDate + " "+$.trim(form.dueTime) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
+        allDay: ( form.dueDate == ''  ? 1 : 0 ),
         status: form.taskStatus,      
         id: form.idTask,
@@ -1062,5 +1064,5 @@
         "class": form["class"],
         startTime: Date.parseExact(form.startDate + " "+$.trim(form.startHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
-        endTime:  Date.parseExact(form.endDate + " "+$.trim(form.endHour), formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),  //+ (!!form.allDay ? 86400000 : 0) ,
+        endTime:  (form.dueDate == '' )? 0 : Date.parseExact(form.dueDate + " "+$.trim(form.dueHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
         due: (form.dueDate == '' )? 0 : Date.parseExact(form.dueDate + " "+$.trim(form.dueHour) , formatString ).toString(!!form.allDay ? 'yyyy-MM-dd 00:00:00' : 'yyyy-MM-dd HH:mm:00'),
         allDay: ( !!form.allDay ? 1 : 0 ),      
@@ -1647,90 +1649,112 @@
 		
 	    if(!(typeof(evt) == 'object') || (evt.id.indexOf('java') >= 0))
-		return (null);
+			return (null);
 
 	    evt.calendar = evt.calendar || "1";
 
 	    if( !grouped[ evt.calendar ] )
-		grouped[ evt.calendar ] = [];
+			grouped[ evt.calendar ] = [];
 			
 	    var calendar = DataLayer.get('calendar', evt.calendar);
 		
+		var taskEditable = function(idTask){
+			for(var i = 0; i < evt.participants.length; i++){
+				attendee = DataLayer.get('participant', evt.participants[i]);
+				if(attendee.user == User.me.id)
+					return attendee.isOrganizer == '1' ? 
+					{
+						editable: true, 
+						disableResizing: false, 
+						disableDragging: false,
+						className: 'fullcalendar-context-menu  event-type-2 event-id-'+idTask+' calendar-id-'+calendar.id
+					} 
+					: 
+					{
+						editable: false, 
+						disableResizing: true, 
+						disableDragging: true,
+						className: 'blocked-event-permision  fullcalendar-not-context-menu event-id-'+idTask
+					};
+			}
+		}
+		
 	    var eventEditable = function(idEvent, isRecurrence, Recurrence){
-		if(Calendar.signatureOf[calendar.id].isOwner == "1"){
-		    var attendee = {};
-		    for(var i = 0; i < evt.participants.length; i++){
-			attendee = DataLayer.get('participant', evt.participants[i]);
-			if(attendee.user == User.me.id)
-					    return (attendee.acl.indexOf('w') >= 0 || attendee.acl.indexOf('o') >= 0 ) ? 
+			if(Calendar.signatureOf[calendar.id].isOwner == "1"){
+				var attendee = {};
+				for(var i = 0; i < evt.participants.length; i++){
+					attendee = DataLayer.get('participant', evt.participants[i]);
+					if(attendee.user == User.me.id)
+						return (attendee.acl.indexOf('w') >= 0 || attendee.acl.indexOf('o') >= 0 ) ? 
 						{
-				selectable: true, 
-				className: 'fullcalendar-context-menu  event-id-'+idEvent+' calendar-id-'+calendar.id+ (isRecurrence ? ' isRecurrence Recurrence-id-'+Recurrence : '')
-				} : {
-				editable: false, 
-				selectable: true ,
-				className: 'blocked-event-permision  fullcalendar-not-context-menu event-id-'+idEvent
+							selectable: true, 
+							className: 'fullcalendar-context-menu  event-type-1 event-id-'+idEvent+' calendar-id-'+calendar.id+ (isRecurrence ? ' isRecurrence Recurrence-id-'+Recurrence : '')
+						} : {
+							editable: false, 
+							selectable: true ,
+							className: 'blocked-event-permision  fullcalendar-not-context-menu event-id-'+idEvent
+						};
+				}
+				return {
+					editable: false, 
+					className: 'blocked-event-permision  fullcalendar-not-context-menu event-id-'+idEvent+' calendar-id-'+calendar.id,  
+					selectable: true, 
+					disableDragging: isRecurrence
 				};
-		    }
-		    return {
-			editable: false, 
-			className: 'blocked-event-permision  fullcalendar-not-context-menu event-id-'+idEvent+' calendar-id-'+calendar.id,  
-			selectable: true, 
-			disableDragging: isRecurrence
-		    };
-		}
-		else{
-		    var aclSignature = Calendar.signatureOf[calendar.id].permission;
+			}
+			else{
+				var aclSignature = Calendar.signatureOf[calendar.id].permission;
+					
+				var mountClass =  function(acl){
+					var returns = ""
+					returns += acl['write'] ? "" :  'blocked-event-permision ';
+					returns += acl['busy'] ? 'fullcalendar-not-context-menu ' : (acl['read']  ?  'fullcalendar-context-menu '+ (isRecurrence ? ' isRecurrence Recurrence-id-'+Recurrence : '') : '');
+					returns += 'event-id-'+idEvent+' calendar-id-'+calendar.id;
+					return returns;
+				}
 				
-		    var mountClass =  function(acl){
-			var returns = ""
-			returns += acl['write'] ? "" :  'blocked-event-permision ';
-			returns += acl['busy'] ? 'fullcalendar-not-context-menu ' : (acl['read']  ?  'fullcalendar-context-menu '+ (isRecurrence ? ' isRecurrence Recurrence-id-'+Recurrence : '') : '');
-			returns += 'event-id-'+idEvent+' calendar-id-'+calendar.id;
-			return returns;
-		    }				
-		    return DataLayer.merge(
-			{
-			editable: aclSignature.acl['write'] && !isRecurrence,
-			disableResizing : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true : false),
-			disableDragging  : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true: false),
-			className: mountClass(aclSignature.acl)
-			}, aclSignature.acl['busy'] ? 
-			{
-			    title: 'Ocupado', 
-			    selectable: false
-			} : {
-			    selectable: true
-			});	
-		}
+				return DataLayer.merge({
+					editable: aclSignature.acl['write'] && !isRecurrence,
+					disableResizing : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true : false),
+					disableDragging  : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true: false),
+					className: mountClass(aclSignature.acl)
+					}, aclSignature.acl['busy'] ? 
+					{
+						title: 'Ocupado', 
+						selectable: false
+					} : {
+						selectable: true
+					}
+				);	
+			}
 	    }
+
+		var duration = parseInt( evt.endTime ) - parseInt( evt.startTime ), isRepeat = false;
+
+		var occurrences = [];
 		
-	    var duration = parseInt( evt.endTime ) - parseInt( evt.startTime ), isRepeat = false;
-		
-	    var occurrences = [];
-		
-	    if( evt.occurrences )
-	    {
-		isRepeat = true;
-		occurrences = evt.occurrences;
+		if( evt.occurrences )
+		{
+			isRepeat = true;
+			occurrences = evt.occurrences;
 	    }else
-		occurrences[ occurrences.length ] = evt.startTime;
+			occurrences[ occurrences.length ] = evt.startTime;
 
 	    //occurrences = DataLayer.unique( occurrences ).sort();
 		var typeEvent;  
-	    for( var i = 0; i < occurrences.length; i++ ){
-
+	    for( var i = 0; i < occurrences.length; i++ )
+		{
             typeEvent = (evt.type == 2 && evt.taskToActivity ? 3 : evt.type)
     		grouped[ evt.calendar ].push( DataLayer.merge(
     		{
-    		    id: evt.URI || evt.id+ '-' + i,
-    		    title: Encoder.htmlDecode(evt.summary),
-    		    start: Timezone.getDateCalendar(new Date( parseInt( occurrences[i] ) ), calendar.timezone,  !!evt.DayLigth ? evt.DayLigth.calendar.startTime : Timezone.daylightSaving),
-    		    end:   Timezone.getDateCalendar(new Date( parseInt( occurrences[i] ) + duration - (!!parseInt(evt.allDay) ? 86400000 : 0)), calendar.timezone, !!evt.DayLigth ? evt.DayLigth.calendar.startTime : Timezone.daylightSaving),
-    		    allDay: parseInt( evt.allDay ),
-    		    isRepeat: isRepeat,
-    		    occurrence: i,
-    		    type: typeEvent,
-    		    calendar: evt.calendar
-    		    }, (parseInt(typeEvent) == 1 ? eventEditable(evt.id, isRepeat, i ) : (parseInt(typeEvent) == 2 ? {editable: true, disableResizing: false, disableDragging: false} : {editable: false, disableResizing: true, disableDragging: true}) )) );
+				id: evt.URI || evt.id+ '-' + i,
+				title: Encoder.htmlDecode(evt.summary),
+				start: Timezone.getDateCalendar(new Date( parseInt( occurrences[i] ) ), calendar.timezone,  !!evt.DayLigth ? evt.DayLigth.calendar.startTime : Timezone.daylightSaving),
+				end:   Timezone.getDateCalendar(new Date( parseInt( occurrences[i] ) + duration - (!!parseInt(evt.allDay) ? 86400000 : 0)), calendar.timezone, !!evt.DayLigth ? evt.DayLigth.calendar.startTime : Timezone.daylightSaving),
+				allDay: parseInt( evt.allDay ),
+				isRepeat: isRepeat,
+				occurrence: i,
+				type: typeEvent,
+				calendar: evt.calendar
+				}, (parseInt(typeEvent) == 1 ? eventEditable(evt.id, isRepeat, i ) : (parseInt(typeEvent) == 2 ? taskEditable(evt.id) : {editable: false, disableResizing: true, disableDragging: true}))));
         }
 	});
Index: /trunk/prototype/modules/calendar/js/task.helpers.js
===================================================================
--- /trunk/prototype/modules/calendar/js/task.helpers.js	(revision 7065)
+++ /trunk/prototype/modules/calendar/js/task.helpers.js	(revision 7068)
@@ -3,11 +3,8 @@
 	var errors = {
 		'emptyInitData': 'Por favor, informe uma data inicial',
-		'emptyEndData': 'Por favor, informe uma data final',
 		'emptyInitHour': 'Por favor, informe uma hora inicial',
-		'emptyEndHour': 'Por favor, informe uma hora final',
 		
 		'invalidInitData' : 'Data inicial inválida',
-		'invalidEndData' : 'Data final inválida',
-		
+
 		'equalData' : 'Hora inicial igual a final',
 		'theirData' : 'Data final menor que a inicial',		
@@ -22,65 +19,28 @@
 
     var start_date = $(".new-task-win.active .start-date").val();
-    var end_date   = $(".new-task-win.active .end-date").val();
     var start_time = $(".new-task-win.active .start-time").val();
-    var end_time   = $(".new-task-win.active .end-time").val();
 	var due_date   = $(".new-task-win.active .date-prevision").val();
 	var due_time   =  $.trim($(".new-task-win.active .time-prevision").val());
-    var isAllDay   = $('.new-task-win.active input[name="allDay"]').is(':checked');
-    var customDate = $(".endRepeat").val() == "customDate";
-    var occurrences = $(".endRepeat").val() == "occurrences";
-    var taskInterval = $('.taskInterval').val();
-    
+
     if(start_date == "")
 		return errors['emptyInitData'];
-    else if(end_date == "")
-		return errors['emptyEndData'];
-    else if(!isAllDay && start_time == "")
-		return errors['emptyInitHour'];
-    else if(!isAllDay && end_time == "")
-		return errors['emptyEndHour'];
 	else if(due_date != "" && due_time == "")
 		return errors['dueTime'];
 	else if(due_date == "" && due_time != "")
 		return errors['dueDate'];
-	
+
     var formatString = User.preferences.dateFormat + " " + User.preferences.hourFormat;
-		
     var startDate = Date.parseExact( start_date + " " + $.trim(start_time) , formatString );
-    var endDate = Date.parseExact( end_date + " " + $.trim(end_time) , formatString );
-	var dueDate = Date.parseExact( due_date + " " + $.trim(due_time) , formatString );
 
     if(startDate == null || startDate.getTime() < 0 )
 		return errors['invalidInitData'];
-    if(endDate == null || endDate.getTime() < 0)
-		return errors['invalidEndData'];
-	if(dueDate == null &&  due_time != "")
-		return errors['invalidDueData'];
-		
-	if(isAllDay){
-		startDate.clearTime();
-		endDate.clearTime();
-		if(endDate.compareTo(startDate) == -1)
-			return errors['theirData'];
-	}else{
-		var condition = endDate.compareTo(startDate);
-		if(condition != 1){
-			if(condition < 0){
-				startDate.clearTime();
-				endDate.clearTime();
-				condition = endDate.compareTo(startDate);				
-				return (errors[ condition == 0 ? 'theirHour' : 'theirData'] );
-			}
-			else
-				return errors['equalData'];
-		}
-		
-		if (dueDate != null && dueDate.compareTo(startDate) == -1)
-			return errors['dueInitDate'];		
-	}
-    
-    if (customDate)    
-		if ( !($('.new-task-win.active .customDateEnd').val().length) )
-		   return errors['emptyEndData'];
+
+    if(due_date != '' && due_time != '')
+    {
+        var dueDate = Date.parseExact( due_date + " " + $.trim(due_time) , formatString );
+
+        if(dueDate.compareTo(startDate) == -1)
+            return errors['dueInitDate'];
+    }
 
     return false;
Index: /trunk/prototype/modules/calendar/templates/activity_add.ejs
===================================================================
--- /trunk/prototype/modules/calendar/templates/activity_add.ejs	(revision 7011)
+++ /trunk/prototype/modules/calendar/templates/activity_add.ejs	(revision 7068)
@@ -15,13 +15,10 @@
 	    </p>
 	    <p class="input-group date-info">
+		<span>Inicio</span>
 		<input type="text" class="start-date" readonly="readonly" value="<%= (data.activity.startDate) ? data.activity.startDate : '' %>" name="startDate" />
 		<input type="text" class="time start-time<%= (data.activity.allDay) ? ' hidden' : '' %>" readonly="readonly" value="<%= (data.activity.startHour) ? data.activity.startHour : '' %>" name="startHour" /> 
-		<span>até</span>
-		<input type="text" class="end-date" readonly="readonly" value="<%= (data.activity.endDate) ? data.activity.endDate : '' %>" name="endDate" />
-		<input type="text" class="time end-time<%= (data.activity.allDay) ? ' hidden' : '' %>" readonly="readonly" value="<%= (data.activity.endHour) ? data.activity.endHour : '' %>" name="endHour" />
-
-		<span class="previsao-termino">Previsão término:</span>
+		<span>com previsão de término</span>
 		<input type="text" class="date-due" name="dueDate" readonly="readonly">
-		<input type="text" class="time time-due" name="dueHour" readonly="readonly">
+		<input type="text" class="time time-due <%= (data.activity.allDay) ? ' hidden' : '' %>" name="dueHour" readonly="readonly">
 
 		<a href="#" class="group_addactivity_details_lnk_timezone">Fuso horário</a>
Index: /trunk/prototype/modules/calendar/templates/task_add.ejs
===================================================================
--- /trunk/prototype/modules/calendar/templates/task_add.ejs	(revision 7006)
+++ /trunk/prototype/modules/calendar/templates/task_add.ejs	(revision 7068)
@@ -14,18 +14,15 @@
 		</p>
 		<p class="input-group date-info">
+            <span>Inicio</span>
 			<input type="text" class="date start-date" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= (data.task.startDate) ? data.task.startDate : '' %>" name="startDate" />
-			<input type="text" class="time start-time<%= (data.task.allDay) ? ' hidden' : '' %>" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= (data.task.startHour) ? data.task.startHour : '' %>" name="startHour" /> 
-			<span>até</span>
-			<input type="text" class="date end-date" value="<%= (data.task.endDate) ? data.task.endDate : '' %>" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> name="endDate" />
-			<input type="text" class="time end-time<%= (data.task.allDay) ? ' hidden' : '' %>" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= (data.task.endHour) ? data.task.endHour : '' %>" name="endHour" />
-
-				<span class="prevision-termino">Previsão término:</span>
-				<input type="text" name="dueDate" class="date date-prevision" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= data.task.dueDate %>">
-				<input type="text" name="dueTime" class="time time-prevision" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= data.task.dueTime %>">
-
-				<a href="#" class="calendar_addtask_details_lnk_timezone" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%>>Fuso horário</a>
+			<input type="text" class="time start-time" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= (data.task.startHour) ? data.task.startHour : '' %>" name="startHour" />
+			<span>com previsão de término</span>
+            <input type="text" name="dueDate" class="date date-prevision" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= data.task.dueDate %>">
+            <input type="text" name="dueTime" class="time time-prevision" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%> value="<%= data.task.dueTime %>">
+
+            <a href="#" class="calendar_addtask_details_lnk_timezone" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%>>Fuso horário</a>
 			
 			
-<!--			<input type="text" name="timezone" style="display: none;" />-->
+<!--		<input type="text" name="timezone" style="display: none;" />-->
 			<select name="timezone" class="hidden calendar-addtask-details-txt-timezone" <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%>>
 				<option value="">- None selected -</option>
@@ -48,12 +45,5 @@
 			</div>
 		</div>
-		
-		<p class="input-group task-type">
-			<input type="checkbox" name="allDay" value="true" <%= (data.task.allDay) ? 'checked="checked"' : '' %> <%= data.task.isOrganizer ? '' : 'disabled="disabled"'%>/>
-			<label for="allDay">Dia inteiro</label>
-<!--
-			<input type="checkbox" class="button-repeat" />
-			<label for="calendar_addtask_details_chk_repeat">Repetir</label>-->
-		</p>
+
 		<div class="subitem">
 				% Conclusão: <input type="text" name="percentage" class="done" value="<%= data.task.percentage %>">
