phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc class.contacts_sql.inc.php,1.18,1.1


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.contacts_sql.inc.php,1.18,1.19 class.contacts_ldap.inc.php,1.14,1.15
Date: Sun, 12 May 2002 20:43:59 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv2410

Modified Files:
        class.contacts_sql.inc.php class.contacts_ldap.inc.php 
Log Message:
Part two of two - implement filter by first char of last name, fullname, or 
company (for now)



Index: class.contacts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_sql.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** class.contacts_sql.inc.php  8 Feb 2002 05:04:33 -0000       1.18
--- class.contacts_sql.inc.php  13 May 2002 00:43:57 -0000      1.19
***************
*** 302,306 ****
  
                /* send this the range, query, sort, order and whatever fields 
you want to see */
!               function 
read($start=0,$limit=0,$fields='',$query='',$filter='',$sort='',$order='')
                {
                        if(!$start)  { $start  = 0; }
--- 302,306 ----
  
                /* send this the range, query, sort, order and whatever fields 
you want to see */
!               function 
read($start=0,$limit=0,$fields='',$query='',$filter='',$sort='',$order='',$cquery='')
                {
                        if(!$start)  { $start  = 0; }
***************
*** 483,487 ****
                        $filtermethod = '';
  
!                       if($query)
                        {
                                $query  = ereg_replace("'",'',$query);
--- 483,501 ----
                        $filtermethod = '';
  
!                       if($cquery)
!                       {
!                               $cfields = array(
!                                       'fn'       => 'cn',
!                                       'n_family' => 'sn',
!                                       'org_name' => 'o'
!                               );
!                               while(list($f,$x) = each($cfields))
!                               {
!                                       $sql .= " $f LIKE '$cquery%' OR ";
!                               }
!                               $sql = substr($sql,0,-3) . ') ' . $fand . 
$filtermethod . $ordermethod;
!                               unset($f); unset($x);
!                       }
!                       elseif($query)
                        {
                                $query  = ereg_replace("'",'',$query);

Index: class.contacts_ldap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_ldap.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** class.contacts_ldap.inc.php 24 Apr 2002 13:21:10 -0000      1.14
--- class.contacts_ldap.inc.php 13 May 2002 00:43:57 -0000      1.15
***************
*** 309,313 ****
  
                /* send this the range, query, sort, order and whatever fields 
you want to see */
!               function 
read($start=0,$limit=0,$fields='',$query='',$filter='',$sort='',$order='')
                {
                        if(!$start)
--- 309,313 ----
  
                /* send this the range, query, sort, order and whatever fields 
you want to see */
!               function 
read($start=0,$limit=0,$fields='',$query='',$filter='',$sort='',$order='',$cquery='')
                {
                        if(!$start)
***************
*** 407,411 ****
                        $myfilter = '';
  
!                       if($query)
                        {
                                reset($this->stock_contact_fields);
--- 407,420 ----
                        $myfilter = '';
  
!                       if($cquery)
!                       {
!                               $cfields = array(
!                                       'fn'       => 'cn',
!                                       'n_family' => 'sn',
!                                       'org_name' => 'o'
!                               );
!                               $myfilter = 
$this->makefilter($filterfields,$cfields,$cquery,$DEBUG,True);
!                       }
!                       elseif($query)
                        {
                                reset($this->stock_contact_fields);
***************
*** 499,503 ****
  
                /* Used by read() above to build the ldap filter string */
!               function makefilter($qarray,$extra='',$query='', $DEBUG=False)
                {
                        if(!is_array($qarray))
--- 508,512 ----
  
                /* Used by read() above to build the ldap filter string */
!               function makefilter($qarray,$extra='',$query='', 
$DEBUG=False,$first=False)
                {
                        if(!is_array($qarray))
***************
*** 548,552 ****
                                                else
                                                {
!                                                       $oquery .= '(' . $x . 
'=*' . $y . '*)';
                                                        $hasor = True;
                                                }
--- 557,568 ----
                                                else
                                                {
!                                                       if($first)
!                                                       {
!                                                               $oquery .= '(' 
. $x . '=' . $y . '*)';
!                                                       }
!                                                       else
!                                                       {
!                                                               $oquery .= '(' 
. $x . '=*' . $y . '*)';
!                                                       }
                                                        $hasor = True;
                                                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]