[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] [19088] make the fields searched for person more reas
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] [19088] make the fields searched for person more reasonable, now we just use all the name related fields - for example sound and pubkey will turn up all kinds of irrelevant records |
Date: |
Thu, 19 Feb 2009 23:32:09 +0000 |
Revision: 19088
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19088
Author: skwashd
Date: 2009-02-19 23:32:09 +0000 (Thu, 19 Feb 2009)
Log Message:
-----------
make the fields searched for person more reasonable, now we just use all the
name related fields - for example sound and pubkey will turn up all kinds of
irrelevant records
Modified Paths:
--------------
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook.inc.php
Modified:
branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook.inc.php
===================================================================
--- branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook.inc.php
2009-02-18 18:34:44 UTC (rev 19087)
+++ branches/Version-0_9_16-branch/addressbook/inc/class.boaddressbook.inc.php
2009-02-19 23:32:09 UTC (rev 19088)
@@ -491,61 +491,67 @@
{
return $this->so->copy_contact($contact_id);
}
-
+
/**
- * Criteria for index primordially
- *
- * return string criteria for search.
- */
+ * Criteria for index primordially
+ *
+ * return string criteria for search.
+ */
function criteria_contacts($access, $category, $field,
$pattern, $show_fields)
{
- if($pattern)
+ if ($pattern)
{
- switch($field)
+ switch ($field)
{
- case 'person':
- $fields = array(
- 'per_full_name',
- 'per_prefix',
- 'per_suffix',
- 'per_birthday',
- 'per_pubkey',
- 'per_title',
- 'per_department',
- 'per_initials',
- 'per_sound',
- 'per_active');
- break;
- case 'org':
- $fields = array('org_name');
- break;
- case 'comms':
- foreach($this->comm_descr as $data)
- {
- $comms[] =
$data['comm_description'];
- }
- $fields['comm_media'] = $comms;
- break;
- case 'location':
- $fields = array('addr_add1',
+ case 'person':
+ $fields = array
+ (
+ 'per_full_name',
+ 'per_prefix',
+ 'per_suffix',
+ 'per_initials'
+ );
+ break;
+
+ case 'org':
+ $fields = array ('org_name' );
+ break;
+
+ case 'comms':
+ $fields['comm_media'] = array();
+ foreach ( $this->comm_descr as
$data )
+ {
+ $fields['comm_media'][]
= $data ['comm_description'];
+ }
+ break;
+
+ case 'location':
+ $fields = array
+ (
+ 'addr_add1',
'addr_add2',
'addr_add3',
'addr_city',
'addr_state',
'addr_postal_code',
- 'addr_country');
- break;
- case 'other':
- $fields = array('other_value');
- break;
- case 'note':
- $fields = array('note_text');
- break;
- default:
- $fields = array();
+ 'addr_country'
+ );
+ break;
+
+ case 'other':
+ $fields = array ('other_value');
+ break;
+
+ case 'note':
+ $fields = array ('note_text');
+ break;
+
+ default :
+ $fields = array ();
}
}
- return
$this->so->criteria_contacts($GLOBALS['phpgw_info']['user']['account_id'],
$access, $category, $fields, $pattern, $show_fields);
+ return
$this->so->criteria_contacts($GLOBALS['phpgw_info']['user']['account_id'],
+ $access, $category, $fields, $pattern,
$show_fields );
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] [19088] make the fields searched for person more reasonable, now we just use all the name related fields - for example sound and pubkey will turn up all kinds of irrelevant records,
Dave Hall <=