summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine ext:(%22) <lester@lsces.co.uk>2012-04-10 19:36:09 +0100
committerLester Caine ext:(%22) <lester@lsces.co.uk>2012-04-10 19:36:09 +0100
commit82de54b65be65796fda56900330b5be08f5aaa65 (patch)
treeeff561b6bdf207ea7e5f1f88ab1d2a56057c2020
parent739a23f402d6d6116d8ccc53d0752bcae52fb1bd (diff)
downloadcontact-82de54b65be65796fda56900330b5be08f5aaa65.tar.gz
contact-82de54b65be65796fda56900330b5be08f5aaa65.tar.bz2
contact-82de54b65be65796fda56900330b5be08f5aaa65.zip
Add sub-search on xkey data
This needs to be tidied when usec with other filters, but basi list search works on Personal and Business searches.
-rw-r--r--Contact.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/Contact.php b/Contact.php
index 21dcda0..d1fcb4a 100644
--- a/Contact.php
+++ b/Contact.php
@@ -340,14 +340,23 @@ class Contact extends LibertyContent {
elseif ( isset( $pParamHash['contact_type_guid'][0] ) ) {
$joinSql .= "JOIN `".BIT_DB_PREFIX."contact_xref` cx ON cx.`content_id` = con.`content_id` AND cx.`source` = ? ";
$bindVars[] = $pParamHash['contact_type_guid'][0];
- array_push( $bindVars, $this->mContentTypeGuid );
}
-
- $this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, NULL, $pParamHash );
// this will set $find, $sort_mode, $max_records and $offset
extract( $pParamHash );
+ if( isset( $find_xref ) and is_string( $find_xref ) and $find_xref <> '' ) {
+ $joinSql .= "JOIN `".BIT_DB_PREFIX."contact_xref` cy ON cy.`content_id` = con.`content_id` AND cy.`xkey` like ? ";
+ $bindVars[] = '%' . strtoupper( $find_xref ). '%';
+ $pParamHash["listInfo"]["ihash"]["find_xref"] = $find_xref;
+ }
+
+ if ( !isset( $pParamHash['role_id'] ) ) {
+ array_push( $bindVars, $this->mContentTypeGuid );
+ }
+
+ $this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, NULL, $pParamHash );
+
// $pParamHash["listInfo"]["ihash"]['contact_type_guid'] = $contact_type_guid;
$t = $gBitSystem->getUTCTime();