Index: branches/2.4/prototype/modules/calendar/interceptors/DBMapping.php
===================================================================
--- branches/2.4/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6393)
+++ branches/2.4/prototype/modules/calendar/interceptors/DBMapping.php	(revision 6501)
@@ -539,6 +539,10 @@
 
 		if (isset($v['id'])) {
-		    $result[$i]['participants'] = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $v['id']),'deepness' => $original['criteria']['deepness'] - 1 )); 
-
+	            $data = self::decodeParticipantsEvent($uri, $v, $criteria, $original); 
+ 	
+ 	            $result[$i]['statusAttendees'] = isset($data['statusAttendees']) ? $data['statusAttendees'] : false; 
+ 	            $result[$i]['sizeAttendees'] = isset($data['sizeAttendees']) ? $data['sizeAttendees'] : false; 
+ 	            $result[$i]['participants'] = $data['attendees']; 
+	
 		    $attachmentRelation = Controller::find(array('concept' => 'schedulableToAttachment'), false, array('filter' => array('=', 'schedulable', $v['id'])));
 		    if (is_array($attachmentRelation)) {
@@ -563,4 +567,5 @@
 	return $result;
     }
+
 
 //TODO: Remover apos suporte a deepness na api
@@ -689,5 +694,69 @@
 /////////////////////////////////////////////////////////////////////////
 
-    static function dayAlarm( &$uri , &$params , &$criteria , $original ) {     
+    static function decodeParticipantsEvent( &$uri, $result, &$criteria, $original) { 
+        $participants = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('=', 'schedulable'  ,  $result['id']) )); 
+ 		 
+ 	if($participants && ($size = count($participants)) < 100){ 
+ 	    if(isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0){ 
+ 	       self::deepnessFindParticipant($uri, $participants, $criteria, $original); 
+ 	        $participants['attendees'] = $participants; 
+ 	    } 
+ 		             
+ 	}else if($participants && ($size = count($participants)) > 100){ 
+ 	   $owner = Controller::read( array( 'concept' => 'calendarSignature' ) , false ,array( 'filter' => array('AND', array('=', 'calendar'  ,  $result['calendar']), array('=', 'isOwner', '1')))); 
+ 	   $owner = Controller::read( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('AND', array('=', 'schedulable'  ,  $result['id']), array('=', 'user', $owner[0]['user'])), 'deepness' => 2)); 
+ 	 
+ 	   if(is_array($owner)) 
+ 	       $owner = $owner[0]; 
+ 	 
+ 	   $reference = array_slice($participants, 0, 100); 
+ 	   $organizer = false; 
+ 	   $asOwner = false; 
+ 		 
+ 	    foreach($reference as $r => &$v){ 
+ 	        if($v['id'] == $owner['id']){ 
+ 	           $v = $owner; 
+ 	           $asOwner = true; 
+ 	           continue; 
+ 	        } 
+ 		 
+ 	        self::deepnessReadParticipant($uri, $v, $criteria, $original); 
+ 	 
+ 	        if($v['isOrganizer'] == "1" ) 
+ 	           $organizer = $v; 
+ 	   } 
+ 	 
+ 	   if(!$organizer){ 
+ 	       $organizer = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('AND', array('=', 'schedulable'  ,  $result['id']), array('=', 'isOrganizer', '1')), 'deepness' => 2)); 
+ 		 
+ 	       array_push($reference, $organizer[0]); 
+ 	 
+ 	   }else if($organizer && ($organizer['id'] != $owner['id'])) 
+ 	       array_merge($reference, $organizer); 
+ 	
+ 	   if(!$asOwner) 
+ 	       array_push($reference, $owner); 
+ 		 
+ 	   $statusAttendees = array( 'default' => 0, 'accepted' => 0, 'tentative' => 0, 'cancelled' => 0, 'unanswered' => 0, 'delegated' => 0 ); 
+ 	   $statusLabels = array( 'default', 'accepted', 'tentative', 'cancelled', 'unanswered', 'delegated' ); 
+ 		 
+ 	   foreach($participants as $k => &$p){ 
+ 	       if(!$organizer && $p['isOrganizer'] == "1"){ 
+ 	           self::deepnessReadParticipant($uri, $p, $criteria, $original); 
+ 	           $reference = array_merge($reference, array($p)); 
+ 	       } 
+ 		 
+ 	       $statusAttendees[$statusLabels[$p['status']]]++; 
+ 	   } 
+ 		 
+ 	   $participants['statusAttendees'] = $statusAttendees; 
+ 	   $participants['sizeAttendees'] = $size; 
+ 	   $participants['attendees'] = $reference; 
+        } 
+ 		         
+ 	return $participants; 
+    } 
+ 	     
+    static function dayAlarm( &$uri , &$params , &$criteria , $original ) {    
         if(isset($criteria['filter'][1]) && $criteria['filter'][1] == 'date')
         {
@@ -884,5 +953,5 @@
 		//Criaremos uma agenda padrão
 		$cal = array('name' => 'Calendario',
-		    'description' => 'Calendario Padrï¿œo',
+		  'description' => 'Calendario Padrão', 
 		    'timezone' => (date_default_timezone_get()) ? date_default_timezone_get() : 'America/Sao_Paulo',
 		    'dtstamp' => time() . '000'
Index: branches/2.4/prototype/modules/calendar/css/layout.css
===================================================================
--- branches/2.4/prototype/modules/calendar/css/layout.css	(revision 6369)
+++ branches/2.4/prototype/modules/calendar/css/layout.css	(revision 6501)
@@ -227,5 +227,5 @@
 .new-event-win ul.attendee-permissions-list, li.attendee-permissions-list{text-align: left;}
 
-li.attendee-permissions-list input{width: 20px !important; margin: 3px 0 0 0; !important}
+li.attendee-permissions-list input{width: 20px !important; margin: 3px 0 0 0 !important;} 
 
 p.request-update{display: inline; position: relative; top: 2px;}
@@ -399,4 +399,6 @@
 .import-export-win p.input-group * { float:left; }
 
+
+label.messagesHelpers{display: block; position: absolute; left: 60px; top: 21px;}
 /* -- calendar list styles -- */
 
Index: branches/2.4/prototype/modules/calendar/js/helpers.js
===================================================================
--- branches/2.4/prototype/modules/calendar/js/helpers.js	(revision 6453)
+++ branches/2.4/prototype/modules/calendar/js/helpers.js	(revision 6501)
@@ -435,11 +435,11 @@
 				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.
-									 */
+				
+				/**					
+			        * 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() {
@@ -658,4 +658,8 @@
 		return Calendar.signatures[i].calendar.id;
 }
+
+/*Seleciona a agenda padrão para visualização/edição de um evento*/ 
+if(objEvent.id) 
+    UI.dialogs.addEvent.find('option[value="'+objEvent.calendar+'"]').attr('selected','selected').trigger('change'); 
 		
 /*Adicionar alarms padrões, quando alterado a agenda do usuário*/		
@@ -678,4 +682,5 @@
 	    $(this).parent().remove().find('li').is(':empty');
 	});
+
     }else{
 	UI.dialogs.addEvent.find('input[name="defaultAlarm"]').parent().addClass('hidden');
@@ -683,7 +688,9 @@
 }
 
-var participant =  UI.dialogs.addEvent.find('dd.me input[name="attendee[]"]').val();
-    if( !parseInt(Calendar.signatureOf[$(this).val()].isOwner) ){
-	var signature = Calendar.signatureOf[$(this).val()];
+var participant =  UI.dialogs.addEvent.find('dd.me input[name="attendee[]"]').val(); 
+ 	var calendar = $(this).val(); 
+ 	  
+ 	if( !parseInt(Calendar.signatureOf[calendar].isOwner) ){ 
+ 	var signature = Calendar.signatureOf[calendar]; 
 	var organizer = DataLayer.get('calendarSignature', {
 	    filter: ['AND', ['=','calendar',signature.calendar.id], ['=','isOwner','1']], 
@@ -717,4 +724,5 @@
     .filter('.mail').html(User.me.mail).attr('title',User.me.mail);
 }
+
 });
 
@@ -1532,6 +1540,4 @@
 		
     UI.dialogs.addEvent.find('.button.cancel').show();
-		
-	
 }
 
@@ -1539,7 +1545,8 @@
 
 /*Seleciona a agenda padrão para criação de um evento*/
-var selectedCalendar = (objEvent.calendar != undefined) ? objEvent.calendar : (User.preferences.defaultCalendar ? User.preferences.defaultCalendar : myCalendar());
-UI.dialogs.addEvent.find('option[value="'+selectedCalendar+'"]').attr('selected','selected').trigger('change');
-
+if(!objEvent.id){ 
+    var selectedCalendar = (objEvent.calendar != undefined) ? objEvent.calendar : (User.preferences.defaultCalendar ? User.preferences.defaultCalendar : myCalendar()); 
+    UI.dialogs.addEvent.find('option[value="'+selectedCalendar+'"]').attr('selected','selected').trigger('change'); 
+} 
 UI.dialogs.addEvent.find(':input').change(function(event){
     if (event.keyCode != '27' && event.keyCode != '13')
@@ -2543,6 +2550,6 @@
     } 
 } 
-      $tabs.tabs("select", currentView); 
-	
+      if(currentView != '#tab_events_list_') 
+ 	  $tabs.tabs("select", currentView); 
 }
 
@@ -2759,5 +2766,23 @@
 
     }
-	
-
-}
+} 
+ 		 
+function messageHelper(msg, isShow){ 
+    if(isShow) 
+        new $.Zebra_Dialog('<span style="width: 50px; height: 50px;">'+ 
+                            '<img src="'+DataLayer.dispatchPath+'/modules/calendar/img/loading.gif"></img>'+ 
+                        '</span><label class="messagesHelpers"> '+ msg +' </label>' , { 
+                        'buttons':  false, 
+                        'modal': true, 
+                        'overlay_opacity': '0.5', 
+                        'keyboard': false, 
+                        'overlay_close': false, 
+                        'type': false, 
+                        'custom_class': 'messagesHelpersExpressoCalendar' 
+                        } 
+                    ); 
+    else{ 
+        $('.messagesHelpersExpressoCalendar').remove(); 
+        $('.ZebraDialogOverlay').remove(); 
+    } 
+} 
Index: branches/2.4/prototype/modules/calendar/templates/attendee_add.ejs
===================================================================
--- branches/2.4/prototype/modules/calendar/templates/attendee_add.ejs	(revision 6370)
+++ branches/2.4/prototype/modules/calendar/templates/attendee_add.ejs	(revision 6501)
@@ -3,5 +3,5 @@
 	%>
 	<dl class="block-attendee-list attendees-list">
-		<dt class="me"><%= data.event.me.name %></dt>
+		<dt class="me"><%= data.event.me.user ? data.event.me.user.name : data.event.me.name %></dt> 
 		<dd class="me">
 		    <select class="status" name="status" <%= data.event.isAttendee ? '' : 'disabled' %>>
@@ -145,9 +145,14 @@
 		<% if (data.event && data.event.attendee.length > 0) { %>
 		  <ul class="attendees-count">
-	        <li><label>Sim:</label><%=data.event.statusParticipants.accepted%></li>
+	            <li><label>Sim:</label><%=data.event.statusParticipants.accepted%></li> 
 		    <li><label>Não:</label><%=data.event.statusParticipants.cancelled%></li>
 		    <li><label>Talvez:</label><%=data.event.statusParticipants.tentative%></li>
 		    <li><label>Aguardando:</label><%=data.event.statusParticipants.unanswered%></li>
-		  </ul>     
+		  </ul> 
+  <% } %> 
+  <% if (data.event && data.event.sizeAttendeeLimit){%> 
+      <ul class="attendees-count"> 
+          <li>Evento com muitos participantes, exibindo os 100 primeiros!</li> 
+      </ul>     
 	    <% } %>
 		</dd>
