From 2c8e84c1e59e0f45bab6fd7671949642bdb8a31d Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sun, 23 Nov 2008 07:38:44 -0500
Subject: [PATCH] Do serverside addressbook queries for autocompletion (#1485531) + make autocompletion list clickable

---
 program/steps/mail/compose.inc |   50 +-------------------------------------------------
 1 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index d4348f2..8a9c36a 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -83,7 +83,7 @@
 // add some labels to client
 $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning',
     'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved',
-    'converting', 'editorwarning');
+    'converting', 'editorwarning', 'searching');
 
 // add config parameters to client script
 if (!empty($CONFIG['drafts_mbox'])) {
@@ -912,54 +912,6 @@
   'receiptcheckbox' => 'rcmail_receipt_checkbox',
   'storetarget' => 'rcmail_store_target_selection',
 ));
-
-/****** get contacts for this user and add them to client scripts ********/
-
-$CONTACTS = new rcube_contacts($DB, $USER->ID);
-$CONTACTS->set_pagesize(1000);
-
-$a_contacts = array(); 
-                                   
-if ($result = $CONTACTS->list_records())
-  {
-  while ($sql_arr = $result->iterate())
-    if ($sql_arr['email'])
-      $a_contacts[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
-  }
-if (!empty($CONFIG['ldap_public']) && is_array($CONFIG['ldap_public']))
-  {
-  /* LDAP autocompletion */ 
-  foreach ($CONFIG['ldap_public'] as $ldapserv_config) 
-    { 
-    if ($ldapserv_config['fuzzy_search'] != 1 || 
-        $ldapserv_config['global_search'] != 1)
-      { 
-      continue; 
-      }
-	 
-    $LDAP = new rcube_ldap($ldapserv_config); 
-    $LDAP->connect(); 
-    $LDAP->set_pagesize(1000);
-  
-    $results = $LDAP->search($ldapserv_config['mail_field'], ""); 
- 
-    for ($i = 0; $i < $results->count; $i++) 
- 	  { 
- 	  if ($results->records[$i]['email'] != '') 
- 	    { 
- 	    $email = $results->records[$i]['email']; 
- 	    $name = $results->records[$i]['name']; 
- 		 
- 	    $a_contacts[] = format_email_recipient($email, $name);
- 	    } 
- 	  }
-    $LDAP->close(); 
-    }
-  }
-if ($a_contacts) 
-  { 
- 	$OUTPUT->set_env('contacts', $a_contacts); 
-  }
 
 $OUTPUT->send('compose');
 

--
Gitblit v1.9.1