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_ldap.inc.php,1.11.2


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc class.contacts_ldap.inc.php,1.11.2.5,1.11.2.5.2.1 class.contacts_sql.inc.php,1.17.2.2,1.17.2.2.2.1
Date: Wed, 30 Apr 2003 19:30:49 -0400

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

Modified Files:
      Tag: Version-0_9_16-branch
        class.contacts_ldap.inc.php class.contacts_sql.inc.php 
Log Message:
skwashd: added last_mod field to contacts

Index: class.contacts_ldap.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_ldap.inc.php,v
retrieving revision 1.11.2.5
retrieving revision 1.11.2.5.2.1
diff -C2 -r1.11.2.5 -r1.11.2.5.2.1
*** class.contacts_ldap.inc.php 23 Mar 2003 11:47:31 -0000      1.11.2.5
--- class.contacts_ldap.inc.php 30 Apr 2003 23:30:46 -0000      1.11.2.5.2.1
***************
*** 300,304 ****
  
                /* 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; }
--- 300,304 ----
  
                /* 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='', 
$lastmod=-1)
                {
                        if(!$start)  { $start  = 0; }
***************
*** 344,348 ****
                                $filterfields += array('phpgwcontacttypeid' => 
'n');
                                if ($DEBUG) { echo "<br>DEBUG - Filter strings: 
#phpgwcontacttypeid=n#"; }
!                       }       
  
                        if (is_array($this->grants))
--- 344,359 ----
                                $filterfields += array('phpgwcontacttypeid' => 
'n');
                                if ($DEBUG) { echo "<br>DEBUG - Filter strings: 
#phpgwcontacttypeid=n#"; }
!                       }
! 
! 
!               /*
!                       need some way of using the lastmod arg in the filter 
like this:
!                       if($lastmod >= 0)
!                       {
!                               $filterfields += array('last_mod'       => 
(int) $lastmod);
!                       }
!                       or maybe not like this - i am not sure what i am doing 
:)
!               */
!       
  
                        if (is_array($this->grants))
***************
*** 646,649 ****
--- 657,661 ----
                        $ldap_fields['objectclass'][1] = 'inetOrgPerson';
                        $ldap_fields['objectclass'][2] = 'phpgwContact';
+                       //$ldap_fields['last_mod'] = 
$GLOBALS['phpgw']->datetime->gmtnow;               
  
                        /* _debug_array($ldap_fields); */
***************
*** 818,821 ****
--- 830,835 ----
                                }
  
+                               //something here to update the last_mod from 
$GLOBALS['phpgw']->datetime->gmtnow
+ 
                                while (list($x_name,$x_value) = 
each($extra_fields))
                                {
***************
*** 914,916 ****
                }
        }
! ?>
\ No newline at end of file
--- 928,930 ----
                }
        }
! ?>

Index: class.contacts_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.contacts_sql.inc.php,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.2.2.1
diff -C2 -r1.17.2.2 -r1.17.2.2.2.1
*** class.contacts_sql.inc.php  19 Mar 2003 23:13:48 -0000      1.17.2.2
--- class.contacts_sql.inc.php  30 Apr 2003 23:30:47 -0000      1.17.2.2.2.1
***************
*** 296,300 ****
  
                /* 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; }
--- 296,300 ----
  
                /* 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='', 
$lastmod=-1)
                {
                        if(!$start)  { $start  = 0; }
***************
*** 468,471 ****
--- 468,485 ----
                                echo "<br>DEBUG - $ordermethod";
                        }
+                       
+                       if($lastmod >= 0 && $fwhere)
+                       {
+                               $fwhere .= " AND last_mod > $lastmod ";
+                       }
+                       else if($lastmod >= 0)
+                       {
+                               $fwhere = " WHERE last_mod > $lastmod ";
+                       }
+ 
+                       if ($DEBUG && $last_mod_filter && fwhere)
+                       {
+                               echo "<br>DEBUG - last_mod_filter added to 
fwhere: $fwhere";
+                       }
  
                        $filtermethod = '';
***************
*** 519,522 ****
--- 533,537 ----
                                $return_fields[$i]['access'] = 
$this->db->f('access');
                                $return_fields[$i]['cat_id'] = 
$this->db->f('cat_id');
+                               $return_fields[$i]['last_mod']  = 
$this->db->f('last_mod');
  
                                if (gettype($stock_fieldnames) == 'array')
***************
*** 557,563 ****
                                unset($fields['lid']);
                        }
! 
                        list($stock_fields,$stock_fieldnames,$extra_fields) = 
$this->split_stock_and_extras($fields);
  
                        $this->db->query("INSERT INTO $this->std_table 
(owner,access,cat_id,tid,".$lid[0]
                                . implode(",",$this->stock_contact_fields)
--- 572,582 ----
                                unset($fields['lid']);
                        }
!                       
                        list($stock_fields,$stock_fieldnames,$extra_fields) = 
$this->split_stock_and_extras($fields);
  
+                       //this is added here so it is never tainted
+                       $this->stock_contact_fields['last_mod'] = 'last_mod'; 
+                       $stock_fields['last_mod'] = 
$GLOBALS['phpgw']->datetime->gmtnow;
+                       
                        $this->db->query("INSERT INTO $this->std_table 
(owner,access,cat_id,tid,".$lid[0]
                                . implode(",",$this->stock_contact_fields)
***************
*** 615,618 ****
--- 634,638 ----
                                        $ta[] = $stock_fieldname . "='" . 
$this->db->db_addslashes($stock_fields[$stock_fieldname]) . "'";
                                }
+                               $ta[] = 'last_mod=' . 
$GLOBALS['phpgw']->datetime->gmtnow; 
                                $fields_s = ',' . implode(',',$ta);
                                if ($field_s == ',')





reply via email to

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