Index: trunk/prototype/services/PostgreSQL.php
===================================================================
--- trunk/prototype/services/PostgreSQL.php	(revision 5637)
+++ trunk/prototype/services/PostgreSQL.php	(revision 5641)
@@ -19,9 +19,9 @@
 
    public function read ( $uri, $justthese = false , $criteria = false){
-      
+   
       $map =  Config::get($uri['concept'], 'PostgreSQL.mapping');   
       $justthese = self::parseJustthese($justthese, $map);
-      $criteria = ($criteria !== false) ? $this->parseCriteria ( $criteria , $map , ' WHERE id = \''.addslashes( $uri['id'] ).'\'') : '';
-      
+      $criteria = ($criteria !== false) ? $this->parseCriteria ( $criteria , $map , ' WHERE id = \''.addslashes( $uri['id'] ).'\'') : ' WHERE id = \''.addslashes( $uri['id'] ).'\'';
+   
       return $this->execResultSql( 'SELECT '.$justthese['select'].' FROM '. (Config::get($uri['concept'],'PostgreSQL.concept')) .$criteria , true );
     }
Index: trunk/prototype/modules/calendar/interceptors/DBMapping.php
===================================================================
--- trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 5636)
+++ trunk/prototype/modules/calendar/interceptors/DBMapping.php	(revision 5641)
@@ -130,6 +130,6 @@
 			if(!is_numeric($params['startTime']) )
 				$params['startTime'] =  strtotime( $params['startTime'] . ' ' .$event['timezone']).'000';
-			else
-				$params['rangeStart'] = $params['startTime'] ;
+			
+			$params['rangeStart'] = $params['startTime'] ;
 		   
 		}if(isset($params['endTime'])){
@@ -137,6 +137,6 @@
 			if (!is_numeric($params['endTime']))
 				$params['endTime'] =   strtotime( $params['endTime'] . ' ' .$event['timezone']).'000';
-			else
-				$params['rangeEnd'] = $params['endTime'] ;       
+			
+			$params['rangeEnd'] = $params['endTime'] ;       
 				
 		}    
@@ -376,11 +376,11 @@
      //TODO: Remover apos suporte a deepness na api 
     public function deepnessFindCalendarSignature( &$uri , &$result , &$criteria , $original ){		
-       
-      if(isset($original['criteria']['deepness']))
+
+	if(isset($original['criteria']['deepness']))
        {
            foreach ($result as $i => $v)
            {
                 if(isset($v['calendar'])){
-                    $result[$i]['calendar'] = Controller::read( array( 'concept' => 'calendar' , 'id' => $v['calendar'])); 
+                    $result[$i]['calendar'] = Controller::read( array( 'concept' => 'calendar' , 'id' => $v['calendar']), false, false); 
 					$result[$i]['defaultAlarms'] = Controller::find( array( 'concept' => 'calendarSignatureAlarm' ) , false ,array( 'filter' => array('=', 'calendarSignature'  ,  $v['id']) ));    
 					//Caso não seja o dono da agenda retorna o objeto permission com as acls
@@ -388,21 +388,8 @@
 						$permission = Controller::find( array( 'concept' => 'calendarToPermission'), false ,array( 'filter' => array('AND', array('=', 'calendar' ,  $v['calendar']), array('=', 'user', Config::me('uidNumber') ) ) ) ); 
 
-						
-	
-						
 						if(!is_array($permission) || !$permission  ){
-							ob_start();
-							var_dump($permission);
-							
-							$output = ob_get_clean();
-							file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND);
+
 							$permission = Controller::find( array( 'concept' => 'calendarToPermission'), false ,array( 'filter' => array('AND', array('=', 'calendar' ,  $v['calendar']), array('=', 'type', '1' ) ) ) );    
-							
-							ob_start();
-						var_dump($permission);
-						
-						$output = ob_get_clean();
-						file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND);
-							
+
 						}
 						$result[$i]['permission'] = $permission[0];
@@ -410,6 +397,5 @@
 				}
            }
-       }
-       
+       }       
    } 
 //Decode Find       
Index: trunk/prototype/modules/calendar/css/layout.css
===================================================================
--- trunk/prototype/modules/calendar/css/layout.css	(revision 5592)
+++ trunk/prototype/modules/calendar/css/layout.css	(revision 5641)
@@ -238,5 +238,5 @@
 
 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;}
+fieldset.block-add-attendee .add-attendee-search input { max-width: 220px; width: 220px; 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;}
@@ -662,4 +662,7 @@
 .attendee-list-add .add-attendee-input input { width: 370px; }
 
+
+.attendee-list-add .add-attendee-input span{cursor: hand;}
+
 .qtip-content .add-attendee-search { max-width: 155px; width:155px; display: inline; padding: 0; margin: 10px 0 5px 0;}
 .qtip-content .add-attendee-search input { max-width: 125px; }
Index: trunk/prototype/modules/calendar/css/style.css
===================================================================
--- trunk/prototype/modules/calendar/css/style.css	(revision 5636)
+++ trunk/prototype/modules/calendar/css/style.css	(revision 5641)
@@ -446,5 +446,9 @@
 
 
-#new_event_map .fc-event-head.fc-event-skin,.fc-event-inner.fc-event-skin{
+#new_event_map .map-event .fc-event-head.fc-event-skin,.fc-event-inner.fc-event-skin{
 	border-color: transparent;
 }
+
+#new_event_map .map-event .fc-event-head,#new_event_map .map-event .fc-event-content{
+	color: transparent;
+}
Index: trunk/prototype/modules/calendar/js/calendar.codecs.js
===================================================================
--- trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 5636)
+++ trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 5641)
@@ -263,12 +263,9 @@
     if( status === 'serverclient' ){
 		DataLayer.commit( false, false, function(){	
-			if(!!$('#calendar').fullCalendar){
+			if((typeof($tabs) != "undefined") && $tabs.tabs('option' ,'selected') == 0){
 				Calendar.rerenderView(true);
 				contentMenu();
-			}
-			//Atualiza a listagem de eventos apenas se estiver na aba de listagem
-			if((typeof($tabs) != "undefined") && $tabs.tabs('option' ,'selected') != 0)
+			}else if((typeof($tabs) != "undefined") && $tabs.tabs('option' ,'selected') != 0)
 				pageselectCallback($('.events-list-win.active [name=keyword]').val(), 0);
-			
 		});
     }
Index: trunk/prototype/modules/calendar/js/helpers.js
===================================================================
--- trunk/prototype/modules/calendar/js/helpers.js	(revision 5636)
+++ trunk/prototype/modules/calendar/js/helpers.js	(revision 5641)
@@ -263,5 +263,5 @@
 			}else{
 				checked = true;
-				$(this).parents('li').find('.button.edit').click();
+					$(this).parents('li').find('.button.edit').click();
 			}
 		}).removeClass('new');
@@ -592,7 +592,12 @@
 			*/
 			var hasNewAttendee = false;
+			
+			blkAddAtendee.find('.attendee-list-add .add-attendee-input span').click(function(data){
+				blkAddAtendee.find('.attendee-list-add .add-attendee-input input').keydown();
+			});
+			
 			blkAddAtendee.find('.attendee-list-add .add-attendee-input input').keydown(function(event) {
 				
-				if (event.keyCode == '13' && $(this).val() != '') {
+				if (event.keyCode == '13' && $(this).val() != '' || (event.keyCode == undefined && $(this).val() != '')) {
 					Encoder.EncodeType = "entity";
 					$(this).val(Encoder.htmlEncode($(this).val()));
@@ -621,5 +626,5 @@
 
 					var user = DataLayer.get('user', ["=", "mail", $(this).val()]);
-					if(user[0].id)
+					if(!!user && user[0].id)
 						attendees[user[0].id].name  = user[0].name;
 					
@@ -1840,5 +1845,10 @@
                            break;  
 			}
-   return {filter: ['AND', ['>=', 'rangeStart', rangeStart], ['<=', 'rangeEnd', rangeEnd] , ['IN', 'calendar',  calerdars_selecteds]], criteria: {deepness: 2, order: 'startTime'}}; 
+			
+	var timezone = {};
+		for(var i in Calendar.signatureOf)
+			timezone[i] = Calendar.signatureOf[i].calendar.timezone;		
+	
+   return {filter: ['AND', ['>=', 'rangeStart', rangeStart], ['<=', 'rangeEnd', rangeEnd] , ['IN', 'calendar',  calerdars_selecteds]], criteria: {deepness: 2, order: 'startTime', timezones: timezone}}; 
 
 }
