[turba] Patch to add documentation for filter in sources.php

Manilal K M libregeek at gmail.com
Thu Jun 15 23:50:13 PDT 2006


Hello all,
  I have prepared a small patch for documenting the filter settings in
sources.php.dist. The patch has also an example of retrieving records
from two different tables using  JOIN. I think this will be helpful
for those who use turba in future.

regards
Manilal
manilal.krishnapillai at ejyothi.com
<patch>
? add_docs.patch
Index: config/sources.php.dist
===================================================================
RCS file: /repository/turba/config/sources.php.dist,v
retrieving revision 1.150
diff -u -p -r1.150 sources.php.dist
--- config/sources.php.dist 22 May 2006 03:02:16 -0000  1.150
+++ config/sources.php.dist 16 Jun 2006 06:44:01 -0000
@@ -44,6 +44,13 @@
  *                  the driver to inspect the LDAP schema for particular
  *                  attributes by the type defined in the corresponding schema
  *
+ *   filter:        Filter helps to filter your result based on certain
+ *                  condition. If the source is a  external
+ *                  sql database, then filter can be specified to avoid some
+ *                  unwanted data. For example, to select records with the
+ *                  delete flag = 0 :
+ *                  'filter' = 'deleted=0'
+ *
  * map:         This is a list of mappings from the standard Turba attribute
  *              names (on the left) to the attribute names by which they are
  *              known in this contact source (on the right). Turba also
@@ -127,6 +134,20 @@ $cfgSources['localsql'] = array(
     //     'table' => 'turba_objects',
     //     'charset' => 'iso-8859-1'
     // ),
+
+    // Old Example using two tables as datasource.
+    // 'params' => array(
+    //    'phptype' => 'mysql',
+    //    'hostspec' => 'localhost',
+    //    'username' => 'uuuuuu',
+    //    'password' => '********',
+    //    'database' => 'dbdbdb',
+    //    'table' => 'leaddetails LEFT JOIN leadaddress ON
+    //                leaddetails.leadid=leadaddress.leadaddressid',
+    //    'filter' => 'leaddetails.converted=0',
+    //    'charset' => 'iso-8859-1'
+    //),
+
     'map' => array(
         '__key' => 'object_id',
         '__owner' => 'owner_id',
Index: docs/CHANGES
===================================================================
RCS file: /repository/turba/docs/CHANGES,v
retrieving revision 1.297
diff -u -p -r1.297 CHANGES
--- docs/CHANGES    23 May 2006 17:38:22 -0000  1.297
+++ docs/CHANGES    16 Jun 2006 06:44:02 -0000
@@ -1,7 +1,9 @@
 --------
 v2.2-cvs
 --------
-
+      Add documentation for filter in sources.php.dist and example for
+      retrieving data from two different tables.
+      (Manilal K M <manilal.krishnapillai at ejyothi.com>)
 [jmf] Sort listings on multiple columns.
 [cjh] Show numeric and alpha pagers at the top of listings, not the bottom
       (Bug #1312).
</patch>


More information about the turba mailing list