Index: branches/2.2/mobile/inc/class.bo_mobilecc.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.bo_mobilecc.inc.php	(revision 3629)
+++ branches/2.2/mobile/inc/class.bo_mobilecc.inc.php	(revision 3706)
@@ -49,6 +49,6 @@
 				$what = array('contact.names_ordered',$id);
 			}
-			
-			if ((strpos($catalog,'bo_global_ldap_catalog')!==false) &&
+
+			if ((strpos($this->page_info['actual_catalog'],'bo_global_ldap_catalog')!==false) &&
 					(!$this->page_info['is_external_catalog'])) { //Ldap do expresso, leva em conta alguns atributos do expresso
 
@@ -94,6 +94,4 @@
 							));		
 			}
-			
-			
 			$ids = $this->bo->find($what,$rules,array('order'=>$search),false,true);
 
Index: branches/2.2/mobile/inc/class.ui_home.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_home.inc.php	(revision 3690)
+++ branches/2.2/mobile/inc/class.ui_home.inc.php	(revision 3706)
@@ -122,4 +122,5 @@
 		
     function search($params) {
+    	
     	if($_SERVER["HTTP_REFERER"] && strpos($_SERVER["HTTP_REFERER"], "ui_home.index")) {
     		if(!$params["default_folders"] &&
@@ -146,4 +147,6 @@
 			//Langs gerais da página
 			$p->set_block('search','home_search');
+			$p->set_block("search","row_events");
+			$p->set_block("search","no_events");
 			$p->set_block('home_search_bar','search_bar');
 			
@@ -174,4 +177,88 @@
 			
 			$p->set_var('search',$p->fp('out','search_bar'));
+
+			//E-mails
+			$no_mail_search=false;
+			if((!isset($params['folder_to_search'])) || ($params['folder_to_search']==="")) {
+				if($params['default_folders']==="1") {
+					if($params['personal_folders']!=="1")
+						$mail_params['folderType'] = 'default';			
+				}
+				else {
+					if($params['personal_folders']==="1")
+						$mail_params['folderType'] = 'personal';
+					else
+						$no_mail_search = true;
+				}
+			}
+			else {
+				$mail_params['folder'] = $params['folder_to_search'];
+			}
+
+			if(!$no_mail_search) {
+				$imap_functions = CreateObject('expressoMail1_2.imap_functions');
+				$mail_params['filter'] = $params["name"];
+				$mail_params['max_msgs'] = isset($params['max_msgs'])?$params['max_msgs']:10;
+				
+				$p->set_var('next_max_msgs',$mail_params['max_msgs']+10);
+				$p->set_var('max_msgs',$mail_params['max_msgs']);
+
+				$messages = $imap_functions->mobile_search($mail_params);
+				if($mail_params['max_msgs']>=$messages["total_msgs"])
+					$p->set_var('show_more_messages',"none");
+				else
+					$p->set_var('show_more_messages',"block");
+				$p->set_var('mails',$ui_mobilemail->print_mails_list($messages));
+			}
+			else {
+				$p->set_var('show_mails',"none");
+			}
+			
+			//Agenda
+			if($params["calendar_search"]==="1") {
+				
+				$bo_calendar = CreateObject('calendar.bocalendar',1);
+				$functions = CreateObject('mobile.common_functions');
+				
+				$max_events = isset($params['max_events'])?$params['max_events']:10;
+				$p->set_var('next_max_events',$max_events+10);
+				$p->set_var('max_events',$max_events);
+				
+				$event_ids = $bo_calendar->search_keywords($params['name']);
+				
+				$bg = "fundo-azul-alinha";
+				if(!empty($event_ids)) {
+					$total_events_search = count($event_ids);
+					$event_ids = array_slice($event_ids,0,$max_events,true);
+					if($total_events_search>count($event_ids))
+						$p->set_var('show_more_events',"block");
+					foreach($event_ids as $key => $id)
+					{
+						$event = $bo_calendar->read_entry($id);
+						
+						if(!$bo_calendar->check_perms(PHPGW_ACL_READ,$event))
+						{
+							continue;
+						}
+	
+						$p->set_var("bg",$bg=="fundo-azul-alinha"?$bg="fundo-branco-alinha":$bg="fundo-azul-alinha");
+						$p->set_var("date",$functions->complete_string($event["start"]["mday"],2,"R","0")."/".
+											$functions->complete_string($event["start"]["month"],2,"R","0")."/".
+											$event["start"]["year"]." ".
+											$functions->complete_string($event["start"]["hour"],2,"R","0").":".
+											$functions->complete_string($event["start"]["min"],2,"R","0"));
+						$p->set_var("title",$event["title"],40);
+						$p->fp("calendar_results","row_events",True);
+				
+					}
+				}
+				else {
+					$p->set_var("lang_no_results",lang("no results found"));
+					$p->parse("calendar_results","no_events");
+				}
+			}
+			else {
+				$p->set_var("show_calendar","none");
+			}
 			
 			//Contatos			
@@ -225,89 +312,5 @@
 				$p->set_var('show_contacts',"none");
 			}
-
-			//E-mails
-			$no_mail_search=false;
-			if((!isset($params['folder_to_search'])) || ($params['folder_to_search']==="")) {
-				if($params['default_folders']==="1") {
-					if($params['personal_folders']!=="1")
-						$mail_params['folderType'] = 'default';			
-				}
-				else {
-					if($params['personal_folders']==="1")
-						$mail_params['folderType'] = 'personal';
-					else
-						$no_mail_search = true;
-				}
-			}
-			else {
-				$mail_params['folder'] = $params['folder_to_search'];
-			}
-
-			if(!$no_mail_search) {
-				$imap_functions = CreateObject('expressoMail1_2.imap_functions');
-				$mail_params['filter'] = $params["name"];
-				$mail_params['max_msgs'] = isset($params['max_msgs'])?$params['max_msgs']:10;
-				
-				$p->set_var('next_max_msgs',$mail_params['max_msgs']+10);
-				$p->set_var('max_msgs',$mail_params['max_msgs']);
-
-				$messages = $imap_functions->mobile_search($mail_params);
-				if($mail_params['max_msgs']>=$messages["total_msgs"])
-					$p->set_var('show_more_messages',"none");
-				else
-					$p->set_var('show_more_messages',"block");
-				$p->set_var('mails',$ui_mobilemail->print_mails_list($messages));
-			}
-			else {
-				$p->set_var('show_mails',"none");
-			}
-			
-			//Agenda
-			if($params["calendar_search"]==="1") {
-				$bo_calendar = CreateObject('calendar.bocalendar',1);
-				$functions = CreateObject('mobile.common_functions');
-				
-				$max_events = isset($params['max_events'])?$params['max_events']:10;
-				$p->set_var('next_max_events',$max_events+10);
-				$p->set_var('max_events',$max_events);
-				
-				$event_ids = $bo_calendar->search_keywords($params['name']);
-				$p->set_block("search","row_events");
-				$p->set_block("search","no_events");
-				$bg = "par";
-				if(!empty($event_ids)) {
-					$total_events_search = count($event_ids);
-					$event_ids = array_slice($event_ids,0,$max_events,true);
-					if($total_events_search>count($event_ids))
-						$p->set_var('show_more_events',"block");
-					foreach($event_ids as $key => $id)
-					{
-						$event = $bo_calendar->read_entry($id);
-						
-						if(!$bo_calendar->check_perms(PHPGW_ACL_READ,$event))
-						{
-							continue;
-						}
-	
-						$p->set_var("bg",$bg=="par"?$bg="reset-dt":$bg="par");
-						$p->set_var("date",$functions->complete_string($event["start"]["mday"],2,"R","0")."/".
-											$functions->complete_string($event["start"]["month"],2,"R","0")."/".
-											$event["start"]["year"]." ".
-											$functions->complete_string($event["start"]["hour"],2,"R","0").":".
-											$functions->complete_string($event["start"]["min"],2,"R","0"));
-						$p->set_var("title",$functions->strach_string($event["title"],40));
-						$p->set_var("description",$functions->strach_string($event["description"],80));
-						$p->fp("calendar_results","row_events",True);
-				
-					}
-				}
-				else {
-					$p->set_var("lang_no_results",lang("no results found"));
-					$p->parse("calendar_results","no_events");
-				}
-			}
-			else {
-				$p->set_var("show_calendar","none");
-			}
+			
 			$GLOBALS['phpgw_info']['mobiletemplate']->set_content($p->fp('out','home_search'));
 
Index: branches/2.2/mobile/inc/class.ui_mobilecc.inc.php
===================================================================
--- branches/2.2/mobile/inc/class.ui_mobilecc.inc.php	(revision 3700)
+++ branches/2.2/mobile/inc/class.ui_mobilecc.inc.php	(revision 3706)
@@ -261,11 +261,14 @@
 			$p->set_block('cc_t', 'no_contacts');
 
-			$bg = "par";
+			$bg = "bg-azul";
 			if(!empty($contacts)) {
 				foreach($contacts as $id => $contact) {
 
 					$p->set_var('show_check',$show_checkbox?"inline":"none");
-					$p->set_var('bg',$bg=="par"?$bg="reset-dt":$bg="par");
-										
+					$p->set_var('bg',$bg=="bg-azul"?$bg="bg-branco":$bg="bg-azul");
+					if($show_checkbox)
+						$p->set_var("details","email-corpo");
+					else
+						$p->set_var("details","limpar_div margin-geral");	
 					if($contact["catalog"]!=="bo_group_manager") {	//Contatos		
 						$id=strpos($contact["catalog"],"ldap")===false?$contact["id_contact"]:$id;
@@ -316,5 +319,5 @@
 					
 					if($request_from==null) {
-						$p->set_var('lang_see_details',lang("see details"));
+						$p->set_var('lang_see_details',lang("details"));
 						$cat_encode = urlencode($contact["catalog"]);
 						$p->set_var('href_details',"ui_mobilecc.contact_view&id=$id&catalog=".urlencode($contact["catalog"]));
