Index: /trunk/expressoCalendar/setup/tables_current.inc.php
===================================================================
--- /trunk/expressoCalendar/setup/tables_current.inc.php	(revision 6111)
+++ /trunk/expressoCalendar/setup/tables_current.inc.php	(revision 6114)
@@ -152,4 +152,5 @@
                 'id' => array( 'type' => 'auto', 'nullable' => False),
                 'action_id' => array( 'type' => 'int', 'precision' => '8', 'nullable' => False),
+		'unit' => array('type' => 'varchar','precision' => '20','nullable' => True),
 		'alarm_offset' => array( 'type' => 'bigint', 'precision' => '16', 'nullable' => False),
                 'time' => array('type' => 'varchar','precision' => '50','nullable' => True),
Index: /trunk/prototype/modules/calendar/interceptors/DBMapping.php
===================================================================
--- /trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6111)
+++ /trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6114)
@@ -117,6 +117,5 @@
 		}
 
-	    $sql = ' SELECT calendar_object.id as id ,calendar_object.cal_uid as "uid", calendar_object.type_id as "type", calendar_object.dtstart as "startTime", calendar_object.summary as "summary", calendar_object.description as "description", calendar_object.dtend as "endTime" , calendar_object.location as "location", calendar_object.allday as "allDay", calendar_object.transp as "transparent", calendar_object.class_id as "class", calendar_object.repeat as "repeat", calendar_object.range_start as "rangeStart",calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence",  calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as calendar FROM calendar_to_calendar_object , calendar_object WHERE (range_start >= \'' . $start . '\' AND range_end <= \'' . $end . '\' AND calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $criteria['filter'][3][2]) . '\')) AND calendar_to_calendar_
-object.calendar_object_id = calendar_object.id' . (!empty($ids) ? ' AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\')' : '');
+	    $sql = ' SELECT calendar_object.id as id ,calendar_object.cal_uid as "uid", calendar_object.type_id as "type", calendar_object.dtstart as "startTime", calendar_object.summary as "summary", calendar_object.description as "description", calendar_object.dtend as "endTime" , calendar_object.location as "location", calendar_object.allday as "allDay", calendar_object.transp as "transparent", calendar_object.class_id as "class", calendar_object.repeat as "repeat", calendar_object.range_start as "rangeStart",calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence",  calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as calendar FROM calendar_to_calendar_object , calendar_object WHERE (range_start >= \'' . $start . '\' AND range_end <= \'' . $end . '\' AND calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $criteria['filter'][3][2]) . '\')) AND calendar_to_calendar_object.calendar_object_id = calendar_object.id' . (!empty($ids) ? ' AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\')' : '');
 
 	    $params = Controller::service('PostgreSQL')->execResultSql($sql);
@@ -530,28 +529,19 @@
     }
 
-    //TODO: Remover apos suporte a deepness na api 
-    public function deepnessReadEvent(&$uri, &$result, &$criteria, $original) {
-
-	if (isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0) {
-	    if (isset($result['id'])) {
-		$participants = Controller::find(array('concept' => 'participant'), false, array('filter' => array('=', 'schedulable', $result['id'])));
-		if (is_array($participants))
-		    foreach ($participants as $ii => $vv) {
-			if ($vv['isExternal'] == 1)
-			    $participants[$ii]['user'] = Controller::read(array('concept' => 'user', 'id' => $vv['user'], 'service' => 'PostgreSQL'));
-			else
-			    $participants[$ii]['user'] = Controller::read(array('concept' => 'user', 'id' => $vv['user']));
-
-			if ($participants[$ii]['user']['id'] == Config::me('uidNumber'))
-			    $participants[$ii]['alarms'] = Controller::find(array('concept' => 'alarm'), null, array('filter' => array('AND', array('=', 'participant', $vv['id']), array('=', 'schedulable', $result['id']))));
-		    }
-		$repeat = Controller::find(array('concept' => 'repeat'), false, array('filter' => array('=', 'schedulable', $result['id'])));
-		if (is_array($repeat))
-		    $result['repeat'] = $repeat[0];
-
-		$result['participants'] = $participants;
-	    }
-	}
-    }
+//TODO: Remover apos suporte a deepness na api
+    public function deepnessReadParticipant( &$uri , &$result , &$criteria , $original ){		
+       
+       if(isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0)
+       {
+            if(isset($result['id']))
+            {
+		$result['user'] = Controller::read( array( 'concept' => 'user' , 'id' => $result['user'] , 'service' => ( $result['isExternal'] == 1 ? 'PostgreSQL' : 'OpenLDAP' ) ) );
+
+		if($result['user']['id'] == Config::me('uidNumber'))
+		  $result['alarms'] = Controller::find( array( 'concept' => 'alarm' ) , null , array('filter' => array('=', 'participant' ,$result['id'] ) ) );
+            }
+       }
+
+   } 
 
     //TODO: Remover apos suporte a deepness na api 
