summaryrefslogtreecommitdiff
path: root/Contact.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2011-07-12 20:19:42 +0100
committerLester Caine <lester@lsces.co.uk>2011-07-12 20:19:42 +0100
commit669194f4d2d282230239e661a19fbc549580cd27 (patch)
tree0d6ab33e1176d6f09f1a2cda32d39f553492697e /Contact.php
parent732fc0d2eb77bda62f1d09e13b2083fd17d5b3df (diff)
downloadcontact-669194f4d2d282230239e661a19fbc549580cd27.tar.gz
contact-669194f4d2d282230239e661a19fbc549580cd27.tar.bz2
contact-669194f4d2d282230239e661a19fbc549580cd27.zip
Move geo tools to contact ( isolate later )
Diffstat (limited to 'Contact.php')
-rw-r--r--Contact.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/Contact.php b/Contact.php
index 42ec0a5..21dcda0 100644
--- a/Contact.php
+++ b/Contact.php
@@ -15,7 +15,7 @@
require_once( CONTACT_PKG_PATH.'ContactXref.php' );
require_once( CONTACT_PKG_PATH.'ContactType.php' );
require_once( LIBERTY_PKG_PATH.'LibertyContent.php' ); // Contact base class
-require_once( NLPG_PKG_PATH.'lib/phpcoord-2.3.php' );
+require_once( CONTACT_PKG_PATH.'lib/phpcoord-2.3.php' );
define( 'CONTACT_CONTENT_TYPE_GUID', 'contact' );
@@ -330,12 +330,19 @@ class Contact extends LibertyContent {
$whereSql = '';
$bindVars = array();
- if ( isset( $pParamHash['contact_type_guid'][0] ) ) {
+ if ( isset( $pParamHash['role_id'] ) ) {
+ array_push( $bindVars, $this->mContentTypeGuid );
+ if ( $pParamHash['role_id'] > 0 ) {
+ $whereSql .= " AND con.`role_id` = ? ";
+ $bindVars[] = $pParamHash['role_id'];
+ }
+ }
+ 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 );
}
- 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