Index: /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_current.inc.php
===================================================================
--- /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_current.inc.php	(revision 6832)
+++ /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_current.inc.php	(revision 6876)
@@ -122,5 +122,9 @@
                 'tzid' => array('type' => 'varchar', 'precision' => '50' ,'nullable' => True),
                 'transp' => array( 'type' => 'int', 'precision' => '2', 'nullable' => FALSE , 'default' => 0 ),
-                'sequence' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 )
+                'sequence' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ),
+                'due' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ),
+                'percentage' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ),
+                'status' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 0 ),
+                'priority' => array( 'type' => 'int', 'precision' => '8', 'nullable' => FALSE , 'default' => 2 )
             ),
             'pk' => array('id'),
Index: /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_update.inc.php
===================================================================
--- /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_update.inc.php	(revision 6832)
+++ /sandbox/2.4.2-expresso1/expressoCalendar/setup/tables_update.inc.php	(revision 6876)
@@ -128,5 +128,7 @@
 	 	$oProc->query("ALTER TABLE calendar_object ADD COLUMN status smallint DEFAULT 0;");
 
-	 	$oProc->query("ALTER TABLE calendar ADD COLUMN type smallint DEFAULT 0;");
+	 	$oProc->query("ALTER TABLE calendar_object ADD COLUMN due smallint DEFAULT 0;");
+
+        $oProc->query("ALTER TABLE calendar ADD COLUMN type smallint DEFAULT 0;");
 	 	$oProc->query("ALTER TABLE calendar_signature ADD COLUMN type smallint DEFAULT 0;");
 
Index: /sandbox/2.4.2-expresso1/prototype/config/schedulable.ini
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/config/schedulable.ini	(revision 6797)
+++ /sandbox/2.4.2-expresso1/prototype/config/schedulable.ini	(revision 6876)
@@ -59,2 +59,3 @@
 percentage = percentage
 status = status
+due = due
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/interceptors/DBMapping.php
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6832)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6876)
@@ -16,23 +16,27 @@
 	    $params['summary'] = 'Evento sem título';
 
-	if (!is_numeric($params['startTime']))
-	    $params['startTime'] = self::parseTimeDate($params['startTime'], $params['timezone']);
-
-	if (!is_numeric($params['endTime'])) {
-	    $params['endTime'] = self::parseTimeDate($params['endTime'], $params['timezone']);
-
-	    if ($params['allDay'])
-		$params['endTime'] = $params['endTime'] + 86400000;
-	}
-
-	$params['rangeEnd'] = $params['endTime'];
-	$params['rangeStart'] = $params['startTime'];
-
-	///////////////////////////////////////////////////////////////////
-
-	$params['dtstamp'] = (isset($params['dtstamp'])) ? $params['dtstamp'] : time() . '000';
-	$params['lastUpdate'] = (isset($params['lastUpdate'])) ? $params['lastUpdate'] : time() . '000';
-	$params['uid'] = isset($params['uid']) ? $params['uid'] : self::_makeUid();
-    }
+    	if (!is_numeric($params['startTime']))
+    	    $params['startTime'] = self::parseTimeDate($params['startTime'], $params['timezone']);
+
+    	if (!is_numeric($params['endTime'])) {
+    	    $params['endTime'] = self::parseTimeDate($params['endTime'], $params['timezone']);
+
+    	    if ($params['allDay'])
+    		$params['endTime'] = $params['endTime'] + 86400000;
+    	}
+
+        if (isset($params['due']) && $params['due'] != '' && !is_numeric($params['due']))
+            $params['due'] = self::parseTimeDate($params['due'], $params['timezone']);
+
+
+    	$params['rangeEnd'] = $params['endTime'];
+    	$params['rangeStart'] = $params['startTime'];
+
+    	///////////////////////////////////////////////////////////////////
+
+    	$params['dtstamp'] = (isset($params['dtstamp'])) ? $params['dtstamp'] : time() . '000';
+    	$params['lastUpdate'] = (isset($params['lastUpdate'])) ? $params['lastUpdate'] : time() . '000';
+    	$params['uid'] = isset($params['uid']) ? $params['uid'] : self::_makeUid();
+        }
 
     static function parseTimeDate($time, $timezone) {
@@ -136,4 +140,6 @@
 		.'calendar_object.dtstart as "startTime", calendar_object.summary as "summary", '
 		.'calendar_object.description as "description", calendar_object.dtend as "endTime" , '
+        .'calendar_object.priority as "priority", calendar_object.due as "due", '
+        .'calendar_object.percentage as "percentage", calendar_object.status as "status", '
 		.'calendar_object.location as "location", calendar_object.allday as "allDay", '
 		.'calendar_object.transp as "transparent", calendar_object.class_id as "class", '
@@ -422,22 +428,28 @@
     public function encodeUpdateSchedulable(&$uri, &$params, &$criteria, $original) {
 
-	$event = Controller::read(array('concept' => 'schedulable', 'id' => $params['id']));
-	
-	if (isset($params['startTime'])) {
-
-	    if (!is_numeric($params['startTime']))
-		$params['startTime'] = self::parseTimeDate($params['startTime'], $event['timezone']);
-
-	    $params['rangeStart'] = $params['startTime'];
-	}if (isset($params['endTime'])) {
-
-	    if (!is_numeric($params['endTime'])) {
-		$params['endTime'] = self::parseTimeDate($params['endTime'], $event['timezone']);
-
-	    if ((isset($params['allDay']) && $params['allDay']) || ( !isset($params['allDay']) && $event['allDay']))
-		$params['endTime'] = $params['endTime'] + 86400000;
-	    }
-	    $params['rangeEnd'] = $params['endTime'];
-	}
+    	$event = Controller::read(array('concept' => 'schedulable', 'id' => $params['id']));
+    	
+    	if (isset($params['startTime'])) {
+
+    	    if (!is_numeric($params['startTime']))
+    		$params['startTime'] = self::parseTimeDate($params['startTime'], $event['timezone']);
+
+    	    $params['rangeStart'] = $params['startTime'];
+    	}
+
+        if (isset($params['endTime'])) {
+
+    	    if (!is_numeric($params['endTime'])) {
+    		$params['endTime'] = self::parseTimeDate($params['endTime'], $event['timezone']);
+
+    	    if ((isset($params['allDay']) && $params['allDay']) || ( !isset($params['allDay']) && $event['allDay']))
+    		$params['endTime'] = $params['endTime'] + 86400000;
+    	    }
+    	    $params['rangeEnd'] = $params['endTime'];
+    	}
+
+
+        if (isset($params['due']) && $params['due'] != '' && !is_numeric($params['due']))
+            $params['due'] = self::parseTimeDate($params['due'], $event['timezone']);
     }
 
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/constants.php
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/constants.php	(revision 6797)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/constants.php	(revision 6876)
@@ -56,3 +56,12 @@
 define('CALENDAR_ACL_SHARED', 's');
 define('CALENDAR_ACL_REQUIRED', 'p');
+
+define('PRIORITY_HIGH', 1);
+define('PRIORITY_NORMAL', 2);
+define('PRIORITY_LOW', 3);
+
+define('STATUS_TODO_NEED_ACTION', 1);
+define('STATUS_TODO_IN_PROGRESS', 2);
+define('STATUS_TODO_COMPLETED', 3);
+define('STATUS_TODO_CANCELLED', 4);
 ?>
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css	(revision 6811)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/layout.css	(revision 6876)
@@ -217,13 +217,13 @@
 /* -- event details styles -- */
 
-.new-event-win.active {
+.new-event-win.active, .new-task-win.active {
 	 width:700px;height:510px;text-align:left;
 }
 
-.new-event-win > .content.ui-tabs.ui-widget-content {
+.new-event-win > .content.ui-tabs.ui-widget-content, .new-task-win > .content.ui-tabs.ui-widget-content {
 	border: none;
 }
 
-.new-event-win ul.attendee-permissions-list, li.attendee-permissions-list{text-align: left;}
+.new-event-win ul.attendee-permissions-list, li.attendee-permissions-list, .new-task-win ul.attendee-permissions-list{text-align: left;}
 
 li.attendee-permissions-list input{width: 20px !important; margin: 3px 0 0 0 !important;}
@@ -234,10 +234,15 @@
 p.request-update label{width: 150px !important;}
 
-.new-event-win .menu-addevent {
+.new-event-win .menu-addevent, .new-task-win .menu-addevent {
 	text-align: right;
 }
 
-fieldset.block-add-attendee .add-attendee-search { max-width: 250px; margin: 5px;}
-fieldset.block-add-attendee .add-attendee-search input { max-width: 220px; width: 220px; padding: 0 0 0 7px;}
+.new-event-win fieldset.block-add-attendee .add-attendee-search { max-width: 250px; margin: 5px;}
+.new-task-win fieldset.block-add-attendee .add-attendee-search { max-width: 323px; margin: 5px;}
+
+.new-event-win fieldset.block-add-attendee .add-attendee-search input { max-width: 220px; width: 220px; padding: 0 0 0 7px;}
+.new-task-win fieldset.block-add-attendee .add-attendee-search input { max-width: 290px; width: 290px; padding: 0 0 0 7px;}
+
+
 fieldset.block-add-attendee .search-result-list { width: 255px; max-height: 215px; overflow: auto;}
 fieldset.block-add-attendee .search-result-list .ui-widget-content { border: none;}
@@ -249,5 +254,6 @@
 .block-attendee-list, .block-add-attendee { float:left;}
 .block-attendee-list { width:400px; margin-right: 5px; }
-.block-add-attendee { width:260px; margin-right: 5px; }
+.new-event-win .block-add-attendee { width:260px; margin-right: 5px; }
+.new-task-win .block-add-attendee { width:335px; margin-right: 5px; }
 .block-attendee-list dd, .block-add-attendee dd { border: 1px solid #BFBFBF; }
 .block-attendee-list dt, .block-add-attendee dt { background-color:#FFF; margin: 5px 0 -6px 5px; font-weight: bold; display: table;  position: relative;}
@@ -263,6 +269,12 @@
 }
 
-dl.block-add-attendee dd.add-attendee {
+.new-event-win dl.block-add-attendee dd.add-attendee {
 	width: 260px;
+	min-height: 260px;
+	display: block;
+}
+
+.new-task-win dl.block-add-attendee dd.add-attendee {
+	width: 343px;
 	min-height: 260px;
 	display: block;
@@ -740,18 +752,18 @@
 /* -- alarm dysplay -- */
 
-.new-event-alarm{
+.new-event-alarm, .new-task-alarm{
 	margin: 5px;	
 	font: bold;
 }
 
-.title-event-alarm{
+.title-event-alarm, .title-task-alarm{
 	margin: 5px;
 }
 
-.description-event-alarm{
+.description-event-alarm, .description-task-alarm{
 	margin: 5px;
 }
 
-.inicialize-event-alarm{
+.inicialize-event-alarm, .inicialize-task-alarm{
 	margin: 5px;
 }
@@ -856,7 +868,8 @@
 .ui-dialog .ui-button-text-only .ui-button-text { padding: 0.4em 1em; }
 
-.new-event-win fieldset { border: none;	margin: 0; padding: 0; }
-.new-event-win fieldset.tab-level2 { padding: 0px 5px; }
-.new-event-win fieldset fieldset, .new-event-win fieldset.tab-level2 fieldset { padding: 5px 0; }
+.new-event-win fieldset, .new-task-win fieldset { border: none;	margin: 0; padding: 0; }
+.new-event-win fieldset.tab-level2, .new-task-win fieldset.tab-level2 { padding: 0px 5px; }
+.new-event-win fieldset fieldset, .new-task-win fieldset.tab-level2 fieldset,
+.new-task-win fieldset fieldset, .new-task-win fieldset.tab-level2 fieldset{ padding: 5px 0; }
 
 .hidden {
@@ -899,10 +912,10 @@
 }
 
-.new-event-win div.div-addtask { padding: 0; width: 770px; border: 0;}
+.new-task-win div.div-addtask { padding: 0; width: 770px; border: 0;}
 .new-event-win form.form-addevent { padding: 9px; }
 
 .ui-dialog .ui-dialog-content { padding: 0; }
-.new-event-win div.div-addevent { padding: 0; width: 700px; border: 0;}
-.new-event-win form.form-addevent { padding: 9px; }
+.new-event-win div.div-addevent, .new-task-win div.div-addtask { padding: 0; width: 700px; border: 0;}
+.new-event-win form.form-addevent, .new-task-win form.form-addtask { padding: 9px; }
 
 .expresso-calendar-container input[type="text"] { height: 18px; }
@@ -927,5 +940,5 @@
 
 .expresso-calendar-container input.h1,
-.new-event-win input.h1 {
+.new-event-win input.h1, .new-task-win input.h1 {
 	font-size: 150%;
 	font-weight: bold;
@@ -934,5 +947,5 @@
 }
 
-.new-event-win textarea {
+.new-event-win textarea, .new-task-win textarea {
 	width:600px;
 	height: 210px;
@@ -943,6 +956,6 @@
 span.input-group { display: block; }
 /*p.input-group label { vertical-align: top; }*/
-.new-event-win p.input-group label { display: inline-block; width: 65px;}
-.new-event-win p.input-group label.input-group { display: inline-block; width: 110px; font-weight: bold;}
+.new-event-win p.input-group label, .new-task-win p.input-group label { display: inline-block; width: 65px;}
+.new-event-win p.input-group label.input-group, .new-task-win p.input-group label.input-group { display: inline-block; width: 110px; font-weight: bold;}
 
 input.number {text-align: right}
@@ -964,5 +977,9 @@
 .new-event-win fieldset.event-repeat-container label, 
 .new-event-win p.input-group.event-repeat-weekly label, 
-.new-event-win p.input-group.event-repeat-monthly label {
+.new-event-win p.input-group.event-repeat-monthly label,
+.new-task-win fieldset.task-repeat-container label, 
+.new-task-win p.input-group.task-repeat-weekly label, 
+.new-task-win p.input-group.task-repeat-monthly label
+{
 	width: auto; 
 }
@@ -971,10 +988,15 @@
 .new-event-win fieldset.search-field,
 .new-event-win fieldset.block-add-attendee-permissions,
-.new-event-win fieldset.block-attendee-list {
+.new-event-win fieldset.block-attendee-list,
+.new-task-win fieldset.input-field-rounded,
+.new-task-win fieldset.search-field,
+.new-task-win fieldset.block-add-attendee-permissions,
+.new-task-win fieldset.block-attendee-list
+{
 	border:1px solid #CFCFCF;
 }
 
-.new-event-win fieldset.block-attendee-list { width: 300px; max-height:180px; padding: 5px; float: left;}
-.new-event-win fieldset.block-attendee-list ul {  height:160px; overflow: auto;}
+.new-event-win fieldset.block-attendee-list, .new-task-win fieldset.block-attendee-list { width: 300px; max-height:180px; padding: 5px; float: left;}
+.new-event-win fieldset.block-attendee-list ul, .new-task-win fieldset.block-attendee-list ul {  height:160px; overflow: auto;}
 
 
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/style.css
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/style.css	(revision 6811)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/style.css	(revision 6876)
@@ -45,10 +45,10 @@
 .ui-dialog .ui-button-text-only .ui-button-text { padding: 0.4em 1em; }
 
-.new-event-win fieldset { border: none;	margin: 0; padding: 0; }
-.new-event-win fieldset.tab-level2 { padding: 0px 5px; min-height: 310px; max-height: 310px; overflow: auto;}
-.new-event-win .overflow_add_calender { overflow: auto; max-height: 320px; }
-.new-event-win fieldset#calendar_addevent_details7 { overflow: hidden}
-.new-event-win fieldset#calendar_addevent_details5 .button-files-upload{margin: 15px 0 0 0}
-.new-event-win fieldset fieldset, .new-event-win fieldset.tab-level2 fieldset { padding: 5px 0; }
+.new-event-win fieldset, .new-task-win fieldset  { border: none;	margin: 0; padding: 0; }
+.new-event-win fieldset.tab-level2, .new-task-win fieldset.tab-level2 { padding: 0px 5px; min-height: 310px; max-height: 310px; overflow: auto;}
+.new-event-win .overflow_add_calender, .new-task-win .overflow_add_calender { overflow: auto; max-height: 320px; }
+.new-event-win fieldset#calendar_addevent_details7, .new-task-win fieldset#calendar_addevent_details7 { overflow: hidden}
+.new-event-win fieldset#calendar_addevent_details5 .button-files-upload, .new-task-win fieldset#calendar_addevent_details5 .button-files-upload{margin: 15px 0 0 0}
+.new-event-win fieldset fieldset, .new-event-win fieldset.tab-level2 fieldset, .new-task-win fieldset fieldset, .new-event-win fieldset.tab-level2 fieldset { padding: 5px 0; }
 
 .hidden {
@@ -92,6 +92,7 @@
 
 .ui-dialog .ui-dialog-content { padding: 0; }
-.new-event-win div.div-addevent { padding: 0; width: 700px; border: 0;}
-.new-event-win form.form-addevent { padding: 9px; }
+.new-event-win div.div-addevent{ padding: 0; width: 700px; border: 0;}
+.new-task-win div.div-addtask { padding: 0; width: 774px; border: 0;}
+.new-event-win form.form-addevent, .new-task-win form.form-addtask { padding: 9px; }
 
 .expresso-calendar-container input[type="text"] { height: 18px; }
@@ -116,5 +117,6 @@
 
 .expresso-calendar-container input.h1,
-.new-event-win input.h1 {
+.new-event-win input.h1,
+.new-task-win input.h1{
 	font-size: 150%;
 	font-weight: bold;
@@ -123,5 +125,13 @@
 }
 
-.new-event-win textarea {
+.expresso-calendar-container input.h1,
+.new-task-win input.h1 {
+	font-size: 150%;
+	font-weight: bold;
+	width: 64%;
+	height: 150%;
+}
+
+.new-event-win textarea, .new-task-win textarea {
 	width:600px;
 	height: 210px;
@@ -132,6 +142,6 @@
 span.input-group { display: block; }
 /*p.input-group label { vertical-align: top; }*/
-.new-event-win p.input-group label { display: inline-block; width: 65px;}
-.new-event-win p.input-group label.input-group { display: inline-block; width: 110px; font-weight: bold;}
+.new-event-win p.input-group label, .new-task-win p.input-group label { display: inline-block; width: 65px;}
+.new-event-win p.input-group label.input-group, .new-task-win p.input-group label.input-group { display: inline-block; width: 110px; font-weight: bold;}
 
 input.number {text-align: right}
@@ -153,5 +163,9 @@
 .new-event-win fieldset.event-repeat-container label, 
 .new-event-win p.input-group.event-repeat-weekly label, 
-.new-event-win p.input-group.event-repeat-monthly label {
+.new-event-win p.input-group.event-repeat-monthly label,
+.new-task-win fieldset.task-repeat-container label, 
+.new-task-win p.input-group.task-repeat-weekly label, 
+.new-task-win p.input-group.task-repeat-monthly label
+{
 	width: auto; 
 }
@@ -160,10 +174,14 @@
 .new-event-win fieldset.search-field,
 .new-event-win fieldset.block-add-attendee-permissions,
-.new-event-win fieldset.block-attendee-list {
+.new-event-win fieldset.block-attendee-list,
+.new-task-win fieldset.input-field-rounded,
+.new-task-win fieldset.search-field,
+.new-task-win fieldset.block-add-attendee-permissions,
+.new-task-win fieldset.block-attendee-list{
 	border:1px solid #CFCFCF;
 }
 
-.new-event-win fieldset.block-attendee-list { width: 300px; max-height:180px; padding: 5px; float: left;}
-.new-event-win fieldset.block-attendee-list ul {  height:160px; overflow: auto;}
+.new-event-win fieldset.block-attendee-list, .new-task-win fieldset.block-attendee-list { width: 300px; max-height:180px; padding: 5px; float: left;}
+.new-event-win fieldset.block-attendee-list ul, .new-task-win fieldset.block-attendee-list ul {  height:160px; overflow: auto;}
 
 
@@ -475,4 +493,6 @@
 }
 
+.calendar-addevent-details-txt-timezone, .calendar-addtask-details-txt-timezone{width: 227px;} 
+
 .div-addtask #calendar_addtask_details1 .time-previsao { width: 40px; }
 
@@ -483,5 +503,5 @@
 .div-addtask #calendar_addtask_details1 .end-time{ width: 40px; }
 .div-addtask #calendar_addtask_details1 .end-date{ width: 80px; }
-.div-addtask #calendar_addtask_details1 .previsao-termino { margin: 0 0 0 50px; }
+.div-addtask #calendar_addtask_details1 .previsao-termino { margin: 0 0 0 5px; }
 .div-addtask #calendar_addtask_details1 .subitem { margin: 5px; display: block;}
 .div-addtask #calendar_addtask_details1 .subitem .span_done{ margin: 0 30px;}
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 6797)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js	(revision 6876)
@@ -596,4 +596,209 @@
 });
 
+DataLayer.codec( "schedulable", "task", {
+
+    decoder: function( evtObj ){
+    Encoder.EncodeType = "entity";
+    
+    if( notArray = $.type(evtObj) !== "array" )
+        evtObj = [ evtObj ];
+
+    var pref = User.preferences;
+
+    var res = $.map(evtObj, function( form ){
+    
+        var tzId =  form.timezone || Calendar.signatureOf[form.group].calendar.timezone || User.preferences.timezone,
+
+        formatString = pref.dateFormat + " " + pref.hourFormat;
+
+        return DataLayer.merge({
+        "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 ),      
+        status: form.taskStatus,      
+        id: form.idTask,
+        location: form.location,
+        type: 2,
+        percentage: form.percentage,
+        priority: form.priority,
+        category: form.category,
+        summary: form.summary,
+        description: form.description,
+        timezone: tzId,
+        attachments: $.map(form.attachment || [], function( attachment, i ){
+            return {
+            attachment: attachment
+            }
+        }),
+        participants: $.map( form.attendee || [], function( attendee, i ){
+
+            if( !attendee || attendee === "" )
+            return( null );
+
+            var participant = {};
+            participant.user = (attendee!= User.me.id) ? DataLayer.get('participant', attendee).user : attendee ;
+
+            if( participant.user === User.me.id ){
+            return DataLayer.merge({
+                id: attendee,
+                isOrganizer: (form.attendee_organizer == attendee ? 1 : 0 ),
+                alarms: participant.alarms = $.map( form.alarmTime || [], function( alarmTime, i ){
+                if( alarmTime === "" )
+                    return( null );
+                return !!form.alarmId[i] ? {
+                    type: form.alarmType[i], 
+                    unit: form.alarmUnit[i], 
+                    time: form.alarmTime[i], 
+                    id: form.alarmId[i]
+                    }:
+
+                    {
+                    type: form.alarmType[i],
+                    unit: form.alarmUnit[i], 
+                    time: form.alarmTime[i]
+                    };
+                }),
+                status: !!form.status ? form.status : 3
+            }, (form.delegatedFrom[i] != '0' && form.delegatedFrom[i] != '')  ? {
+                delegatedFrom: form.delegatedFrom[i]
+                } : {});
+            }else{
+                return {
+                    id: attendee,
+                    isOrganizer: (form.attendee_organizer == attendee ? 1 : 0 ),
+                    isExternal: !!parseInt(form.attendeeType[i]) ? 1 : 0,
+                    };
+            };
+        })
+        }, form.lastGroup ? (( form.lastGroup == form.group ) ? {} : {calendar: form.group, lastGroup: form.lastGroup}) : {calendar: form.group});
+    });
+
+    return notArray ? res[0] : res;
+    },
+
+    encoder: function( evtObj ){
+
+    var notArray = false;
+      
+    if( notArray = $.type(evtObj) !== "array" )
+        evtObj = [ evtObj ];
+
+    var statusParticipants = {},  isAttendee = false,
+   
+    statusLabels = [ '', 'accepted', 'tentative', 'cancelled', 'unanswered', 'delegated' ],
+
+    participantInfo = {}, delegatedFrom = {}, me = DataLayer.copy( User.me );
+    
+    var delegateAttendee = {};
+    
+    for( var i = 0; i < statusLabels.length; i++ )
+        statusParticipants[ statusLabels[i] ] = 0;
+    
+    var res = $.map(evtObj, function( objEvent ){           
+            
+        if(!(typeof(objEvent) == 'object'))
+            return (null);
+
+        var limitAttendee = false;
+
+        return {
+        "class": objEvent["class"],
+        id: objEvent.id,
+        location: objEvent.location,
+        category: objEvent.category,
+        taskStatus: objEvent.status,
+        groups: Calendar.groups,
+        group: objEvent.group,
+        summary: objEvent.summary,
+        description: objEvent.description,
+        timezone: objEvent.timezone,
+        timezones: Timezone.timezones,
+        percentage: (objEvent.percentage) ? objEvent.percentage : '0',
+        priority: objEvent.priority,
+        startDate: new Date( parseInt(objEvent.startTime) ).setTimezoneOffset( Timezone.timezone( objEvent.timezone ) ).toString( User.preferences.dateFormat ),
+        startHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date( parseInt(objEvent.startTime)), objEvent.timezone, objEvent.calendar, objEvent.DayLigth, 'startTime'), User.preferences.hourFormat),
+        endDate: new Date( parseInt(objEvent.endTime) - (!!parseInt(objEvent.allDay) ? 86400000 : 0)  ).setTimezoneOffset( Timezone.timezone( objEvent.timezone ) ).toString( User.preferences.dateFormat ),
+        endHour: dateCalendar.formatDate(Timezone.getDateEvent(new Date(parseInt(objEvent.endTime)),  objEvent.timezone, objEvent.calendar, objEvent.DayLigth, 'endTime'), User.preferences.hourFormat),
+        dueDate: (!objEvent.due || objEvent.due == '' || objEvent.due == '0') ? '' : new Date( parseInt(objEvent.due) ).setTimezoneOffset( Timezone.timezone( objEvent.timezone ) ).toString( User.preferences.dateFormat ),
+        dueTime: (!objEvent.due || objEvent.due == '' || objEvent.due == '0') ? '' : dateCalendar.formatDate(Timezone.getDateEvent(new Date( parseInt(objEvent.due)), objEvent.timezone, objEvent.calendar, objEvent.DayLigth, 'startTime'), User.preferences.hourFormat),
+        allDay: !!parseInt( objEvent.allDay ),
+	    historic: [],
+        attachments: $.map(objEvent.attachments || [], function( attachment, i ){
+            var attach = DataLayer.get('schedulableToAttachment', attachment, false);
+            //TODO - Verificar na API retorno de id sobre os conceitos em que s?o utilizados tabelas de liga??o
+            if(!attach.name) return(null); 
+            
+            var ext = attach.name.split('.');
+            attach.name = attach.name.length < 10 ?  attach.name : ( ext.length == 1 ? attach.name.substr(0, 10) : (attach.name.substr(0, 6) + '.' +  ext[ext.length -1]));
+            attach.size = formatBytes(attach.size);
+            return attach;
+        }),                     
+        attendee: $.map(objEvent.participants || [], function( participant, i ){                        
+
+            if(delegateAttendee[participant])
+                return(null);
+
+            var attend = DataLayer.get('participant', (participant.id || participant));
+            attend.user = DataLayer.get('user', attend.user);
+
+            statusParticipants[ statusLabels[attend.status] ]++;    
+
+            if(attend.user.mail == User.me.mail)
+                isAttendee = true;
+
+            if( attend.user.id ===  me.id ){
+                participantInfo.user = {
+                    id: attend.id,
+                    status : attend.status,
+                    delegatedFrom: attend.delegatedFrom || '0',
+                    acl: attend.acl,
+                    receiveNotification : attend.receiveNotification,
+                    alarms : $.map(attend.alarms || [], function( alarm ){
+                    var alarm = DataLayer.get('alarm', alarm);
+                    return (alarm == "" ? (null) : alarm);
+                    })
+                };
+                me = attend;
+                return(null);
+            };
+
+            var person = {
+                id: attend.id,
+                name: attend.user.name != 'false' ? attend.user.name : '',
+                mail: attend.user.mail,
+                status : attend.status,
+                isExternal: attend.isExternal,
+                acl: attend.acl,
+                delegatedFrom: attend.delegatedFrom
+            };
+
+            if(!!parseInt(attend.delegatedFrom)){
+                delegatedFrom[attend.delegatedFrom] = DataLayer.copy(person);
+                return(null);
+            }
+
+            if( !!parseInt(attend.isOrganizer)){
+                participantInfo.organizer = DataLayer.copy(person);
+                return(null);
+            };                  
+
+            return (person);
+        }),
+        organizer: participantInfo.organizer || me,
+        alarms: !!participantInfo.user ? participantInfo.user.alarms : [],
+        status: !!participantInfo.user ? participantInfo.user.status : 1,
+        isAttendee: isAttendee,
+        me: me,
+        delegatedFrom: delegatedFrom,
+        statusParticipants: (objEvent.sizeAttendees != "") ? objEvent.statusAttendees : statusParticipants,
+        sizeAttendeeLimit: (objEvent.sizeAttendees != "") ? objEvent.sizeAttendees : false
+        };
+    });
+    console.log(res[0]);
+    return (notArray ? res[0] : res);
+    }
+});
 
 function decodeOwnerCalendar(calendar){
@@ -1055,5 +1260,5 @@
 			    ]
 			],
-			['IN', 'calendar',  Calendar.calendarIds]
+			['IN', 'calendar',  $.merge( Calendar.calendarIds, Calendar.groupIds )]
 		], 
 	    criteria: {
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/load.js
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/load.js	(revision 6768)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/load.js	(revision 6876)
@@ -54,10 +54,14 @@
     }
 
-    this.calendarIds = [], this.signatureOf = {}, this.calendars = [], this.calendarOf= {};
+    this.calendarIds = [], this.groupIds = [], this.signatureOf = {}, this.calendars = [], this.groups = [], this.calendarOf = {}, this.groupOf= {};
 
     for( var i = 0; i < this.signatures.length; i++ ){
 	if(this.signatures[i].isOwner == "0")
 	    this.signatures[i].permission =  DataLayer.encode('calendarToPermission:detail', this.signatures[i].permission);
-	this.signatureOf[ this.calendarIds[i] = ( this.calendars[ this.calendars.length ] = this.calendarOf[ this.signatures[i].id ] = this.signatures[i].calendar ).id ] = this.signatures[i];
+
+        if(this.signatures[i].calendar.type == '1')
+           this.signatureOf[ this.groupIds[this.groupIds.length] = ( this.groups[ this.groups.length ] = this.groupOf[ this.signatures[i].id ] = this.signatures[i].calendar ).id ] = this.signatures[i];
+        else
+    	   this.signatureOf[ this.calendarIds[ this.calendarIds.length] = ( this.calendars[ this.calendars.length ] = this.calendarOf[ this.signatures[i].id ] = this.signatures[i].calendar ).id ] = this.signatures[i];
     }
 
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/map.disponibility.js
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/map.disponibility.js	(revision 6444)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/map.disponibility.js	(revision 6876)
@@ -8,10 +8,10 @@
 
 
-function updateMap(data){
-	var start_date = $(".new-event-win.active .start-date").val();
-	var end_date   = $(".new-event-win.active .end-date").val();
-	var start_time = $(".new-event-win.active .start-time").val();
-	var end_time   = $(".new-event-win.active .end-time").val();
-	var isAllDay   = $('.new-event-win.active input[name="allDay"]').is(':checked');
+function updateMap(viewName){
+	var start_date = $(".new-"+viewName+"-win.active .start-date").val();
+	var end_date   = $(".new-"+viewName+"-win.active .end-date").val();
+	var start_time = $(".new-"+viewName+"-win.active .start-time").val();
+	var end_time   = $(".new-"+viewName+"-win.active .end-time").val();
+	var isAllDay   = $('.new-'+viewName+'-win.active input[name="allDay"]').is(':checked');
 	
 	var formatString = User.preferences.dateFormat + " " + User.preferences.hourFormat;
@@ -21,5 +21,5 @@
 	
 	
-	var event = $("#new_event_map").fullCalendar('clientEvents', 'map')[0];
+	var event = $('.new-'+viewName+'-win .map_disponibility').fullCalendar('clientEvents', 'map')[0];
 	
 	
@@ -28,5 +28,5 @@
 			event.end = endDate;
 			event.allDay = isAllDay;
-			$("#new_event_map").fullCalendar( 'updateEvent', event )
+			$('.new-'+viewName+'-win .map_disponibility').fullCalendar( 'updateEvent', event )
 		}
 		
@@ -35,12 +35,14 @@
 
 
-function disponibily(objEvent, path, attendees){
+function disponibily(objEvent, path, attendees, viewName){
 	var formatString = User.preferences.dateFormat + " " + User.preferences.hourFormat;
 	var startDate = Date.parseExact( objEvent.startDate + " " + $.trim(objEvent.startHour) , formatString );
 	var endDate = Date.parseExact( objEvent.endDate + " " + $.trim(objEvent.endHour) , formatString );
+
+    var dialogName = {event: 'addEvent', task: 'addTask', activity: 'addActivity'}
 	 
 	var mapHtml = DataLayer.render( path+'templates/availability_map.ejs', {});
-	$("#calendar_addevent_details7").html(mapHtml);
-	$("#new_event_map").fullCalendar(DataLayer.merge({
+	$('#calendar_add'+viewName+'_details7').html(mapHtml);
+	$('.new-'+viewName+'-win .map_disponibility').fullCalendar(DataLayer.merge({
 		height : 300,
 		timeFormat: User.preferences.hourFormat,
@@ -77,5 +79,5 @@
 			if(!allDay){
 				$('[name="allDay"]').attr("checked", false); 
-				UI.dialogs.addEvent.find('.start-time, .end-time').removeClass('hidden');
+				UI.dialogs[dialogName[viewName]].find('.start-time, .end-time').removeClass('hidden');
 				
 				$('[name="startHour"]').val(start.toString(User.preferences.hourFormat));
@@ -85,5 +87,5 @@
 			}else{
 				$('[name="allDay"]').attr("checked", true); 
-				UI.dialogs.addEvent.find('.start-time, .end-time').addClass('hidden');
+				UI.dialogs[dialogName[viewName]].find('.start-time, .end-time').addClass('hidden');
 			}
 		},
@@ -98,5 +100,5 @@
 				className : "map-event",
 				backgroundColor : "transparent !important",
-				editable : objEvent.acl.write || objEvent.acl.organization
+				editable : objEvent.acl ? (objEvent.acl.write || objEvent.acl.organization) : true
 			}
 		],
@@ -104,5 +106,5 @@
 			if(event.allDay){
 				$('[name="allDay"]').attr("checked", true); 
-				UI.dialogs.addEvent.find('.start-time, .end-time').addClass('hidden');
+				UI.dialogs[dialogName[viewName]].find('.start-time, .end-time').addClass('hidden');
 				
 				$('[name="startDate"]').val(dateCalendar.toString(event.start, User.preferences.dateFormat));				
@@ -111,5 +113,5 @@
 			}else{
 				$('[name="allDay"]').attr("checked", false); 
-				UI.dialogs.addEvent.find('.start-time, .end-time').removeClass('hidden');
+				UI.dialogs[dialogName[viewName]].find('.start-time, .end-time').removeClass('hidden');
 			
 				$('[name="startHour"]').val(dateCalendar.formatDate(event.start, User.preferences.hourFormat));
@@ -132,8 +134,8 @@
 	var eventSource = new Array();
 	var updateMapView = function(){
-		updateMap();
-		var view = $("#new_event_map").fullCalendar('getView');
+		updateMap(viewName);
+		var view = $('.new-'+viewName+'-win .map_disponibility').fullCalendar('getView');
 		var map = {};
-		$("#new_event_map").fullCalendar( 'removeEventSource', eventSource );
+		$('.new-'+viewName+'-win .map_disponibility').fullCalendar( 'removeEventSource', eventSource );
 		eventSource = new Array();	
 		map = {startTime : view.start.getTime(), endTime : view.end.getTime(), attendees: {}, timezone: (objEvent.timezone || User.preferences.timezone)};
@@ -167,12 +169,11 @@
 		}
 		if(eventSource.length)
-			$("#new_event_map").fullCalendar( 'addEventSource', eventSource );
+			$('.new-'+viewName+'-win .map_disponibility').fullCalendar( 'addEventSource', eventSource );
 	}; 
-	$('[href="#calendar_addevent_details7"]').click(function(eventData, eventObject){
-		$("#new_event_map").fullCalendar( 'gotoDate', Date.parseExact($('[name="startDate"]').val() + " " + $.trim($('[name="startHour"]').val()), formatString) , formatString);
-		//if(eventObject == undefined)
-			updateMapView();
+	$('[href="#calendar_add'+viewName+'_details7"]').click(function(eventData, eventObject){
+		$('.new-'+viewName+'-win .map_disponibility').fullCalendar( 'gotoDate', Date.parseExact($('[name="startDate"]').val() + " " + $.trim($('[name="startHour"]').val()), formatString) , formatString);
+		  updateMapView();
 	});	
-	$("#new_event_map").find(".fc-button-prev, .fc-button-next, .fc-button-today").click(function(){
+	$('.new-'+viewName+'-win .map_disponibility').find(".fc-button-prev, .fc-button-next, .fc-button-today").click(function(){
 		updateMapView();
 	});
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6857)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js	(revision 6876)
@@ -942,6 +942,6 @@
     callbackAttendee();
 /**
-				Opções de delegação do participante/organizer
-			*/		
+Opções de delegação do participante/organizer
+*/		
 blkAddAtendee.find(".button.participant-delegate").button({
     icons: {
@@ -971,7 +971,7 @@
 
 UI.dialogs.addEvent.find(".attendee-list-add .add-attendee-input input").Watermark("digite um email para convidar");
-/* Trata a edição de um novo participante adicionado
-			* 
-			*/
+/* 
+ * Trata a edição de um novo participante adicionado
+ */
 var hasNewAttendee = false;
 			
@@ -1197,7 +1197,7 @@
 } else if (!skipAddNewLine) {		
     /**
-						 * a) salva como novo usuario externo no banco (apenas com email) e...
-						 * adiciona novo contato externo à lista de convidados
-						 */
+     * a) salva como novo usuario externo no banco (apenas com email) e...
+     * adiciona novo contato externo à lista de convidados
+     */
 
     userId = DataLayer.put('user', {
@@ -1560,5 +1560,5 @@
 }
 
-disponibily(objEvent, path, attendees);
+disponibily(objEvent, path, attendees, 'event');
 
 /*Seleciona a agenda padrão para criação de um evento*/
@@ -1576,6 +1576,5 @@
 
 UI.dialogs.addEvent.dialog('open');
-//$('[href="#calendar_addevent_details7"]').trigger('click');
-//$('[href="#calendar_addevent_details2"]').trigger('click');
+
 }
 
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 6815)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/task.helpers.js	(revision 6876)
@@ -1,589 +1,641 @@
-function taskDetails( objEvent, decoded, path, isMail, repeat){
+function taskDetails(objTask, decoded, path, isMail, repeat) {
+
+    $('.qtip.qtip-blue').remove();
 
     attendees = {};
-	
-    if(path == undefined)
-	path = "";
-		
-    if( !decoded )
-	objEvent = DataLayer.decode( "schedulable:calendar", objEvent );
-
-    if(!isMail)
-	objEvent = DataLayer.encode( "schedulable:preview", objEvent );
-	
-    if(typeof(objEvent.id) == 'undefined'){
-	objEvent.alarms = Calendar.signatureOf[User.preferences.defaultCalendar || Calendar.calendarIds[0]].defaultAlarms || false;
-	objEvent.useAlarmDefault = 1;
+
+    if (path == undefined) path = "";
+
+    if (!decoded) objTask = DataLayer.decode("task:calendar", objTask);
+
+    if (!isMail) objTask = DataLayer.encode("schedulable:task", objTask);
+
+    if (typeof (objTask.id) == 'undefined') {
+        objTask.alarms = Calendar.signatureOf[User.preferences.defaultCalendar || Calendar.calendarIds[0]].defaultAlarms || false;
+        objTask.useAlarmDefault = 1;
     }
-	
+
+
+    if(objTask.me.id == User.me.id){
+        objTask.me.id = DataLayer.put('participant', {
+            user: objTask.me.id, 
+            mail: objTask.me.mail
+        });
+        objTask.organizer.id = objTask.me.id;
+    }
+
+    var dependsDelegate = function(reference, inverse){
+        if(inverse){
+            if(reference.find('input[name="attendee[]"]').val() == blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val())
+                blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val(blkAddAtendee.find('.me input[name="attendee[]"]').val());
+        }else{
+            if(blkAddAtendee.find('.me input[name="attendee[]"]').val() == blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val())
+                blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val(reference.find('input[name="attendee[]"]').val());
+        }
+    };
+
+    var removeOthers = function(){
+        var other = blkAddAtendee.find('.delegate.attendee-permissions-change-button');
+        if(other.lenght)
+            dependsDelegate(other.parents('li'), true);
+
+        blkAddAtendee.find('.delegate').removeClass('attendee-permissions-change-button');
+        blkAddAtendee.find('.ui-icon-transferthick-e-w').removeClass('attendee-permissions-change');
+    
+    };
+
+    var callbackAttendee = function(){
+        var checked = false;
+        blkAddAtendee.find("li.not-attendee").addClass('hidden');
+        
+        blkAddAtendee.find("li .button").filter(".close.new").button({
+            icons: {
+            primary: "ui-icon-close"
+            },
+            text: false
+        }).click(function () {
+            DataLayer.remove('participant', $(this).parents('li').find('[type=checkbox]').val());
+            if($(this).parent().find('.button.delegate').hasClass('attendee-permissions-change-button')){
+                removeOthers();
+                blkAddAtendee.find('.request-update').addClass('hidden');
+                blkAddAtendee.find('.status option').toggleClass('hidden');
+                        
+                blkAddAtendee.find('option[value=1]').attr('selected','selected').trigger('change');
+            }
+                
+            $(this).parents('li').remove();
+                
+            if(blkAddAtendee.find(".attendee-list li").length == 1)
+                blkAddAtendee.find("li.not-attendee").removeClass('hidden');
+        })
+        .addClass('tiny disable ui-button-disabled ui-state-disabled')
+        .removeClass('new').end()
+        
+        .filter(".delegate.new").button({
+            icons: {
+                primary: "ui-icon-transferthick-e-w"
+            },
+            text: false
+        }).click(function () {
+            var me = $(this).parents('li');
+            if($(this).hasClass('attendee-permissions-change-button')){
+                $(this).removeClass('attendee-permissions-change-button')   
+                .find('.ui-icon-transferthick-e-w').removeClass('attendee-permissions-change').end();               
+            
+                me.find('input[name="delegatedFrom[]"]').val('');
+                dependsDelegate(me, true);
+                        
+                blkAddAtendee.find('.request-update').addClass('hidden');
+                blkAddAtendee.find('.status option').toggleClass('hidden');
+
+                blkAddAtendee.find('option[value=1]').attr('selected','selected').trigger('change');
+                    
+            }else{
+                removeOthers();
+                
+                $(this).addClass('attendee-permissions-change-button')   
+                .find('.ui-icon-transferthick-e-w').addClass('attendee-permissions-change').end();               
+                
+                me.find('input[name="delegatedFrom[]"]').val(blkAddAtendee.find('.me input[name="attendee[]"]').val());
+                
+                dependsDelegate(me, false);
+                    
+                blkAddAtendee.find('.request-update').removeClass('hidden');
+                if(blkAddAtendee.find('.status option.hidden').length == 1)
+                    blkAddAtendee.find('.status option').toggleClass('hidden');
+                    
+                blkAddAtendee.find('option[value=5]').attr('selected','selected').trigger('change');
+            }
+        })
+        .addClass('tiny disable ui-button-disabled ui-state-disabled')
+        .removeClass('new').end()            
+            
+        .filter(".open-delegate.new").click(function(){
+            if($(this).hasClass('ui-icon-triangle-1-e')){
+                $(this).removeClass('ui-icon-triangle-1-e').addClass('ui-icon-triangle-1-s');
+                $(this).parents('li').find('.list-delegates').removeClass('hidden');
+            }else{
+                $(this).removeClass('ui-icon-triangle-1-s').addClass('ui-icon-triangle-1-e');
+                $(this).parents('li').find('.list-delegates').addClass('hidden');
+            }
+            
+        }).removeClass('new');
+
+        UI.dialogs.addTask.find('.attendees-list li').hover(
+            function () {
+                $(this).addClass("hover-attendee");
+                $(this).find('.button').removeClass('disable ui-button-disabled ui-state-disabled').end()
+                .find('.attendee-options').addClass('hover-attendee');
+            },
+            function () {
+                $(this).removeClass("hover-attendee");
+                $(this).find('.button').addClass('disable ui-button-disabled ui-state-disabled').end()
+                .find('.attendee-options').removeClass('hover-attendee');
+            }
+        );        
+    }
+
     /**
-	 * canDiscardEventDialog deve ser true se não houver alterações no evento
-	 */
-    canDiscardEventDialog = true;
+     * canDiscardTaskDialog deve ser true se não houver alterações no task
+     */
+    canDiscardTaskDialog = 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
-	 */
-    zebraDiscardEventDialog = false;
-	
-    /**
-		ACLs do participant
-	*/
-    acl_names = {
-	'w': 'acl-white',
-	'i': 'acl-invite-guests',
-	'p': 'acl-participation-required'
-    };
-
-    var dependsDelegate = function(reference, inverse){
-	if(inverse){
-	    if(reference.find('input[name="attendee[]"]').val() == blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val())
-		blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val(blkAddAtendee.find('.me input[name="attendee[]"]').val());
-	}else{
-	    if(blkAddAtendee.find('.me input[name="attendee[]"]').val() == blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val())
-		blkAddAtendee.find('li.organizer input[name="attendee_organizer"]').val(reference.find('input[name="attendee[]"]').val());
-	}
-	
-    };
-    
-    var removeOthers = function(){
-	var other = blkAddAtendee.find('.delegate.attendee-permissions-change-button');
-	if(other.lenght){
-	    dependsDelegate(other.parents('li'), true);
-	}
-	blkAddAtendee.find('.delegate').removeClass('attendee-permissions-change-button');
-	blkAddAtendee.find('.ui-icon-transferthick-e-w').removeClass('attendee-permissions-change');
-	
-    };
-	
-	var html = DataLayer.render( path+'templates/task_add.ejs', {
-	    event:objEvent
-	});	
-			
-	if (!UI.dialogs.addTask) {
-
-	    UI.dialogs.addTask = jQuery('#sandbox').append('<div title="Criar tarefa" class="new-event-win active"> <div>').find('.new-event-win.active').html(html).dialog({
-		resizable: false, 
-		modal:true, 
-		autoOpen: false,
-		width:774, 
-		position: 'center', 
-		close: function(event, ui) {
-			/**
-			 * Remove tooltip possivelmente existente
-			 */
-			if ($('.qtip.qtip-blue.qtip-active').length)
-				$('.qtip.qtip-blue.qtip-active').qtip('destroy');						
-			attendees  = {};
-		},
-		beforeClose: function(event, ui) {
-		
-		    if (!canDiscardEventDialog && !zebraDiscardEventDialog) {
-			zebraDiscardEventDialog = true;
-			window.setTimeout(function() {
-			    $.Zebra_Dialog('Suas alterações no evento não foram salvas. Deseja descartar as alterações?', {
-				'type':     'question',
-				'overlay_opacity': '0.5',
-				'buttons':  ['Descartar alterações', 'Continuar editando'],
-				'onClose':  function(clicked) {
-				    if(clicked == 'Descartar alterações') {
-					canDiscardEventDialog = true;
-					/**
-					*Remoção dos anexos do eventos caso seja cancelado a edição
-					*/
-					DataLayer.rollback();
-
-					var ids = false;
-					$.each($('.attachment-list input'), function (i, input) {
-					    DataLayer.put('attachment', {id: ''+input.value});
-					    DataLayer.remove('attachment', ''+input.value);
-						ids = true;
-					});
-					if(ids)
-						DataLayer.commit();
-				
-					
-	                                                                                
-					UI.dialogs.addTask.dialog('close');
-				    }else{
-					zebraDiscardEventDialog = 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.
-				    */
-				    if (!clicked) {
-					window.setTimeout(function() {
-					    zebraDiscardEventDialog = false;
-					}, 200);
-				    }
-				}
-			    });
-								
-			}, 300);
-
-		    }
-		    //DataLayer.rollback();
-		    return canDiscardEventDialog;
-		},
-		dragStart: function(event, ui) {
-			if ($('.qtip.qtip-blue.qtip-active').length)
-				$('.qtip.qtip-blue.qtip-active').qtip('destroy');
-		}
-	    });
-				
-	} else {
-	    UI.dialogs.addTask.html(html);
-	}
-		
-var tabs = UI.dialogs.addTask.children('.content').tabs({
-	select: function(event, ui) { 
-		if ($('.qtip.qtip-blue.qtip-active').length)
-			$('.qtip.qtip-blue.qtip-active').qtip('destroy');
-	}	
-	});
-var calendar = DataLayer.get('calendar', objEvent.calendar);
-				
-if (calendar.timezone != objEvent.timezone){
-    UI.dialogs.addTask.find('.calendar-addevent-details-txt-timezone').find('option[value="'+objEvent.timezone+'"]').attr('selected','selected').trigger('change');
-    UI.dialogs.addTask.find('.calendar_addevent_details_lnk_timezone').addClass('hidden');
-    $('.calendar-addevent-details-txt-timezone').removeClass('hidden');
-			
+     * zebraDiscardTaskDialog é uma flag indicando que uma janela de confirmação (Zebra_Dialog)
+     * já estão aberta na tela, uma vez que não é possivel acessar o task ESC utilizado para fechá-la
+     */
+    zebraDiscardTaskDialog = false;
+
+    var html = DataLayer.render(path + 'templates/task_add.ejs', {
+        task: objTask
+    });
+
+    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({
+            resizable: false,
+            modal: true,
+            autoOpen: false,
+            width: 774,
+            position: 'center',
+            close: function (event, ui) {
+                /**
+                 * Remove tooltip possivelmente existente
+                 */
+                if ($('.qtip.qtip-blue.qtip-active').length) $('.qtip.qtip-blue.qtip-active').qtip('destroy');
+                attendees = {};
+            },
+            beforeClose: function (event, ui) {
+
+                if (!canDiscardTaskDialog && !zebraDiscardTaskDialog) {
+                    zebraDiscardTaskDialog = true;
+                    window.setTimeout(function () {
+                        $.Zebra_Dialog('Suas alterações na tarefa não foram salvas. Deseja descartar as alterações?', {
+                            'type': 'question',
+                            'overlay_opacity': '0.5',
+                            'buttons': ['Descartar alterações', 'Continuar editando'],
+                            'onClose': function (clicked) {
+                                if (clicked == 'Descartar alterações') {
+                                    canDiscardTaskDialog = true;
+                                    /**
+                                     *Remoção dos anexos da task caso seja cancelado a ediçãoo
+                                     */
+                                    DataLayer.rollback();
+
+                                    var ids = false;
+                                    $.each($('.attachment-list input'), function (i, input) {
+                                        DataLayer.put('attachment', {
+                                            id: '' + input.value
+                                        });
+                                        DataLayer.remove('attachment', '' + input.value);
+                                        ids = true;
+                                    });
+                                    if (ids) DataLayer.commit();
+
+                                    UI.dialogs.addTask.dialog('close');
+                                } else {
+                                    zebraDiscardTaskDialog = false;
+                                }
+
+                                /**
+                                 * Uma vez aberta uma janela de confirmação (Zebra_Dialog), ao fechá-la
+                                 * com ESC, para que o task ESC nÃo seja propagado para fechamento da
+                                 * janela de edição de tasks, deve ser setada uma flag indicando que
+                                 * já existe uma janela de confirmação aberta.
+                                 */
+                                if (!clicked) {
+                                    window.setTimeout(function () {
+                                        zebraDiscardTaskDialog = false;
+                                    }, 200);
+                                }
+                            }
+                        });
+
+                    }, 300);
+
+                }
+                //DataLayer.rollback();
+                return canDiscardTaskDialog;
+            },
+            dragStart: function (task, ui) {
+                if ($('.qtip.qtip-blue.qtip-active').length) $('.qtip.qtip-blue.qtip-active').qtip('destroy');
+            }
+        });
+
+    } else {
+        UI.dialogs.addTask.html(html);
+    }
+
+    var tabs = UI.dialogs.addTask.children('.content').tabs({
+        select: function (task, ui) {
+            if ($('.qtip.qtip-blue.qtip-active').length) $('.qtip.qtip-blue.qtip-active').qtip('destroy');
+        }
+    });
+    var group = DataLayer.get('calendar', objTask.group);
+
+    if (group.timezone != objTask.timezone) {
+        UI.dialogs.addTask.find('.calendar-addtask-details-txt-timezone').find('option[value="' + objTask.timezone + '"]').attr('selected', 'selected').trigger('change');
+        UI.dialogs.addTask.find('.calendar_addtask_details_lnk_timezone').addClass('hidden');
+        $('.calendar-addtask-details-txt-timezone').removeClass('hidden');
+
+    }
+
+    UI.dialogs.addTask.find('.calendar_addtask_details_lnk_timezone').click(function (e) {
+        $(this).addClass('hidden');
+        $('.calendar-addtask-details-txt-timezone').removeClass('hidden');
+        e.prtaskDefault();
+    });
+
+    UI.dialogs.addTask.find('.button.remove').button({
+    text:false, 
+    icons:{
+        primary:'ui-icon-close'
+    }
+    }).click(function(el){
+        var id;
+        if( id = $(this).parent().find('input[name="alarmId[]"]').val())
+        DataLayer.remove('alarm', id);
+        $(this).parent().remove().find('li').is(':empty');
+    });
+
+    /*Seleciona a agenda padrão para visualização edição de um task*/
+    if (objTask.id) UI.dialogs.addTask.find('option[value="' + objTask.group + '"]').attr('selected', 'selected').trigger('change');
+
+    /* Checkbox allday */
+    UI.dialogs.addTask.find('input[name="allDay"]').click(function () {
+        $(this).attr("checked") ? UI.dialogs.addTask.find('.start-time, .end-time').addClass('hidden') : UI.dialogs.addTask.find('.start-time, .end-time').removeClass('hidden');
+        updateMap(true);
+    });
+
+    UI.dialogs.addTask.find('.button').button();
+    UI.dialogs.addTask.find('.button.add').button({
+        icons: {
+            secondary: "ui-icon-plus"
+        }
+    });
+
+    // ==== validation tasks ====
+    UI.dialogs.addTask.find(".input-group .h1").Watermark("Tarefa sem título");
+    if (User.preferences.hourFormat.length == 5) {
+        UI.dialogs.addTask.find(".end-time, .start-time").mask("99:99", {
+            completed: function () {
+                updateMap();
+            }
+        });
+    } else {
+        $.mask.definitions['{'] = '[ap]';
+        $.mask.definitions['}'] = '[m]';
+        UI.dialogs.addTask.find(".end-time, .start-time").mask("99:99 {}", {
+            completed: function () {
+                $(this).val(date.Calendar.defaultToAmPm($(this).val()));
+                $(this).timepicker("refresh");
+                $(this).val($(this).val().replace(/[\.]/gi, ""));
+                updateMap();
+            }
+        });
+    }
+    UI.dialogs.addTask.find(".number").numeric();
+    User.preferences.dateFormat.indexOf('-') > 0 ? UI.dialogs.addTask.find(".date").mask("99-99-9999", {
+        completed: function () {
+            updateMap();
+        }
+    }) : UI.dialogs.addTask.find(".date").mask("99/99/9999", {
+        completed: function () {
+            updateMap();
+        }
+    });
+
+    UI.dialogs.addTask.find(".menu-addtask").children(".delete").click(function () {
+        $.Zebra_Dialog('Tem certeza que deseja excluir esta tarefa?', {
+            'type': 'question',
+            'overlay_opacity': '0.5',
+            'buttons': ['Sim', 'Não'],
+            'onClose': function (clicked) {
+                if (clicked == 'Sim') {
+                    canDiscardTaskDialog = true; /* Remove por filtro */
+                    DataLayer.removeFilter('schedulable', {
+                        filter: ['AND', ['=', 'id', objTask.id],
+                            ['=', 'calendar', objTask.group],
+                            ['=', 'user', (objTask.me.user ? objTask.me.user.id : objTask.me.id)]
+                        ]
+                    });
+                    Calendar.rerenderView(true); /********************/
+                    UI.dialogs.addTask.dialog("close");
+                }
+            }
+        });
+    }).end()
+
+    .children(".cancel").click(function () {
+        UI.dialogs.addTask.dialog("close");
+    }).end()
+
+    .children(".save").click(function () { /* Validação */
+        /*if (msg = validDateTask()) {
+            $(".new-task-win.active").find('.messages-validation').removeClass('hidden').find('.message label').html(msg);
+            return false;
+        }*/
+
+        UI.dialogs.addTask.children().find('form.form-addtask').submit();
+        UI.dialogs.addTask.dialog("close");
+
+    }).end()
+
+    .children(".export").click(function () {
+        UI.dialogs.addTask.children().find(".form-export").submit();
+    });
+
+    var attendeeHtml = DataLayer.render(path + 'templates/attendees_task.ejs', {
+        task: objTask
+    });
+
+    // load template of attendees
+    var blkAddAtendee = UI.dialogs.addTask.find('#calendar_addtask_details6').append(attendeeHtml);
+
+    if(objTask.attendee.length)
+        callbackAttendee();
+
+    /*
+     *   Opções de delegação do participante/organizer
+     */      
+    blkAddAtendee.find(".button.participant-delegate").button({
+        icons: {
+        primary: "ui-icon-transferthick-e-w"
+        },
+        text: false
+    }).click(function () {
+        if($(this).hasClass('attendee-permissions-change-button')){
+        if(!$(this).hasClass('disable')){
+            $(this).removeClass('attendee-permissions-change-button')   
+            .find('.ui-icon-transferthick-e-w').removeClass('attendee-permissions-change').end();               
+            blkAddAtendee.find('.block-add-attendee.search').addClass('hidden');
+            blkAddAtendee.find('.block-add-attendee.search dt').html('Adicionar outros contatos');
+        }
+        }else{                                  
+        $(this).addClass('attendee-permissions-change-button')   
+        .find('.ui-icon-transferthick-e-w').addClass('attendee-permissions-change').end();               
+        blkAddAtendee.find('.block-add-attendee.search dt').html('Delegar participação para');
+        blkAddAtendee.find('.block-add-attendee.search').removeClass('hidden');
+        blkAddAtendee.find('.block-add-attendee.search input.search').focus();
+        }
+    })
+    .addClass('tiny');
+
+    var dates = UI.dialogs.addTask.find('input.date').datepicker({
+        dateFormat: User.preferences.dateFormat.replace(/M/g, 'm').replace(/yyyy/g, 'yy'),
+        onSelect: function (selectedDate) {
+            updateMap();
+        }
+    });
+
+    UI.dialogs.addTask.find('input.time').timepicker({
+        closeText: 'Ok',
+        hourGrid: 4,
+        minuteGrid: 10,
+        ampm: ((User.preferences.hourFormat.length > 5) ? true : false),
+        timeFormat: "hh:mm tt",
+        onSelect: function (selectedDateTime) {
+            if (!(User.preferences.hourFormat.length == 5)) $(this).val(selectedDateTime.replace(/[\.]/gi, ""));
+            updateMap();
+        },
+        onClose: function (selectedDateTime) {
+            if (!(User.preferences.hourFormat.length == 5)) $(this).val(selectedDateTime.replace(/[\.]/gi, ""));
+        }
+    });
+
+    blkAddAtendee.find('.add-attendee-search .ui-icon-search').click(function (task) {
+        blkAddAtendee.find('.add-attendee-search input').keydown();
+    });
+
+    blkAddAtendee.find('.add-attendee-search input').keydown(function (task) {
+
+        if (task.keyCode == '13' || typeof (task.keyCode) == 'undefined') {
+            var result = DataLayer.get('user', ["*", "name", $(this).val()], true);
+
+            /**
+             * TODO: trocar por template
+             */
+            blkAddAtendee.find('ul.search-result-list').empty().css('overflow', 'hidden');
+            if (!result) {
+                blkAddAtendee.find('ul.search-result-list').append('<li><label class="empty">Nenhum resultado encontrado.</label></li>');
+            }
+
+            for (i = 0; i < result.length; i++)
+            result[i].enabled = (blkAddAtendee.find('dd.attendee-list ul.attendee-list label.mail[title="' + result[i].mail + '"]').length) ? false : true;
+
+            blkAddAtendee.find('ul.search-result-list').append(DataLayer.render(path + 'templates/participants_search_itemlist.ejs', result));
+
+            blkAddAtendee.find('ul.search-result-list li').click(function (task, ui) {
+                if ($(task.target).is('input')) {
+                    old_item = $(task.target).parents('li');
+                    newAttendeeId = DataLayer.put('participant', {
+                        user: old_item.find('.id').html(),
+                        isExternal: old_item.find('.isExternal').html()
+                    });
+
+                    attendees[old_item.find('.id').html()] = old_item.find('.name').html();
+
+                    blkAddAtendee.find('dd.attendee-list ul.attendee-list').append(DataLayer.render(path + 'templates/participants_add_itemlist.ejs', [{
+                        id: newAttendeeId,
+                        name: old_item.find('.name').html(),
+                        mail: old_item.find('.mail').html(),
+                        isExternal: old_item.find('.isExternal').html(),
+                        notEvent: true,
+                        isDirty: !! !objTask.id
+                    }])).scrollTo('max');
+                    /**
+                     * Delegação de participação de um participante com permissão apenas de leitura
+                     *
+                     */
+                    if (objTask.me.id != objTask.organizer.id) {
+
+                        blkAddAtendee.find('.block-add-attendee.search').addClass('hidden');
+                        blkAddAtendee.find('.block-add-attendee.search dt').html('Adicionar outros contatos');
+
+                        blkAddAtendee.find('.status option').toggleClass('hidden');
+                        blkAddAtendee.find('option[value=5]').attr('selected', 'selected').trigger('change');
+                        blkAddAtendee.find('.request-update').removeClass('hidden');
+
+                        blkAddAtendee.find('dd.attendee-list ul.attendee-list li .button.close').parents('li').find('input[name="delegatedFrom[]"]').val(blkAddAtendee.find('.me input[name="attendee[]"]').val());
+
+                        blkAddAtendee.find('.me .participant-delegate').addClass('disable ui-button-disabled ui-state-disabled');
+                        blkAddAtendee.find(".button.close").button({
+                            icons: {
+                                primary: "ui-icon-close"
+                            },
+                            text: false
+                        }).click(function () {
+
+                            $(this).parents('li').find('input[name="delegatedFrom[]"]').val('');
+                            blkAddAtendee.find('.request-update').addClass('hidden');
+                            blkAddAtendee.find('.status option').toggleClass('hidden');
+                            blkAddAtendee.find('option[value=1]').attr('selected', 'selected').trigger('change');
+                            blkAddAtendee.find('.me .participant-delegate').removeClass('disable ui-button-disabled ui-state-disabled attendee-permissions-change-button').find('.ui-icon-person').removeClass('attendee-permissions-change').end();
+
+                            DataLayer.remove('participant', $(this).parents('li').find('[type=checkbox]').val());
+                            $(this).parents('li').remove();
+                        }).addClass('tiny');
+                    } else {
+                        callbackAttendee();
+                        old_item.remove();
+                    }
+                }
+            });
+
+            event.preventDefault();
+        }
+    });
+
+    UI.dialogs.addTask.find('.row.fileupload-buttonbar-task .button').filter('.delete').button({
+        icons: {
+            primary: "ui-icon-close"
+        },
+        text: 'Excluir'
+    }).click(function () {
+        $.Zebra_Dialog('Tem certeza que deseja excluir todos anexos?', {
+            'type': 'question',
+            'overlay_opacity': '0.5',
+            'buttons': ['Sim', 'NÃ£o'],
+            'onClose': function (clicked) {
+                if (clicked == 'Sim') {
+
+                    var ids = [];
+                    $.each($('.attachment-list input'), function (i, input) {
+                        DataLayer.remove('schedulableToAttachment', {
+                            filter: ['=', 'id', '' + input.value]
+                        });
+                    });
+                    $('.attachment-list input').remove();
+                    $('.row.fileupload-buttonbar .attachments-list p').remove();
+                }
+            }
+        });
+    }).end().filter('.close').button({
+        icons: {
+            primary: "ui-icon-close"
+        },
+        text: false
+    }).click(function () {
+        DataLayer.remove('schedulableToAttachment', $(this).parents('p').find('input[name="fileId[]"]').val());
+        $(this).parents('p').remove();
+    }).end().filter('.downlaod-archive').button({
+        icons: {
+            primary: "ui-icon-arrowthickstop-1-s"
+        },
+        text: false
+    });
+    var maxSizeFile = 2000000;
+    $('#fileupload').fileupload({
+        sequentialUploads: true,
+        add: function (e, data) {
+            if (data.files[0].size < maxSizeFile) data.submit();
+        },
+        change: function (e, data) {
+            $.each(data.files, function (index, file) {
+                var attach = {};
+                attach.fileName = file.name;
+                var ext = file.name.split('.');
+                if (file.name.length > 10) attach.fileName = ext.length == 1 ? file.name.substr(0, 10) : file.name.substr(0, 6) + '.' + ext[ext.length - 1];
+                attach.fileSize = formatBytes(file.size);
+                if (file.size > maxSizeFile) attach.error = 'Tamanho de arquivo nao permitido!!'
+
+                $('.attachments-list').append(DataLayer.render(path + 'templates/attachment_add_itemlist.ejs', {
+                    file: attach
+                }));
+
+                if (file.size < maxSizeFile) {
+                    $('.fileinput-button.new').append(data.fileInput[0]).removeClass('new');
+                    $('.attachments-list').find('[type=file]').addClass('hidden');
+
+                } else $('.fileinput-button.new').removeClass('new');
+
+
+                $('.attachments-list').find('.button.close').button({
+                    icons: {
+                        primary: "ui-icon-close"
+                    },
+                    text: false
+                }).click(function () {
+                    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+                    $('.attachment-list').find('input[value="' + idAttach + '"]')
+                    $(this).parent().remove();
+                });
+
+            })
+        },
+        done: function (e, data) {
+            var currentUpload = $('.progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
+
+            if ( !! data.result && data.result != "[]") {
+                var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
+                $('.attachment-list').append('<input tyepe="hidden" name="attachment[]" value="' + newAttach['attachment'][0][0].id + '"/>');
+                currentUpload.removeClass('on-complete').parents('p').append('<input type="hidden" name="fileId[]" value="' + newAttach['attachment'][0][0].id + '"/>').find('.status-upload').addClass('ui-icon ui-icon-check');
+            } else currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
+        }
+    });
+    $('.attachments-list .button').button();
+
+    if ( !! window.FormData) $('#fileupload').bind('fileuploadstart', function () {
+        var widget = $(this),
+            progressElement = $('#fileupload-progress').fadeIn(),
+            interval = 500,
+            total = 0,
+            loaded = 0,
+            loadedBefore = 0,
+            progressTimer, progressHandler = function (e, data) {
+                loaded = data.loaded;
+                total = data.total;
+            },
+            stopHandler = function () {
+                widget.unbind('fileuploadprogressall', progressHandler).unbind('fileuploadstop', stopHandler);
+                window.clearInterval(progressTimer);
+                progressElement.fadeOut(function () {
+                    progressElement.html('');
+                });
+            },
+            formatTime = function (seconds) {
+                var date = new Date(seconds * 1000);
+                return ('0' + date.getUTCHours()).slice(-2) + ':' + ('0' + date.getUTCMinutes()).slice(-2) + ':' + ('0' + date.getUTCSeconds()).slice(-2);
+            },
+
+            formatPercentage = function (floatValue) {
+                return (floatValue * 100).toFixed(2) + ' %';
+            },
+            updateProgressElement = function (loaded, total, bps) {
+                progressElement.html(
+                formatBytes(bps) + 'ps | ' + formatTime((total - loaded) / bps) + ' | ' + formatPercentage(loaded / total) + ' | ' + formatBytes(loaded) + ' / ' + formatBytes(total));
+            },
+            intervalHandler = function () {
+                var diff = loaded - loadedBefore;
+                if (!diff) {
+                    return;
+                }
+                loadedBefore = loaded;
+                updateProgressElement(
+                loaded, total, diff * (1000 / interval));
+            };
+        widget.bind('fileuploadprogressall', progressHandler).bind('fileuploadstop', stopHandler);
+        progressTimer = window.setInterval(intervalHandler, interval);
+    });
+
+    disponibily(objTask, path, attendees, 'task');
+
+    UI.dialogs.addTask.find('.button-add-alarms').click(function () {
+        var li_attach = DataLayer.render(path + 'templates/alarms_add_itemlist.ejs', {
+            type: 1
+        });
+
+        jQuery('.task-alarms-list').append(li_attach).find('.button.remove').button({
+            text: false,
+            icons: {
+                primary: 'ui-icon-close'
+            }
+        }).click(function (el) {
+            $(this).parent().remove().find('li').is(':empty')
+        });
+        // valicacao de campos numericos
+        $('.number').numeric();
+    });
+
+
+    UI.dialogs.addTask.dialog('open');
 }
-
-UI.dialogs.addTask.find('.calendar_addevent_details_lnk_timezone').click(function(e){
-    $(this).addClass('hidden');
-    $('.calendar-addtask-details-txt-timezone').removeClass('hidden');
-    e.preventDefault();
-});
-
-/*Seleciona a agenda padrão para visualização/edição de um evento*/
-if(objEvent.id)
-    UI.dialogs.addTask.find('option[value="'+objEvent.calendar+'"]').attr('selected','selected').trigger('change');
-
-/* Checkbox allday */
-
-UI.dialogs.addTask.find('input[name="allDay"]').click(function(){
-    $(this).attr("checked") ? 
-    UI.dialogs.addTask.find('.start-time, .end-time').addClass('hidden') :
-    UI.dialogs.addTask.find('.start-time, .end-time').removeClass('hidden'); 
-    updateMap(true);
-});
-
-UI.dialogs.addTask.find('.button').button();
-UI.dialogs.addTask.find('.button.add').button({
-    icons: {
-	secondary: "ui-icon-plus"
-    }
-});
-
-// ==== validation events ====
-UI.dialogs.addTask.find(".input-group .h1").Watermark("Tarefa sem título");
-if(User.preferences.hourFormat.length == 5) {
-    UI.dialogs.addTask.find(".end-time, .start-time").mask("99:99", {
-	completed: function(){
-	    updateMap();
-	}
-    });
-} else {
-    $.mask.definitions['{']='[ap]';
-    $.mask.definitions['}']='[m]';
-    UI.dialogs.addTask.find(".end-time, .start-time").mask("99:99 {}", {
-	completed:function(){
-	    $(this).val(date.Calendar.defaultToAmPm($(this).val()));
-	    $(this).timepicker("refresh");
-	    $(this).val($(this).val().replace(/[\.]/gi, ""));
-	    updateMap();
-	}
-    });
-}
-UI.dialogs.addTask.find(".number").numeric();
-User.preferences.dateFormat.indexOf('-') > 0 ? 
-UI.dialogs.addTask.find(".date").mask("99-99-9999", {
-    completed:function(){
-	updateMap();
-    }
-}) : 
-UI.dialogs.addTask.find(".date").mask("99/99/9999", {
-    completed:function(){
-	updateMap();
-    }
-});
-
-UI.dialogs.addTask.find(".menu-addtask")
-.children(".delete").click(function(){
-    $.Zebra_Dialog('Tem certeza que deseja excluir o evento?', {
-	'type':     'question',
-	'overlay_opacity': '0.5',
-	'buttons':  ['Sim', 'Não'],
-	'onClose':  function(clicked) {
-	    if(clicked == 'Sim'){
-		canDiscardEventDialog = true;
-		/* Remove por filtro */
-		DataLayer.removeFilter('schedulable', {filter: ['AND', ['=', 'id', objEvent.id], ['=', 'calendar', objEvent.calendar], ['=','user',(objEvent.me.user ? objEvent.me.user.id : objEvent.me.id)]]});
-		Calendar.rerenderView(true);
-		/********************/
-		UI.dialogs.addTask.dialog("close");
-	    }
-	}
-    });
-}).end()
-	    
-.children(".cancel").click(function(){
-    UI.dialogs.addTask.dialog("close");
-}).end()
-	    
-.children(".save").click(function(){
-    /* Validação */
-    var msg = false;			
-    if(msg = validDateEvent()){
-	$(".new-event-win.active").find('.messages-validation').removeClass('hidden').find('.message label').html(msg); 
-	return false;
-    }
-			
-    canDiscardEventDialog = true;
-			
-    var exit = function(event){
-	if(event)
-	    DataLayer.remove('schedulable', event, false); 
-
-	UI.dialogs.addTask.children().find('form.form-addevent').submit();
-	UI.dialogs.addTask.dialog("close");    }
-                        
-    if(repeat){
-	DataLayer.remove('repeat', false);
-	DataLayer.put('repeat', repeat);
-	DataLayer.commit('repeat', false, exit(repeat.schedulable));
-    }else
-	exit();
-}).end()
-		
-.children(".export").click(function(){
-    UI.dialogs.addTask.children().find(".form-export").submit();
-});
-
-var attendeeHtml = DataLayer.render( path+'templates/attendee_add.ejs', {
-    event:objEvent
-});		
-	
-// load template of attendees
-var blkAddAtendee = UI.dialogs.addTask.find('#calendar_addtask_details6').append(attendeeHtml);
-
-var dates = UI.dialogs.addTask.find('input.date').datepicker({
-    dateFormat: User.preferences.dateFormat.replace(/M/g, 'm').replace(/yyyy/g, 'yy'),
-    onSelect : function( selectedDate ){
-	updateMap();
-    }
-});
-
-UI.dialogs.addTask.find('input.time').timepicker({ 
-    closeText: 'Ok',
-    hourGrid: 4,
-    minuteGrid: 10,
-    ampm : ((User.preferences.hourFormat.length > 5) ? true: false),
-    timeFormat: "hh:mm tt",
-    onSelect: function (selectedDateTime){
-	if(!(User.preferences.hourFormat.length == 5))
-	    $(this).val(selectedDateTime.replace(/[\.]/gi, ""));								
-	updateMap();
-    },
-    onClose : function (selectedDateTime){
-	if(!(User.preferences.hourFormat.length == 5))
-	    $(this).val(selectedDateTime.replace(/[\.]/gi, ""));
-    }
-	
-
-});
-
-blkAddAtendee.find('.add-attendee-search .ui-icon-search').click(function(event) {
-    blkAddAtendee.find('.add-attendee-search input').keydown();
-});
-			
-			
-blkAddAtendee.find('.add-attendee-search input').keydown(function(event) {
-
-    if(event.keyCode == '13' || typeof(event.keyCode) == 'undefined') {			
-	var result = DataLayer.get('user', ["*", "name", $(this).val()], true);
-
-	/**
-        * TODO: trocar por template
-        */
-	blkAddAtendee.find('ul.search-result-list').empty().css('overflow', 'hidden');
-	if (!result) {
-	    blkAddAtendee.find('ul.search-result-list').append('<li><label class="empty">Nenhum resultado encontrado.</label></li>');
-	}
-
-	for(i=0; i<result.length; i++)
-	    result[i].enabled = (blkAddAtendee.find('dd.attendee-list ul.attendee-list label.mail[title="' +  result[i].mail + '"]').length) ? false : true;
-											
-	blkAddAtendee.find('ul.search-result-list').append(DataLayer.render( path+'templates/participants_search_itemlist.ejs', result));
-
-	blkAddAtendee.find('ul.search-result-list li').click(function(event, ui){
-	    if ($(event.target).is('input')) {
-		old_item = $(event.target).parents('li');
-		newAttendeeId = DataLayer.put('participant', {
-		    user: old_item.find('.id').html(), 
-		    isExternal: old_item.find('.isExternal').html()
-		});
-							
-		attendees[old_item.find('.id').html()] = old_item.find('.name').html();
-							
-		blkAddAtendee.find('dd.attendee-list ul.attendee-list')
-		.append(DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{
-		    id: newAttendeeId, 
-		    name: old_item.find('.name').html(), 
-		    mail: old_item.find('.mail').html(), 
-		    isExternal: old_item.find('.isExternal').html(), 
-		    acl: objEvent.acl,
-		    isDirty: !!!objEvent.id
-		    }]))
-		.scrollTo('max');
-		/**
-							* Delegação de participação de um participante com permissão apenas de leitura
-							*
-							*/
-		if(!objEvent.acl.organization && !objEvent.acl.write && !objEvent.acl.inviteGuests && objEvent.acl.read ){
-								
-		    blkAddAtendee.find('.block-add-attendee.search').addClass('hidden');
-		    blkAddAtendee.find('.block-add-attendee.search dt').html('Adicionar outros contatos');
-								
-		    blkAddAtendee.find('.status option').toggleClass('hidden');
-		    blkAddAtendee.find('option[value=5]').attr('selected','selected').trigger('change');
-		    blkAddAtendee.find('.request-update').removeClass('hidden');
-
-		    blkAddAtendee.find('dd.attendee-list ul.attendee-list li .button.close').parents('li').find('input[name="delegatedFrom[]"]').val(blkAddAtendee.find('.me input[name="attendee[]"]').val());
-								
-		    blkAddAtendee.find('.me .participant-delegate').addClass('disable ui-button-disabled ui-state-disabled');
-		    blkAddAtendee.find(".button.close").button({
-			icons: {
-			    primary: "ui-icon-close"
-			},
-			text: false
-		    }).click(function () {
-									
-			$(this).parents('li').find('input[name="delegatedFrom[]"]').val('');
-			blkAddAtendee.find('.request-update').addClass('hidden');
-			blkAddAtendee.find('.status option').toggleClass('hidden');
-			blkAddAtendee.find('option[value=1]').attr('selected','selected').trigger('change');			
-			blkAddAtendee.find('.me .participant-delegate').removeClass('disable ui-button-disabled ui-state-disabled attendee-permissions-change-button')
-			.find('.ui-icon-person').removeClass('attendee-permissions-change').end();               	
-									
-			DataLayer.remove('participant', $(this).parents('li').find('[type=checkbox]').val());
-			$(this).parents('li').remove();
-		    })
-		    .addClass('tiny');
-		}else{
-		    callbackAttendee();
-		    old_item.remove();
-		}
-	    }
-	});
-
-	event.preventDefault();
-    }
-});
-
-UI.dialogs.addTask.find('.row.fileupload-buttonbar .button').filter('.delete').button({
-    icons: {
-	primary: "ui-icon-close"
-    },
-    text: 'Excluir'
-}).click(function () {
-    $.Zebra_Dialog('Tem certeza que deseja excluir todos anexos?', {
-	'type':     'question',
-	'overlay_opacity': '0.5',
-	'buttons':  ['Sim', 'Não'],
-	'onClose':  function(clicked) {
-	    if(clicked == 'Sim'){
-		
-                var ids = [];
-                $.each($('.attachment-list input'), function (i, input) {
-                     DataLayer.remove('schedulableToAttachment', {
-                        filter: ['=', 'id', ''+input.value]
-                        });
-                });
-                $('.attachment-list input').remove();
-                $('.row.fileupload-buttonbar .attachments-list p').remove();
-            }
-        }});
-}).end()
-.filter('.close').button({
-    icons: {
-	primary: "ui-icon-close"
-    },
-    text: false
-}).click(function () {
-    DataLayer.remove('schedulableToAttachment', $(this).parents('p').find('input[name="fileId[]"]').val());
-    $(this).parents('p').remove();
-}).end()
-.filter('.downlaod-archive').button({
-    icons: {
-	primary: "ui-icon-arrowthickstop-1-s"
-    },
-    text: false
-});
-var maxSizeFile = 2000000;
-$('#fileupload').fileupload({
-    sequentialUploads: true,
-    add: function (e, data) {
-	if(data.files[0].size < maxSizeFile)
-	    data.submit();
-    },
-    change: function (e, data) {
-	$.each(data.files, function (index, file) {
-	    var attach = {};
-	    attach.fileName = file.name;
-	    var ext = file.name.split('.');
-	    if(file.name.length > 10)
-		attach.fileName = ext.length == 1 ? file.name.substr(0, 10) :  file.name.substr(0, 6) + '.' + ext[ext.length -1];
-	    attach.fileSize = formatBytes(file.size);
-	    if(file.size > maxSizeFile)
-		attach.error = 'Tamanho de arquivo nao permitido!!'
-				
-	    $('.attachments-list').append(DataLayer.render(path+'templates/attachment_add_itemlist.ejs', {
-		file : attach
-	    }));
-				
-	    if(file.size < maxSizeFile){
-		$('.fileinput-button.new').append(data.fileInput[0]).removeClass('new');
-		$('.attachments-list').find('[type=file]').addClass('hidden');
-					
-	    }else
-		$('.fileinput-button.new').removeClass('new');
-				
-				
-	    $('.attachments-list').find('.button.close').button({
-		icons: {
-		    primary: "ui-icon-close"
-		},
-		text: false
-	    }).click(function(){
-		var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-		$('.attachment-list').find('input[value="'+idAttach+'"]')
-		$(this).parent().remove();
-	    });	
-				
-	})
-	},
-    done: function(e, data){
-	var currentUpload = $('.progress.after-upload:first').removeClass('after-upload').addClass('on-complete').hide();
-
-	if(!!data.result && data.result != "[]"){
-	    var newAttach = (attch = jQuery.parseJSON(data.result)) ? attch : jQuery.parseJSON(data.result[0].activeElement.childNodes[0].data);
-	    $('.attachment-list').append('<input tyepe="hidden" name="attachment[]" value="'+newAttach['attachment'][0][0].id+'"/>');
-	    currentUpload.removeClass('on-complete').parents('p')
-	    .append('<input type="hidden" name="fileId[]" value="'+newAttach['attachment'][0][0].id+'"/>')
-	    .find('.status-upload').addClass('ui-icon ui-icon-check');
-	}else
-	    currentUpload.removeClass('on-complete').parents('p').find('.status-upload').addClass('ui-icon ui-icon-cancel');
-    }
-});
-$('.attachments-list .button').button();
-
-if(!!window.FormData)			
-$('#fileupload').bind('fileuploadstart', function () {
-    var widget = $(this),
-    progressElement = $('#fileupload-progress').fadeIn(),
-    interval = 500,
-    total = 0,
-    loaded = 0,
-    loadedBefore = 0,
-    progressTimer,
-    progressHandler = function (e, data) {
-	loaded = data.loaded;
-	total = data.total;
-    },
-    stopHandler = function () {
-	widget
-	.unbind('fileuploadprogressall', progressHandler)
-	.unbind('fileuploadstop', stopHandler);
-	window.clearInterval(progressTimer);
-	progressElement.fadeOut(function () {
-	    progressElement.html('');
-	});
-    },
-    formatTime = function (seconds) {
-	var date = new Date(seconds * 1000);
-	return ('0' + date.getUTCHours()).slice(-2) + ':' +
-	('0' + date.getUTCMinutes()).slice(-2) + ':' +
-	('0' + date.getUTCSeconds()).slice(-2);
-    },
-    /* formatBytes = function (bytes) {
-            if (bytes >= 1000000000) {
-                return (bytes / 1000000000).toFixed(2) + ' GB';
-            }
-            if (bytes >= 1000000) {
-                return (bytes / 1000000).toFixed(2) + ' MB';
-            }
-            if (bytes >= 1000) {
-                return (bytes / 1000).toFixed(2) + ' KB';
-            }
-            return bytes + ' B';
-        },*/
-    formatPercentage = function (floatValue) {
-	return (floatValue * 100).toFixed(2) + ' %';
-    },
-    updateProgressElement = function (loaded, total, bps) {
-	progressElement.html(
-	    formatBytes(bps) + 'ps | ' +
-	    formatTime((total - loaded) / bps) + ' | ' +
-	    formatPercentage(loaded / total) + ' | ' +
-	    formatBytes(loaded) + ' / ' + formatBytes(total)
-	    );
-    },
-    intervalHandler = function () {
-	var diff = loaded - loadedBefore;
-	if (!diff) {
-	    return;
-	}
-	loadedBefore = loaded;
-	updateProgressElement(
-	    loaded,
-	    total,
-	    diff * (1000 / interval)
-	    );
-    };
-    widget
-    .bind('fileuploadprogressall', progressHandler)
-    .bind('fileuploadstop', stopHandler);
-    progressTimer = window.setInterval(intervalHandler, interval);
-});
-	
-if(objEvent.isShared){
-		
-    var acls = Calendar.signatureOf[objEvent.calendar].permission.acl;
-		
-    if(!acls.write){
-	UI.dialogs.addTask.find(':input').attr('disabled', 'disabled');
-	UI.dialogs.addTask.find('.button').hide();
-    }
-		
-    if(acls.remove)
-	UI.dialogs.addTask.find('.button.remove').show();
-    
-    UI.dialogs.addTask.find('.button.cancel').show();	
-}
-
-disponibily(objEvent, path, attendees);
-
-UI.dialogs.addTask.find('.button-add-alarms').click(function(){
-    var li_attach = DataLayer.render(path+'templates/alarms_add_itemlist.ejs', {type: 1});
-
-    jQuery('.task-alarms-list').append(li_attach).find('.button.remove').button({
-	text:false, 
-	icons:{
-	    primary:'ui-icon-close'
-	}
-    }).click(function(el) {
-		$(this).parent().remove().find('li').is(':empty')
-	});
-// valicacao de campos numericos
-$('.number').numeric();
-});
-
-
-UI.dialogs.addTask.dialog('open');
-}
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6857)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6876)
@@ -247,7 +247,5 @@
 
     			    $('.qtip-active .button.advanced').button().click(function(){
-    			    	
-    					$(componente).qtip('destroy');
-    					
+
     			    	var startEvent = new Date();
     					var configData = (startEvent.toString('mm') < 30)  ? {minutes: (30 - parseInt(startEvent.toString('mm')))} : {hours: 1, minutes: '-'+startEvent.toString('mm')};
@@ -255,11 +253,15 @@
     			
 						var componente = $(this);
-
-    					taskDetails({ 
+                        var description = $('div.qtip div.add-simple-task textarea[name="description"]').val();
+
+    					taskDetails({
+                            summary: $('div.qtip div.add-simple-task input[name="summary"]').val(),
+                            description: description == 'Descrição' ? '' : description,
     						startTime: startEvent.getTime(),
     						endTime: dateCalendar.decodeRange(startEvent, (!!User.preferences.defaultCalendar ? (	!!Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration ?  
     							(Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration) : (User.preferences.defaultDuration)) : (User.preferences.defaultDuration)))
     					}, true );
-    			
+
+                        $(componente).qtip('destroy');
     			    });
     								
@@ -450,10 +452,13 @@
                             }else{
 				var schedulable = DataLayer.get( "schedulable", evt.id);
-				schedulable.calendar = evt.calendar;
+				schedulable.group = evt.calendar;
 				eventDetails( schedulable, true);
 			    }
                         }
-            }else
-				alert('Editar Tarefa');
+            }else{
+                var task = DataLayer.get( "schedulable", evt.id);
+                task.group = evt.calendar;
+                taskDetails( task, true);
+            }
 		},
 		
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_quick_add.ejs
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_quick_add.ejs	(revision 6797)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_quick_add.ejs	(revision 6876)
@@ -1,5 +1,5 @@
 <div class="add-simple-task">
 
-	<input type="text" class="task" name="title" value=""/>
+	<input type="text" class="task" name="summary" value=""/>
 	<textarea name="description" class="task"></textarea>
 
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/availability_map.ejs
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/availability_map.ejs	(revision 5636)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/availability_map.ejs	(revision 6876)
@@ -1,4 +1,4 @@
-<fieldset id="availability_map" class="tab-level2">
-	<div id="new_event_map" class="map" style="width : 100%;">
+<fieldset class="tab-level2">
+	<div class="map_disponibility" style="width : 100%;">
 	</div>
 </fieldset>
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 6811)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/task_add.ejs	(revision 6876)
@@ -1,28 +1,28 @@
 <div title="Criar Tarefa" class="div-addtask content">
-    <form method="POST" action="<%=(data.event.acl.organization || data.event.acl.write) ?  "schedulable:detail" : "schedulable:preview"%>" class="form-addevent content">
+    <form method="POST" action="schedulable:task" class="form-addtask content">
 
 	<fieldset id="calendar_addtask_details1">
 		<legend class="hidden">Detalhes da tarefa</legend>
 		<p class="input-group">
-			<input type="text" class="h1" name="summary" <%=(data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> value="<%= (data.event.summary) ? data.event.summary : '' %>"/>
-			<% if( data.event.id ){ %>
-				<input type="hidden" class="id-event" name="idEvent" value="<%= data.event.id %>"/>
-			<% } %>
-                        <% if( data.event.id && data.event.calendar ){ %>
-				<input type="hidden" class="last-calendar" name="lastCalendar" value="<%= data.event.calendar %>"/>
-			<% } %>
+		    <input type="text" class="h1" name="summary" value="<%= (data.task.summary) ? data.task.summary : '' %>"/>
+		    <% if( data.task.id ){ %>
+			    <input type="hidden" class="id-task" name="idTask" value="<%= data.task.id %>"/>
+		    <% } %>
+		    <% if( data.task.id && data.task.group ){ %>
+    			<input type="hidden" class="last-group" name="lastGroup" value="<%= data.task.group %>"/>
+		    <% } %>
 		</p>
 		<p class="input-group date-info">
-			<input type="text" class="date start-date" value="<%= (data.event.startDate) ? data.event.startDate : '' %>" <%=(data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> name="startDate" />
-			<input type="text" class="time start-time<%= (data.event.allDay) ? ' hidden' : '' %>" value="<%= (data.event.startHour) ? data.event.startHour : '' %>" <%= (data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> name="startHour" /> 
+			<input type="text" class="date start-date" value="<%= (data.task.startDate) ? data.task.startDate : '' %>" name="startDate" />
+			<input type="text" class="time start-time<%= (data.task.allDay) ? ' hidden' : '' %>" value="<%= (data.task.startHour) ? data.task.startHour : '' %>" name="startHour" /> 
 			<span>até</span>
-			<input type="text" class="date end-date" value="<%= (data.event.endDate) ? data.event.endDate : '' %>" <%= (data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> name="endDate" />
-			<input type="text" class="time end-time<%= (data.event.allDay) ? ' hidden' : '' %>" value="<%= (data.event.endHour) ? data.event.endHour : '' %>" <%=(data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> name="endHour" />
+			<input type="text" class="date end-date" value="<%= (data.task.endDate) ? data.task.endDate : '' %>" name="endDate" />
+			<input type="text" class="time end-time<%= (data.task.allDay) ? ' hidden' : '' %>" value="<%= (data.task.endHour) ? data.task.endHour : '' %>" name="endHour" />
 
 				<span class="previsao-termino">Previsão término:</span>
-				<input type="text" class="date date-previsao">
-				<input type="text" class="time time-previsao">
-
-				<a href="#" class="calendar_addevent_details_lnk_timezone <%=((!data.event.acl.organization || !data.event.acl.write) && (data.event.id)) ? "hidden" : '' %>">Fuso horário</a>
+				<input type="text" name="dueDate" class="date date-previsao" value="<%= data.task.dueDate %>">
+				<input type="text" name="dueTime" class="time time-previsao" value="<%= data.task.dueTime %>">
+
+				<a href="#" class="calendar_addtask_details_lnk_timezone">Fuso horário</a>
 			
 			
@@ -30,11 +30,9 @@
 			<select name="timezone" class="hidden calendar-addtask-details-txt-timezone">
 				<option value="">- None selected -</option>
-				<% for( var tzId in data.event.timezones ){ %>
-				  <option value="<%= tzId %>" <%= data.timezone === tzId ? 'selected="selected"' : '' %>><%= tzId + ' (' + data.event.timezones[ tzId ] + ')' %></option>
+				<% for( var tzId in data.task.timezones ){ %>
+				  <option value="<%= tzId %>" <%= data.timezone === tzId ? 'selected="selected"' : '' %>><%= tzId + ' (' + data.task.timezones[ tzId ] + ')' %></option>
 				<% } %>
 			</select>
-			
-			<a class="button suggestion-hours small <%=(data.event.acl.organization || data.event.acl.write || !data.event.isAttendee) ? "hidden" : '' %>" href="#">Sugerir horário</a>
-			
+
 		</p>
 				
@@ -49,22 +47,26 @@
 		
 		<p class="input-group task-type">
-			<input type="checkbox" name="allDay" value="true" <%= (data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> <%= (data.event.allDay) ? 'checked="checked"' : '' %>/>
+			<input type="checkbox" name="allDay" value="true" <%= (data.task.allDay) ? 'checked="checked"' : '' %>/>
 			<label for="allDay">Dia inteiro</label>
 <!--
 			<input type="checkbox" class="button-repeat" />
-			<label for="calendar_addevent_details_chk_repeat">Repetir</label>-->
+			<label for="calendar_addtask_details_chk_repeat">Repetir</label>-->
 		</p>
 		<div class="subitem">
-				% Conclusão: <input type="number" class="done" value="1"> 
-				<span class="span_done"><input type="checkbox" class="button-repeat" /> Completo<span>
-				<select style="margin: 0 0 0 20px;">
-					<option>Desenvolvimento</option>
-				</select>
-				<span style="margin:0 0 0 20px;">Prioridade<span> 
-				<select>
-					<option>Alta</option>
-					<option selected="selected">Média</option>
-					<option>Baixa</option>
-				</select>
+				% Conclusão: <input type="number" name="percentage" class="done" value="<%= data.task.percentage %>"> 
+				<span style="margin:0 0 0 5px;">Status:<span> 
+                <select name="taskStatus" style="margin: 0 0 0 5px;">
+                    <option <%= (data.task.taskStatus == '1') ? 'selected="selected"' : '' %> value="1">Sem ações</option>
+                    <option <%= (data.task.taskStatus == '2') ? 'selected="selected"' : '' %> value="2">Em Processo</option>
+                    <option <%= (data.task.taskStatus == '3') ? 'selected="selected"' : '' %> value="3">Finalizada</option>
+					<option <%= (data.task.taskStatus == '4') ? 'selected="selected"' : '' %> value="4">Cancelada</option>
+				</select>
+				<span style="margin:0 0 0 5px;">Prioridade<span> 
+				<select name="priority">
+					<option <%= (data.task.priority == '1') ? 'selected="selected"' : '' %> value="1">Alta</option>
+					<option <%= (data.task.priority == '2') ? 'selected="selected"' : '' %> value="2">Normal</option>
+					<option <%= (data.task.priority == '3') ? 'selected="selected"' : '' %> value="3">Baixa</option>
+				</select>
+                <span class="span_done"><img src="../prototype/modules/calendar/img/empty-status.png"/> Completo<span>
 		</div>
 	</fieldset>
@@ -78,50 +80,27 @@
 	</ul>
 	<fieldset id="calendar_addtask_details2" class="tab-level2">
-		<legend class="hidden">Detalhes do evento</legend>
+		<legend class="hidden">Detalhes da tarefa</legend>
 
 		<p class="input-group">
 			<label for="calendar_addtask_details_txtarea_description" class="for-textarea" >Descrição</label>
-			<textarea name="description" <%= (data.event.acl.organization || data.event.acl.write) ? '' : 'disabled="disabled"' %> ><%=(data.event) ? data.event.description : '' %></textarea>
+			<textarea name="description"><%=(data.task) ? data.task.description : '' %></textarea>
 		</p>
 
 		<p class="input-group">
 			<label for="calendar_addtask_details_slt_cal">Grupo</label>
-				<select>
+				<select  name="group" >
 					<% 
-					  for (var i=0; i< data.event.calendars.length; i++) {
-					  console.log(data);
-					    if(data.event.calendars[i].id != data.event.calendar && Calendar.signatureOf[data.event.calendars[i].id].isOwner != '1' && (!Calendar.signatureOf[data.event.calendars[i].id].permission.acl.write) )
-						continue;
+					  for (var i=0; i< data.task.groups.length; i++) {
 					%>
-					      <option value="<%= data.event.calendars[i].id %>" <%= data.event.calendars[i].id == data.event.calendar ? 'selected="selected"':'' %>>
-					      <%= data.event.calendars[i].name %>
+					      <option value="<%= data.task.groups[i].id %>" <%= data.task.groups[i].id == data.task.group ? 'selected="selected"':'' %>>
+					      <%= data.task.groups[i].name %>
 					      </option>
 					<% } %>
 				</select>
-			<!--<select name="calendar" >
-			<% 
-			  for (var i=0; i< data.event.calendars.length; i++) {
-			    if(data.event.calendars[i].id != data.event.calendar && Calendar.signatureOf[data.event.calendars[i].id].isOwner != '1' && !Calendar.signatureOf[data.event.calendars[i].id].permission.acl.write)
-				continue;
-			%>
-			      <option value="<%= data.event.calendars[i].id %>" <%= data.event.calendars[i].id == data.event.calendar ? 'selected="selected"':'' %>>
-			      <%= data.event.calendars[i].name %>
-			      </option>
-			<% } %>
-			</select>
-		-->
 		</p>
 		
 		<fieldset class="hidden">
 			<legend class="hidden">Publicidade</legend>
-			<!--
-			<p class="input-group">
-				<label class="input-group">Mostrar-me como</label>
-				<input type="radio" checked="checked"/>
-				<label for="calendar_addevent_details_rdo_status1">Dispon?vel</label>
-				<input type="radio"/>
-				<label for="calendar_addevent_details_rdo_status2">Ocupado</label>
-			</p>
-			-->
+
 			<p class="input-group">
 				<label class="input-group">Privacidade</label>
@@ -142,5 +121,5 @@
 		<legend class="hidden">Lembretes</legend>
 		
-		<p class="default-alarm-event <%= (!data.event.id && data.event.alarms) ? '' : 'hidden'%>">
+		<p class="default-alarm-task <%= (!data.task.id && data.task.alarms) ? '' : 'hidden'%>">
 			<input type="checkbox" name="defaultAlarm" value="true" checked="checked"/>
 			<label class="input-default-alarm" for="defautAlarm">Usar alarmes padrões</label>
@@ -148,23 +127,23 @@
 	
 		<ul class="task-alarms-list">
-			<% if (data.event && data.event.alarms) {
-				for (var i=0; i< data.event.alarms.length; i++) {
+			<% if (data.task && data.task.alarms) {
+				for (var i=0; i< data.task.alarms.length; i++) {
 			%>
 			<li class="input-group">
 				<label>Avisar-me por </label>
 				<select name="alarmType[]">
-                                    <option value="alert" <%= data.event.alarms[i].type=='alert' ? 'selected="selected"':'' %>>Alerta</option>
-                                    <option value="mail" <%= data.event.alarms[i].type=='mail' ? 'selected="selected"':'' %>>E-mail</option>
-                                    <!--<option value="sms" <%= data.event.alarms[i].type=='sms' ? 'selected="selected"':'' %>>SMS</option>-->
-				</select>
-				<input type="text" name="alarmTime[]" class="number input-small" value="<%= data.event.alarms[i].time %>"/>
+                    <option value="alert" <%= data.task.alarms[i].type=='alert' ? 'selected="selected"':'' %>>Alerta</option>
+                    <option value="mail" <%= data.task.alarms[i].type=='mail' ? 'selected="selected"':'' %>>E-mail</option>
+                    <!--<option value="sms" <%= data.task.alarms[i].type=='sms' ? 'selected="selected"':'' %>>SMS</option>-->
+				</select>
+				<input type="text" name="alarmTime[]" class="number input-small" value="<%= data.task.alarms[i].time %>"/>
 				<select name="alarmUnit[]">
-					<option value="m" <%= data.event.alarms[i].unit=='m' ? 'selected="selected"':'' %>>Minutos</option>
-					<option value="h" <%= data.event.alarms[i].unit=='h' ? 'selected="selected"':'' %>>Horas</option>
-					<option value="d" <%= data.event.alarms[i].unit=='d' ? 'selected="selected"':'' %>>Dias</option>
-				</select>
-				<input type="hidden" name="alarmId[]" value="<%=data.event.useAlarmDefault ? '' : data.event.alarms[i].id%>" />
-				<input type="hidden" name="isDefaultAlarm[]" value="<%=data.event.useAlarmDefault ? 1 : 0%>" />
-				<label> antes de cada evento.</label>
+					<option value="m" <%= data.task.alarms[i].unit=='m' ? 'selected="selected"':'' %>>Minutos</option>
+					<option value="h" <%= data.task.alarms[i].unit=='h' ? 'selected="selected"':'' %>>Horas</option>
+					<option value="d" <%= data.task.alarms[i].unit=='d' ? 'selected="selected"':'' %>>Dias</option>
+				</select>
+				<input type="hidden" name="alarmId[]" value="<%=data.task.useAlarmDefault ? '' : data.task.alarms[i].id%>" />
+				<input type="hidden" name="isDefaultAlarm[]" value="<%=data.task.useAlarmDefault ? 1 : 0%>" />
+				<label> antes de cada tasko.</label>
 				<a class="button remove tiny"></a>
 			</li>
@@ -193,10 +172,10 @@
 
 			<div class="child-bottom">
-				<% for(var i=0; i<15; i++){ %>
-					<div class="child-bottom-each">
-						<div class="date-hour"><span>17/05 - 23:43</span></div>
-						<div class="organization"><span>thiago da silva sauro</span></div>
-					</div>
-				<% } %>
+			    <% for(var i=0; i< data.task.historic.length; i++){ %>
+				<div class="child-bottom-each">
+				    <div class="date-hour"><span><%= data.task.historic[i].date %></span></div>
+				    <div class="organization"><span><%= data.task.historic[i].description %></span></div>
+				</div>
+			    <% } %>
 			</div>
 
@@ -205,7 +184,7 @@
 
 	<fieldset class="attachment-list hidden">
-             <%if(data.event && data.event.attachments){
-                for (var i=0; i< data.event.attachments.length; i++) {%>
-                    <input type="hidden" name="fileId[]" value="<%=data.event.attachments[i].id%>"/>
+             <%if(data.task && data.task.attachments){
+                for (var i=0; i< data.task.attachments.length; i++) {%>
+                    <input type="hidden" name="fileId[]" value="<%=data.task.attachments[i].id%>"/>
                 <%}
             }%>
@@ -219,37 +198,32 @@
         <div class="row fileupload-buttonbar-task">
             <div class="button-files-upload">
-                <!-- The fileinput-button span is used to style the file input field as button -->
-                <%if(data.event.acl.organization || data.event.acl.write){%>
-		    <span class="button btn-success fileinput-button">
+                <!-- The fileinput-button span is used to style the file input field as button --> 
+		      <span class="button btn-success fileinput-button">
                     <span><i class="icon-plus icon-white"></i> Adicionar</span>
                     <input type="file" name="files[]" multiple>
                 </span>
-				<%}%>
-				<%if(data.event.acl.organization || data.event.acl.write){%>
-					<button type="button" class="button btn-danger delete">
-						<i class="icon-trash icon-white"></i> Remover Todos
-					</button>
-				<%}%>
+				<button type="button" class="button btn-danger delete">
+					<i class="icon-trash icon-white"></i> Remover Todos
+				</button>
             </div>
             <div id="fileupload-progress"></div>
             <div class="files-list">
                <ul class="attachments-list">
-			   <%if(data.event && data.event.attachments){
-					for (var i=0; i< data.event.attachments.length; i++) {
-					%>
-						<p class="input-group arquive-info">
-							<label class="lbl-archive-nome">Nome:</label>
-							<span class="archive-nome"><%=data.event.attachments[i].name%></span>
-							
-							<label class="lbl-archive-size">Tamanho:</label>
-							<span class="archive-size"><%=data.event.attachments[i].size%></span>
-							<a href="../prototype/getArchive.php?attachment=<%=data.event.attachments[i].id%>" class="button tiny upload downlaod-archive">Download</a>
-							<%if(data.event.acl.organization || data.event.acl.write){%>
-								<span class="button close tiny upload edit delete-upload" title="Deletar">Deletar</span>
-							<%}%>
-							<input type="hidden" name="fileId[]" value="<%=data.event.attachments[i].id%>"/>
-						</p>
-					<%}
-				}%>
+				<%
+                    for (var i=0; i< data.task.attachments.length; i++) {
+				%>
+					<p class="input-group arquive-info">
+						<label class="lbl-archive-nome">Nome:</label>
+						<span class="archive-nome"><%=data.task.attachments[i].name%></span>
+						
+						<label class="lbl-archive-size">Tamanho:</label>
+						<span class="archive-size"><%=data.task.attachments[i].size%></span>
+						<a href="../prototype/getArchive.php?attachment=<%=data.task.attachments[i].id%>" class="button tiny upload downlaod-archive">Download</a>
+						
+						<span class="button close tiny upload edit delete-upload" title="Deletar">Deletar</span>
+						
+						<input type="hidden" name="fileId[]" value="<%=data.task.attachments[i].id%>"/>
+					</p>
+				<%}%>
 			   
 			   
@@ -263,10 +237,10 @@
 </div>
 	<form action="../prototype/modules/calendar/export.php" method="GET" class="form-export content">
-		<input type="hidden" class="id-task" name="task" value="<%= data.event.id %>"/>
+		<input type="hidden" class="id-task" name="task" value="<%= data.task.id %>"/>
 	</form>
-<!--	<div id="calendar_addevent_addattendee"></div>-->
+<!--	<div id="calendar_addtask_addattendee"></div>-->
 
     <div title="" class="menu-container footer-container menu-addtask">
-	    <% if (data.event.id) { %>
+	    <% if (data.task.id) { %>
 			<a title="Exportar" class="button export" href="#">Exportar</a>
 			<a title="Excluir" class="button delete" href="#">Excluir</a>
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/participants_add_itemlist.ejs
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/participants_add_itemlist.ejs	(revision 6203)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/participants_add_itemlist.ejs	(revision 6876)
@@ -2,8 +2,8 @@
 	<div style="overflow:hidden; width:100%; display:table;">
 		<div class="attendee-options">
-			<%if( !data[0].isDirty && (data[0].acl.organization || data[0].acl.write || data[0].acl.inviteGuests) ){%>
+			<%if( (!data[0].isDirty && data[0].notEvent) || (!data[0].isDirty && data[0].acl && (data[0].acl.organization || data[0].acl.write || data[0].acl.inviteGuests))){%>
 				<a href="#" class="button delegate attendee-options-button-delegate new">Delegar participação a este participante</a>
 			<%}%>
-			<%if(data[0].acl.organization || data[0].acl.write){%>
+			<%if(!data[0].noEvent && data[0].acl && (data[0].acl.organization || data[0].acl.write)){%>
 				<a class="button edit attendee-options-button-edit new">Editar permissões</a>
 			<%}%>
@@ -14,5 +14,7 @@
 		<input type="hidden" name="attendee[]" value="<%= data[0].id %>">
 		<input type="hidden" name="attendeeType[]" value="<%=data[0].isExternal%>">
-		<input type="hidden" name="attendeeAcl[]" value="r">
+		<%if(!data[0].noEvent){%>
+            <input type="hidden" name="attendeeAcl[]" value="r">
+        <%}%>
 		<input type="hidden" name="delegatedFrom[]" value="0">
 		<label title="<%= data[0].name ? data[0].name : '' %>" class="name"><%= data[0].name ? data[0].name : '' %></label>
@@ -20,4 +22,3 @@
 
 	</div>
-	
 </li>
Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/attendees_task.ejs
===================================================================
--- /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/attendees_task.ejs	(revision 6876)
+++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/attendees_task.ejs	(revision 6876)
@@ -0,0 +1,168 @@
+    <%var iconStatus = ['','ui-icon-check', 'ui-icon-radio-off', 'ui-icon-close', 'ui-icon-help', 'ui-icon-transferthick-e-w', 'ui-icon-contact']
+      var legendStatus = ['','Confirmado','Tentativa','Cancelado','Sem Resposta','Delegado', 'Participante']
+    %>
+    <dl class="block-attendee-list attendees-list">
+        <dt class="me"><%= data.task.me.user ? data.task.me.user.name : data.task.me.name %></dt>
+        <dd class="me">
+            <select class="status" name="status">
+                <%if(!data.task.delegatedFrom[data.task.me.id]){%>
+                    <option value="1" <%= data.task.status=='1' ? 'selected="selected"':'' %>>Eu vou</option>
+                        <option value="3" <%= data.task.status=='3' ? 'selected="selected"':'' %>>Eu nÃ£o vou</option>
+                        <option value="2" <%= data.task.status=='2' ? 'selected="selected"':'' %>>Talvez</option>
+                        <option class="hidden" value="5">Delegado</option>
+                <%}else{%>
+                    <option value="5" 'selected="selected"'>Delegado</option>
+                <%}%>
+            </select>
+
+            <fieldset class="add-attendee-options-read">
+                <a href="#" class="button participant-delegate add-attendee-options-button">Delegar participaÃ§Ã£o a um novo participante</a>
+            </fieldset>
+
+            <p class="input-group request-update <%=data.task.delegatedFrom[data.task.me.id] ? '' : "hidden"%>">
+                <input type="checkbox" name="receiveNotification" value="true" <%=data.task.me.receiveNotification =='1' ? 'checked="checked"' : ''%>/>
+                <label for="request-update">Receber atualizaÃ§Ãµes</label>
+            </p>
+            
+            <input type="hidden" name="delegatedFrom[]" value="<%=data.task.me.delegatedFrom%>">
+            <input type="hidden" name="attendee[]" value="<%=data.task.me.id%>">
+            <input type="hidden" name="attendeeType[]" value="0">            
+        </dd>
+
+        <dt class="attendee-list">Convidados</dt>
+        <dd class="attendee-list">
+            <ul class="attendee-list">
+                <label for="attendee" title="<%=  data.task.me.user ? data.task.me.user.mail : data.task.me.mail %>" class="mail hidden"></label>
+                
+                <li class="organizer <%= data.task.me.id == data.task.organizer.id ? "hidden" : "" %>"> 
+                    <div style="overflow:hidden; width:100%; display:table;">
+                        <span class="space-status ui-icon <%=iconStatus[data.task.organizer.status]%>" title="<%=legendStatus[data.task.organizer.status]%>"></span>
+                        <span class="space-special ui-icon ui-icon-person" title="Organizador"></span>
+                        
+                        <% if(data.task.me.id != data.task.organizer.id){%> 
+                            <input type="checkbox" value="<%= data.task.organizer.id %>" disabled="disabled">
+                            <input type="hidden" name="attendee[]" value="<%=data.task.organizer.id%>">
+                            <input type="hidden" name="attendeeType[]" value="0">
+                            <input type="hidden" name="delegatedFrom[]" value="<%=data.task.organizer.delegatedFrom%>">
+                        <%}%>
+                        <input type="hidden" name="attendee_organizer" value="<%=data.task.organizer.id%>">
+                        <label for="attendee_organizer" title="<%= data.task.organizer.name ? data.task.organizer.name: '' %>" class="name name-special"><%= data.task.organizer.name ? data.task.organizer.name : '' %></label>
+                        <label for="attendee_organizer" title="<%= data.task.organizer.mail ? data.task.organizer.mail: '' %>" class="mail name-special"><%= data.task.organizer.mail ? data.task.organizer.mail : '' %></label>
+                    </div>
+                </li>
+            <%if(!!data.task.delegatedFrom[data.task.me.id]){
+                var delegated_me = data.task.delegatedFrom[data.task.me.id]%>
+                <li class="me-delegated">
+                    <div style="overflow:hidden; width:100%; display:table;">
+                        <span class="space-status ui-icon <%=iconStatus[delegated_me.status]%>" title="<%=legendStatus[delegated_me.status]%>"></span>
+                        <span class="space-special ui-icon <%=iconStatus[5]%>" title="Delegado para"></span>
+                        <input type="checkbox" value="<%= delegated_me.id%>" disabled="disabled">
+                        <label for="me-delegated" title="<%= delegated_me.name ? delegated_me.name: '' %>" class="name name-special"><%= delegated_me.name ? delegated_me.name : '' %></label>
+                        <label for="me-delegated" title="<%= delegated_me.mail ? delegated_me.mail: '' %>" class="mail name-special"><%= delegated_me.mail ? delegated_me.mail : '' %></label>
+                    </div>
+                </li>
+            <%}%>
+            <% if (data.task && data.task.attendee.length > 0) {
+                for (var i=0; i< data.task.attendee.length; i++) {%>
+                    <li class="attendee"> 
+                        <div style="overflow:hidden; width:100%; display:table;">
+                            <%if(data.task.delegatedFrom[data.task.attendee[i].id]){%>
+                                <span class="open-delegate new ui-icon ui-icon-triangle-1-e"></span>
+                            <%}else{%>
+                                <span class="space-status ui-icon <%=iconStatus[data.task.attendee[i].status]%>" title="<%=legendStatus[data.task.attendee[i].status]%>"></span>
+                            <%}%>
+                            <span class="space-special ui-icon <%= !!data.task.delegatedFrom[data.task.attendee[i].id] ? iconStatus[5] : iconStatus[6]%>" title="<%=!!data.task.delegatedFrom[data.task.attendee[i].id] ? legendStatus[5] : legendStatus[6]%>"></span>
+
+                            <input type="checkbox" class="new" value="<%= data.task.attendee[i].id %>">
+
+                            <input type="hidden" name="attendee[]" value="<%=data.task.attendee[i].id%>">
+                            <input type="hidden" name="attendeeType[]" value="<%=data.task.attendee[i].isExternal%>">
+                            <input type="hidden" name="attendeeAcl[]" value="<%=data.task.attendee[i].acl%>">
+                            <input type="hidden" name="delegatedFrom[]" value="<%=data.task.attendee[i].delegatedFrom%>">
+                            <label title="<%= data.task.attendee[i].name ? data.task.attendee[i].name: '' %>" class="name <%= !!data.task.delegatedFrom[data.task.attendee[i].id] ? "name-special-delegated" : "name-special" %>"><%= data.task.attendee[i].name ? data.task.attendee[i].name : '' %></label>
+                            <label title="<%= data.task.attendee[i].mail ? data.task.attendee[i].mail : ''%>" class="mail <%= !!data.task.delegatedFrom[data.task.attendee[i].id] ? "name-special-delegated" : "name-special"%>"><%= data.task.attendee[i].mail ? data.task.attendee[i].mail : '' %></label>
+                            <span class="ui-icon ui-icon-close ui-corner-all ui-icon-float-right"></span>
+                        </div> 
+                        <div class="attendee-options">
+                            <a class="button close new">Remover</a>
+                        </div>
+
+
+                        <%if(!!data.task.delegatedFrom[data.task.attendee[i].id]){%>
+                            <%var attendee = data.task.delegatedFrom[data.task.attendee[i].id]%>
+                            <% while(attendee != 0){%>
+                                <div class="list-delegates hidden">
+                                    <div style="overflow:hidden; width:100%; display:table;">
+                                        <span class="status-delegate ui-icon <%=iconStatus[attendee.status]%>" title="<%=legendStatus[attendee.status]%>"></span>
+                                        <span class="space-special-delegated ui-icon <%= !!data.task.delegatedFrom[attendee.id] ? iconStatus[5] : iconStatus[6]%>" title="<%=!!data.task.delegatedFrom[attendee.id] ? legendStatus[5] : legendStatus[6]%>"></span>
+                                        <input type="hidden" name="attendee[]" value="<%=attendee.id%>">
+                                        <input type="hidden" name="attendeeType[]" value="<%=attendee.isExternal%>">
+                                        <input type="hidden" name="attendeeAcl[]" value="<%=attendee.acl%>">
+                                        <input type="hidden" name="delegatedFrom[]" value="<%=attendee.delegatedFrom%>">
+                                        <label title="<%= attendee.name ? attendee.name : '' %>" class="name <%=attendee.status == 5 ? "name-status-delegated-delegated" : "name-status-delegated-none"%>"><%= attendee.name ? attendee.name : '' %></label>
+                                        <label title="<%= attendee.mail ? attendee.mail : '' %>" class="mail <%=attendee.status == 5 ? "name-status-delegated-none" : "name-status-delegated-none"%>"><%= attendee.mail ? attendee.mail : '' %></label>
+                                        <span class="ui-icon ui-icon-close ui-corner-all ui-icon-float-right"></span>
+                                    </div> 
+                                </div>
+                                <%attendee = !!data.task.delegatedFrom[attendee.id] ? data.task.delegatedFrom[attendee.id] : 0%>
+                            <%}%>
+                        <%}%>
+                        
+
+                    </li>   
+                <%} 
+            } else if(data.task.me.id == data.task.organizer.id && !(data.task.attendee.length > 0) ) { %>
+                <li class="not-attendee">NÃ£o hÃ¡ outros participantes.</li>
+            <% } %>
+            </ul>
+        </dd>
+        <dd class="attendee-list-add">
+            <fieldset class="add-attendee-input input-field-rounded ui-corner-all">
+                <span class="ui-icon ui-icon-plus"></span>
+                <input class="plus" type="text" />
+            </fieldset>
+        </dd>
+        
+        <div class="ui-widget email-validation hidden">
+            <div style="padding: 0.2em 0.7em; margin-top: 5px;" class="ui-state-highlight ui-corner-all"> 
+                <p class="message">
+                    <span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-info"></span> 
+                    <label></label>
+                </p>
+            </div>
+        </div>
+        
+        <dd class="attendee-list-brief">
+        <% if (data.task && data.task.attendee.length > 0) { %>
+          <ul class="attendees-count">
+            <li><label>Sim:</label><%=data.task.statusParticipants.accepted%></li>
+            <li><label>NÃ£o:</label><%=data.task.statusParticipants.cancelled%></li>
+            <li><label>Talvez:</label><%=data.task.statusParticipants.tentative%></li>
+            <li><label>Aguardando:</label><%=data.task.statusParticipants.unanswered%></li>
+          </ul>     
+        <% } %>
+        <% if (data.task && data.task.sizeAttendeeLimit){%>
+        <ul class="attendees-count">
+            <li>Evento com muitos participantes, exibindo os 100 primeiros!</li>
+        </ul>
+        <% } %>
+        </dd>
+        
+    </dl>
+
+<dl class="block-add-attendee search">
+    <dt class="add-attendee search">Adicionar outros convidados</dt>
+    <dd class="add-attendee">
+        <fieldset class="block-add-attendee" title="Participantes">
+            <fieldset class="add-attendee-search search-field ui-corner-all">
+                <input class="search" type="text" />
+                <span class="ui-icon ui-icon-search"></span>
+            </fieldset>
+            <ul class="search-result-list ui-corner-all">
+
+            </ul>
+
+        </fieldset>
+    </dd>
+</dl>
+
