2 if(!defined('sugarEntry'))define('sugarEntry', true);
3 /*********************************************************************************
4 * SugarCRM is a customer relationship management program developed by
5 * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
7 * This program is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU Affero General Public License version 3 as published by the
9 * Free Software Foundation with the addition of the following permission added
10 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
19 * You should have received a copy of the GNU Affero General Public License along with
20 * this program; if not, see http://www.gnu.org/licenses or write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
27 * The interactive user interfaces in modified source and object code versions
28 * of this program must display Appropriate Legal Notices, as required under
29 * Section 5 of the GNU Affero General Public License version 3.
31 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32 * these Appropriate Legal Notices must retain the display of the "Powered by
33 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34 * technical reasons, the Appropriate Legal Notices must display the words
35 * "Powered by SugarCRM".
36 ********************************************************************************/
39 // the types/methods defined in this file are deprecated -- please see SoapSugarUsers.php, SoapPortalUsers.php, SoapStudio.php, etc.
41 $server->wsdl->addComplexType(
48 'email_address' => array('name'=>'email_address','type'=>'xsd:string'),
49 'name1' => array('name'=>'name1','type'=>'xsd:string'),
50 'name2' => array('name'=>'name2','type'=>'xsd:string'),
51 'association' => array('name'=>'association','type'=>'xsd:string'),
52 'id' => array('name'=>'id','type'=>'xsd:string'),
53 'msi_id' => array('name'=>'id','type'=>'xsd:string'),
54 'type' => array('name'=>'type','type'=>'xsd:string'),
58 $server->wsdl->addComplexType(
59 'contact_detail_array',
66 array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:contact_detail[]')
71 $server->wsdl->addComplexType(
78 'email_address' => array('name'=>'email_address','type'=>'xsd:string'),
79 'user_name' => array('name'=>'user_name', 'type'=>'xsd:string'),
80 'first_name' => array('name'=>'first_name','type'=>'xsd:string'),
81 'last_name' => array('name'=>'last_name','type'=>'xsd:string'),
82 'department' => array('name'=>'department','type'=>'xsd:string'),
83 'id' => array('name'=>'id','type'=>'xsd:string'),
84 'title' => array('name'=>'title','type'=>'xsd:string'),
88 $server->wsdl->addComplexType(
96 array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:user_detail[]')
104 array('user_name'=>'xsd:string','password'=>'xsd:string'),
105 array('return'=>'xsd:string'),
110 array('user_name'=>'xsd:string'),
111 array('return'=>'xsd:string'),
116 array('user_name'=>'xsd:string','password'=>'xsd:string', 'email_address'=>'xsd:string'),
117 array('return'=>'tns:contact_detail_array'),
121 'get_contact_relationships',
122 array('user_name'=>'xsd:string','password'=>'xsd:string', 'id'=>'xsd:string'),
123 array('return'=>'tns:contact_detail_array'),
128 array('user_name'=>'xsd:string','password'=>'xsd:string'),
129 array('return'=>'tns:user_detail_array'),
134 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string'),
135 array('return'=>'tns:contact_detail_array'),
140 array('user_name'=>'xsd:string','password'=>'xsd:string','parent_id'=>'xsd:string', 'contact_ids'=>'xsd:string', 'date_sent'=>'xsd:date', 'email_subject'=>'xsd:string', 'email_body'=>'xsd:string'),
141 array('return'=>'xsd:string'),
146 array('user_name'=>'xsd:string','password'=>'xsd:string', 'first_name'=>'xsd:string', 'last_name'=>'xsd:string', 'email_address'=>'xsd:string'),
147 array('return'=>'xsd:string'),
151 array('user_name'=>'xsd:string','password'=>'xsd:string', 'first_name'=>'xsd:string', 'last_name'=>'xsd:string', 'email_address'=>'xsd:string'),
152 array('return'=>'xsd:string'),
156 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string', 'phone'=>'xsd:string', 'website'=>'xsd:string'),
157 array('return'=>'xsd:string'),
161 'create_opportunity',
162 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string', 'amount'=>'xsd:string'),
163 array('return'=>'xsd:string'),
168 array('user_name'=>'xsd:string','password'=>'xsd:string', 'name'=>'xsd:string'),
169 array('return'=>'xsd:string'),
172 * Create a new session. This method is required before calling any other functions.
174 * @param string $user_name -- the user name for the session
175 * @param string $password -- MD5 of user password
176 * @return "Success" if the session is created
177 * @return "Failed" if the session creation failed.
179 function create_session($user_name, $password)
181 if(validate_user($user_name, $password))
190 * End a session. This method will end the SOAP session.
192 * @param string $user_name -- the user name for the session
193 * @return "Success" if the session is destroyed
194 * @return "Failed" if the session destruction failed.
196 function end_session($user_name)
198 // get around optimizer warning
199 $user_name = $user_name;
204 * Validate the user session based on user name and password hash.
206 * @param string $user_name -- The user name to create a session for
207 * @param string $password -- The MD5 sum of the user's password
208 * @return true -- If the session is created
209 * @return false -- If the session is not created
211 function validate_user($user_name, $password){
212 global $server, $current_user, $sugar_config, $system_config;
214 $user->user_name = $user_name;
215 $system_config = new Administration();
216 $system_config->retrieveSettings('system');
217 $authController = new AuthenticationController((!empty($sugar_config['authenticationClass'])? $sugar_config['authenticationClass'] : 'SugarAuthenticate'));
218 // Check to see if the user name and password are consistent.
219 if($user->authenticate_user($password)){
220 // we also need to set the current_user.
221 $user->retrieve($user->id);
222 $current_user = $user;
225 }else if(function_exists('mcrypt_cbc')){
226 $password = decrypt_string($password);
227 if($authController->login($user_name, $password) && isset($_SESSION['authenticated_user_id'])){
228 $user->retrieve($_SESSION['authenticated_user_id']);
229 $current_user = $user;
233 $GLOBALS['log']->fatal("SECURITY: failed attempted login for $user_name using SOAP api");
234 $server->setError("Invalid username and/or password");
241 * Internal: When building a response to the plug-in for Microsoft Outlook, find
242 * all contacts that match the email address that was provided.
244 * @param array by ref $output_list -- The list of matching beans. New contacts that match
245 * the email address are appended to the $output_list
246 * @param string $email_address -- an email address to search for
247 * @param Contact $seed_contact -- A template SugarBean. This is a blank Contact
248 * @param ID $msi_id -- Index Count
250 function add_contacts_matching_email_address(&$output_list, $email_address, &$seed_contact, &$msi_id)
252 // escape the email address
253 $safe_email_address = addslashes($email_address);
254 global $current_user;
256 // Verify that the user has permission to see Contact list views
257 if(!$seed_contact->ACLAccess('ListView'))
262 $contactList = $seed_contact->emailAddress->getBeansByEmailAddress($safe_email_address);
263 // create a return array of names and email addresses.
264 foreach($contactList as $contact)
266 $output_list[] = Array("name1" => $contact->first_name,
267 "name2" => $contact->last_name,
268 "association" => $contact->account_name,
270 "id" => $contact->id,
272 "email_address" => $contact->email1);
274 $accounts = $contact->get_linked_beans('accounts','Account');
275 foreach($accounts as $account)
277 $output_list[] = get_account_array($account, $msi_id);
280 $opps = $contact->get_linked_beans('opportunities','Opportunity');
281 foreach($opps as $opp)
283 $output_list[] = get_opportunity_array($opp, $msi_id);
286 $cases = $contact->get_linked_beans('cases','aCase');
287 foreach($cases as $case)
289 $output_list[] = get_case_array($case, $msi_id);
292 $bugs = $contact->get_linked_beans('bugs','Bug');
293 foreach($bugs as $bug)
295 $output_list[] = get_bean_array($bug, $msi_id, 'Bug');
298 $projects = $contact->get_linked_beans('project','Project');
299 foreach($projects as $project)
301 $output_list[] = get_bean_array($project, $msi_id, 'Project');
304 $msi_id = $msi_id + 1;
308 * Internal: Add Leads that match the specified email address to the result array
310 * @param Array $output_list -- List of matching detail records
311 * @param String $email_address -- Email address
312 * @param Bean $seed_lead -- Seed Lead Bean
313 * @param int $msi_id -- output array offset.
315 function add_leads_matching_email_address(&$output_list, $email_address, &$seed_lead, &$msi_id)
317 $safe_email_address = addslashes($email_address);
318 if(!$seed_lead->ACLAccess('ListView')){
322 $leadList = $seed_lead->emailAddress->getBeansByEmailAddress($safe_email_address);
324 // create a return array of names and email addresses.
325 foreach($leadList as $lead)
327 $output_list[] = Array("name1" => $lead->first_name,
328 "name2" => $lead->last_name,
329 "association" => $lead->account_name,
333 "email_address" => $lead->email1);
335 $msi_id = $msi_id + 1;
339 * Return a list of modules related to the specifed contact record
341 * This function does not require a session be created first.
343 * @param string $user_name -- User name to authenticate with
344 * @param string $password -- MD5 of the user password
345 * @param string $id -- the id of the record
346 * @return contact detail array along with associated objects.
348 function get_contact_relationships($user_name, $password, $id)
350 if(!validate_user($user_name, $password)){
354 $seed_contact = new Contact();
355 // Verify that the user has permission to see Contact list views
356 if(!$seed_contact->ACLAccess('ListView'))
362 $seed_contact->retrieve($id);
364 $output_list[] = Array("name1" => $seed_contact->first_name,
365 "name2" => $seed_contact->last_name,
366 "association" => $seed_contact->account_name,
368 "id" => $seed_contact->id,
370 "email_address" => $seed_contact->email1);
372 $accounts = $seed_contact->get_linked_beans('accounts','Account');
373 foreach($accounts as $account)
375 $output_list[] = get_account_array($account, $msi_id);
378 $opps = $seed_contact->get_linked_beans('opportunities','Opportunity');
379 foreach($opps as $opp)
381 $output_list[] = get_opportunity_array($opp, $msi_id);
384 $cases = $seed_contact->get_linked_beans('cases','aCase');
385 foreach($cases as $case)
387 $output_list[] = get_case_array($case, $msi_id);
390 $bugs = $seed_contact->get_linked_beans('bugs','Bug');
391 foreach($bugs as $bug)
393 $output_list[] = get_bean_array($bug, $msi_id, 'Bug');
396 $projects = $seed_contact->get_linked_beans('project','Project');
397 foreach($projects as $project)
399 $output_list[] = get_bean_array($project, $msi_id, 'Project');
404 // Define a global current user
405 $current_user = null;
408 * Return a list of contact and lead detail records based on a single email
409 * address or a list of email addresses separated by '; '.
411 * This function does not require a session be created first.
413 * @param string $user_name -- User name to authenticate with
414 * @param string $password -- MD5 of the user password
415 * @param string $email_address -- Single email address or '; ' separated list of email addresses (e.x "test@example.com; test2@example.com"
416 * @return contact detail array along with associated objects.
418 function contact_by_email($user_name, $password, $email_address)
420 if(!validate_user($user_name, $password)){
424 $seed_contact = new Contact();
425 $seed_lead = new Lead();
426 $output_list = Array();
427 $email_address_list = explode("; ", $email_address);
429 // remove duplicate email addresses
430 $non_duplicate_email_address_list = Array();
431 foreach( $email_address_list as $single_address)
433 // Check to see if the current address is a match of an existing address
434 $found_match = false;
435 foreach( $non_duplicate_email_address_list as $non_dupe_single)
437 if(strtolower($single_address) == $non_dupe_single)
444 if($found_match == false)
446 $non_duplicate_email_address_list[] = strtolower($single_address);
450 // now copy over the non-duplicated list as the original list.
451 $email_address_list =$non_duplicate_email_address_list;
456 foreach( $email_address_list as $single_address)
458 // verify that contacts can be listed
459 if($seed_contact->ACLAccess('ListView')){
460 add_contacts_matching_email_address($output_list, $single_address, $seed_contact, $msi_id);
462 // verify that leads can be listed
463 if($seed_lead->ACLAccess('ListView')){
464 add_leads_matching_email_address($output_list, $single_address, $seed_lead, $msi_id);
472 * Internal: convert a bean into an array
474 * @param Bean $bean -- The bean to convert
475 * @param int $msi_id -- Russult array index
476 * @return An associated array containing the detail fields.
478 function get_contact_array($contact, $msi_id = '0'){
479 $contact->emailAddress->handleLegacyRetrieve($contact);
480 return Array("name1" => $contact->first_name,
481 "name2" => $contact->last_name,
482 "association" => $contact->account_name,
484 "id" => $contact->id,
486 "email_address" => $contact->email1);
491 * Internal: Convert a user into an array
493 * @param User $user -- The user to convert
494 * @return An associated array containing the detail fields.
496 function get_user_list_array($user) {
497 return Array('email_address' => $user->email1,
498 'user_name' => $user->user_name,
499 'first_name' => $user->first_name,
500 'last_name' => $user->last_name,
501 'department' => $user->department,
503 'title' => $user->title);
507 * Get a full user list.
509 * This function does not require a session be created first.
511 * @param string $user -- user name for validation
512 * @param password $password -- MD5 hash of the user password for validation
513 * @return User Array -- An array of user detail records
515 function user_list($user, $password) {
516 if(!validate_user($user, $password)){
520 $seed_user = new User();
521 $output_list = Array();
522 if(!$seed_user->ACLAccess('ListView')){
525 $userList = $seed_user->get_full_list();
528 foreach($userList as $user) {
529 $output_list[] = get_user_list_array($user);
536 * Internal: Search for contacts based on the specified name and where clause.
537 * Currently only the name is used.
539 * @param string $name -- Name to search for.
540 * @param string $where -- Where clause defaults to ''
541 * @param int $msi_id -- Response array index
542 * @return array -- Resturns a list of contacts that have the provided name.
544 function contact_by_search($name, $where = '', $msi_id = '0')
546 $seed_contact = new Contact();
548 $where = $seed_contact->build_generic_where_clause($name);
550 if(!$seed_contact->ACLAccess('ListView')){
553 $response = $seed_contact->get_list("last_name, first_name", $where, 0);
554 $contactList = $response['list'];
556 $output_list = Array();
558 // create a return array of names and email addresses.
559 foreach($contactList as $contact)
561 $output_list[] = get_contact_array($contact, $msi_id);
566 * Internal: convert a bean into an array
568 * @param Bean $bean -- The bean to convert
569 * @param int $msi_id -- Russult array index
570 * @return An associated array containing the detail fields.
572 function get_lead_array($lead, $msi_id = '0'){
573 $lead->emailAddress->handleLegacyRetrieve($lead);
574 return Array("name1" => $lead->first_name,
575 "name2" => $lead->last_name,
576 "association" => $lead->account_name,
580 "email_address" => $lead->email1);
583 function lead_by_search($name, $where = '', $msi_id = '0')
585 $seed_lead = new Lead();
587 $where = $seed_lead->build_generic_where_clause($name);
589 if(!$seed_lead->ACLAccess('ListView')){
592 $response = $seed_lead->get_list("last_name, first_name", $where, 0);
593 $lead_list = $response['list'];
595 $output_list = Array();
597 // create a return array of names and email addresses.
598 foreach($lead_list as $lead)
600 $output_list[] = get_lead_array($lead, $msi_id);
605 * Internal: convert a bean into an array
607 * @param Bean $bean -- The bean to convert
608 * @param int $msi_id -- Russult array index
609 * @return An associated array containing the detail fields.
611 function get_account_array($account, $msi_id){
612 return Array("name1" => '',
613 "name2" => $account->name,
614 "association" => $account->billing_address_city,
616 "id" => $account->id,
618 "email_address" => $account->email1);
621 function account_by_search($name, $where = '', $msi_id = '0')
623 $seed_account = new Account();
624 if(!$seed_account->ACLAccess('ListView')){
628 $where = $seed_account->build_generic_where_clause($name);
630 $response = $seed_account->get_list("name", $where, 0);
631 $accountList = $response['list'];
633 $output_list = Array();
635 // create a return array of names and email addresses.
636 foreach($accountList as $account)
638 $output_list[] = get_account_array($account, $msi_id);
644 * Internal: convert a bean into an array
646 * @param Bean $bean -- The bean to convert
647 * @param int $msi_id -- Russult array index
648 * @return An associated array containing the detail fields.
650 function get_opportunity_array($value, $msi_id = '0'){
651 return Array("name1" => '',
652 "name2" => $value->name,
653 "association" => $value->account_name,
654 "type" => 'Opportunity',
657 "email_address" => '');
661 function opportunity_by_search($name, $where = '', $msi_id = '0')
663 $seed = new Opportunity();
664 if(!$seed->ACLAccess('ListView')){
668 $where = $seed->build_generic_where_clause($name);
670 $response = $seed->get_list("name", $where, 0);
671 $list = $response['list'];
673 $output_list = Array();
675 // create a return array of names and email addresses.
676 foreach($list as $value)
678 $output_list[] = get_opportunity_array($value, $msi_id);
684 * Internal: convert a bean into an array
686 * @param Bean $bean -- The bean to convert
687 * @param int $msi_id -- Russult array index
688 * @return An associated array containing the detail fields.
690 function get_bean_array($value, $msi_id, $type){
691 return Array("name1" => '',
692 "name2" => $value->get_summary_text(),
697 "email_address" => '');
701 * Internal: convert a bean into an array
703 * @param Bean $bean -- The bean to convert
704 * @param int $msi_id -- Russult array index
705 * @return An associated array containing the detail fields.
707 function get_case_array($value, $msi_id){
708 return Array("name1" => '',
709 "name2" => $value->get_summary_text(),
710 "association" => $value->account_name,
714 "email_address" => '');
718 function bug_by_search($name, $where = '', $msi_id='0')
721 if(!$seed->ACLAccess('ListView')){
725 $where = $seed->build_generic_where_clause($name);
727 $response = $seed->get_list("name", $where, 0);
728 $list = $response['list'];
730 $output_list = Array();
732 // create a return array of names and email addresses.
733 foreach($list as $value)
735 $output_list[] = get_bean_array($value, $msi_id, 'Bug');
740 function case_by_search($name, $where = '', $msi_id='0')
743 if(!$seed->ACLAccess('ListView')){
747 $where = $seed->build_generic_where_clause($name);
749 $response = $seed->get_list("name", $where, 0);
750 $list = $response['list'];
752 $output_list = Array();
754 // create a return array of names and email addresses.
755 foreach($list as $value)
757 $output_list[] = get_case_array($value, $msi_id);
762 * Record and email message and associated it with the specified parent bean and contact ids.
764 * This function does not require a session be created first.
766 * @param string $user_name -- Name of the user to authenticate
767 * @param string $password -- MD5 hash of the user password for authentication
768 * @param id $parent_id -- [optional] The parent record to link the email to.
769 * @param unknown_type $contact_ids
770 * @param string $date_sent -- Date/time the email was sent in Visual Basic Date format. (e.g. '7/22/2004 9:36:31 AM')
771 * @param string $email_subject -- The subject of the email
772 * @param string $email_body -- The body of the email
773 * @return "Invalid username and/or password"
774 * @return -1 If the authenticated user does not have ACL access to save Email.
776 function track_email($user_name, $password,$parent_id, $contact_ids, $date_sent, $email_subject, $email_body)
778 if(!validate_user($user_name, $password)){
779 return "Invalid username and/or password";
781 global $current_user;
783 $GLOBALS['log']->info("In track email: username: $user_name contacts: $contact_ids date_sent: $date_sent");
785 // translate date sent from VB format 7/22/2004 9:36:31 AM
786 // to yyyy-mm-dd 9:36:31 AM
788 $date_sent = preg_replace("@([0-9]*)/([0-9]*)/([0-9]*)( .*$)@", "\\3-\\1-\\2\\4", $date_sent);
791 $seed_user = new User();
793 $user_id = $seed_user->retrieve_user_id($user_name);
794 $seed_user->retrieve($user_id);
795 $current_user = $seed_user;
798 $email = new Email();
799 if(!$email->ACLAccess('Save')){
802 $email->description = $email_body;
803 $email->name = $email_subject;
804 $email->user_id = $user_id;
805 $email->assigned_user_id = $user_id;
806 $email->assigned_user_name = $user_name;
807 $email->date_start = $date_sent;
809 // Save one copy of the email message
810 $parent_id_list = explode(";", $parent_id);
811 $parent_id = explode(':', $parent_id_list[0]);
813 // Having a parent object is optional. If it is set, then associate it.
814 if(isset($parent_id[0]) && isset($parent_id[1]))
816 $email->parent_type = $parent_id[0];
817 $email->parent_id = $parent_id[1];
821 // for each contact, add a link between the contact and the email message
822 $id_list = explode(";", $contact_ids);
824 foreach( $id_list as $id)
827 $email->set_emails_contact_invitee_relationship($email->id, $id);
833 function create_contact($user_name,$password, $first_name, $last_name, $email_address)
835 if(!validate_user($user_name, $password)){
840 $seed_user = new User();
841 $user_id = $seed_user->retrieve_user_id($user_name);
842 $seed_user->retrieve($user_id);
845 $contact = new Contact();
846 if(!$contact->ACLAccess('Save')){
849 $contact->first_name = $first_name;
850 $contact->last_name = $last_name;
851 $contact->email1 = $email_address;
852 $contact->assigned_user_id = $user_id;
853 $contact->assigned_user_name = $user_name;
854 return $contact->save();
856 function create_lead($user_name,$password, $first_name, $last_name, $email_address)
858 if(!validate_user($user_name, $password)){
862 //todo make the activity body not be html encoded
865 $seed_user = new User();
866 $user_id = $seed_user->retrieve_user_id($user_name);
870 if(!$lead->ACLAccess('Save')){
873 $lead->first_name = $first_name;
874 $lead->last_name = $last_name;
875 $lead->email1 = $email_address;
876 $lead->assigned_user_id = $user_id;
877 $lead->assigned_user_name = $user_name;
878 return $lead->save();
880 function create_account($user_name,$password, $name, $phone, $website)
882 if(!validate_user($user_name, $password)){
886 //todo make the activity body not be html encoded
889 $seed_user = new User();
890 $user_id = $seed_user->retrieve_user_id($user_name);
891 $account = new Account();
892 if(!$account->ACLAccess('Save')){
895 $account->name = $name;
896 $account->phone_office = $phone;
897 $account->website = $website;
898 $account->assigned_user_id = $user_id;
899 $account->assigned_user_name = $user_name;
904 function create_case($user_name,$password, $name)
906 if(!validate_user($user_name, $password)){
910 //todo make the activity body not be html encoded
913 $seed_user = new User();
914 $user_id = $seed_user->retrieve_user_id($user_name);
916 if(!$case->ACLAccess('Save')){
919 $case->assigned_user_id = $user_id;
920 $case->assigned_user_name = $user_name;
922 return $case->save();
924 function create_opportunity($user_name,$password, $name, $amount)
926 if(!validate_user($user_name, $password)){
931 $seed_user = new User();
932 $user_id = $seed_user->retrieve_user_id($user_name);
933 $opp = new Opportunity();
934 if(!$opp->ACLAccess('Save')){
938 $opp->amount = $amount;
939 $opp->assigned_user_id = $user_id;
940 $opp->assigned_user_name = $user_name;
944 function search($user_name, $password,$name){
945 if(!validate_user($user_name, $password)){
948 $name_list = explode("; ", $name);
950 foreach( $name_list as $single_name)
952 $list = array_merge($list, contact_by_search($single_name));
953 $list = array_merge($list, lead_by_search($single_name));
954 $list = array_merge($list, account_by_search($single_name));
955 $list = array_merge($list, case_by_search($single_name));
956 $list = array_merge($list, opportunity_by_search($single_name));
957 $list = array_merge($list, bug_by_search($single_name));