phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] property/class.historylog.php, 1.1.1.3


From: nomail
Subject: [Phpgroupware-cvs] property/class.historylog.php, 1.1.1.3
Date: Fri, 21 May 2004 19:20:27 -0000

Update of /property
Modified Files:
        Branch: 
          class.historylog.php

date: 2004/04/23 21:26:33;  author: sigurdne;  state: Exp;  lines: +137 -137

Log Message:
no message
=====================================================================
Index: property/class.historylog.php
diff -u property/class.historylog.php:1.1.1.2 
property/class.historylog.php:1.1.1.3
--- property/class.historylog.php:1.1.1.2       Fri Apr 23 20:25:33 2004
+++ property/class.historylog.php       Fri Apr 23 21:26:33 2004
@@ -1,137 +1,137 @@
-<?php
-       
/**************************************************************************\
-       * phpGroupWare API - Record history logging                             
   *
-       * This file written by Joseph Engo <address@hidden>                *
-       * Copyright (C) 2001 Joseph Engo                                        
   *
-       * 
-------------------------------------------------------------------------*
-       * This library is part of the phpGroupWare API                          
   *
-       * http://www.phpgroupware.org/api                                       
   *
-       * 
------------------------------------------------------------------------ *
-       * This library is free software; you can redistribute it and/or modify 
it  *
-       * under the terms of the GNU Lesser General Public License as published 
by *
-       * the Free Software Foundation; either version 2.1 of the License,      
   *
-       * or any later version.                                                 
   *
-       * This library is distributed in the hope that it will be useful, but   
   *
-       * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
-       * See the GNU Lesser General Public License for more details.           
   *
-       * You should have received a copy of the GNU Lesser General Public 
License *
-       * along with this library; if not, write to the Free Software 
Foundation,  *
-       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
-       
\**************************************************************************/
-
-       /* $Id$ */
-
-       class property_historylog
-       {
-               var $db;
-               var $appname;
-               var $table;
-               var $types = array(
-                       'C' => 'Created',
-                       'D' => 'Deleted',
-                       'E' => 'Edited'
-               );
-               var $alternate_handlers = array();
-
-               function property_historylog($appname)
-               {
-                       if (! $appname)
-                       {
-                               $appname = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
-                       }
-
-                       switch($appname)
-                       {
-                               case 'request':
-                                       $this->table='fm_request_history';
-                                       break;
-                               case 'workorder':
-                                       $this->table='fm_workorder_history';
-                                       break;
-                               case 'project':
-                                       $this->table='fm_project_history';
-                                       break;
-                               case 'tts':
-                                       $this->table='fm_tts_history';
-                                       break;
-                               case 'drawing':
-                                       $this->table='fm_drawing_history';
-                                       break;
-                               case 'document':
-                                       $this->table='fm_document_history';
-                                       break;
-                       }
-
-
-                       $this->appname = $appname;
-                       $this->db      = $GLOBALS['phpgw']->db;
-               }
-
-               function delete($record_id)
-               {
-                       $this->db->query("delete from $this->table where 
history_record_id='$record_id' and "
-                               . "history_appname='" . $this->appname . 
"'",__LINE__,__FILE__);
-               }
-
-               function add($status,$record_id,$new_value)
-               {
-                       $this->db->query("insert into $this->table 
(history_record_id,"
-                               . 
"history_appname,history_owner,history_status,history_new_value,history_timestamp)
 "
-                               . "values ('$record_id','" . $this->appname . 
"','"
-                               . $GLOBALS['phpgw_data']['user']['id'] . 
"','$status','"
-                               . addslashes($new_value) . "','" . 
$this->db->to_timestamp(time())
-                               . "')",__LINE__,__FILE__);
-               }
-
-               // array $filter_out
-               function return_array($filter_out,$only_show,$_orderby = 
'',$sort = '', $record_id)
-               {
-
-                       if (! $sort || ! $_orderby)
-                       {
-                               $orderby = 'order by 
history_timestamp,history_id';
-                       }
-                       else
-                       {
-                               $orderby = "order by $_orderby $sort";
-                       }
-
-                       while (is_array($filter_out) && list(,$_filter) = 
each($filter_out))
-                       {
-                               $filtered[] = "history_status != '$_filter'";
-                       }
-
-                       if (is_array($filtered))
-                       {
-                               $filter = ' and ' . implode(' and ',$filtered);
-                       }
-
-                       while (is_array($only_show) && list(,$_filter) = 
each($only_show))
-                       {
-                               $_only_show[] = "history_status='$_filter'";
-                       }
-
-                       if (is_array($_only_show))
-                       {
-                               $only_show_filter = ' and (' . implode(' or 
',$_only_show) . ')';
-                       }
-
-                       $this->db->query("select * from $this->table where 
history_appname='"
-                               . $this->appname . "' and 
history_record_id='$record_id' $filter $only_show_filter "
-                               . "$orderby",__LINE__,__FILE__);
-                       while ($this->db->next_record())
-                       {
-                               $return_values[] = array(
-                                       'id'         => 
$this->db->f('history_id'),
-                                       'record_id'  => 
$this->db->f('history_record_id'),
-                                       'owner'      => 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('history_owner')),
-//                                     'status'     => 
lang($this->types[$this->db->f('history_status')]),
-                                       'status'     => ereg_replace(' 
','',$this->db->f('history_status')),
-                                       'new_value'  => 
$this->db->f('history_new_value'),
-                                       'datetime'   => 
$this->db->from_timestamp($this->db->f('history_timestamp'))
-                               );
-                       }
-                       return $return_values;
-               }
-       }
+<?php
+       
/**************************************************************************\
+       * phpGroupWare API - Record history logging                             
   *
+       * This file written by Joseph Engo <address@hidden>                *
+       * Copyright (C) 2001 Joseph Engo                                        
   *
+       * 
-------------------------------------------------------------------------*
+       * This library is part of the phpGroupWare API                          
   *
+       * http://www.phpgroupware.org/api                                       
   *
+       * 
------------------------------------------------------------------------ *
+       * This library is free software; you can redistribute it and/or modify 
it  *
+       * under the terms of the GNU Lesser General Public License as published 
by *
+       * the Free Software Foundation; either version 2.1 of the License,      
   *
+       * or any later version.                                                 
   *
+       * This library is distributed in the hope that it will be useful, but   
   *
+       * WITHOUT ANY WARRANTY; without even the implied warranty of            
   *
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  
   *
+       * See the GNU Lesser General Public License for more details.           
   *
+       * You should have received a copy of the GNU Lesser General Public 
License *
+       * along with this library; if not, write to the Free Software 
Foundation,  *
+       * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA         
   *
+       
\**************************************************************************/
+
+       /* $Id$ */
+
+       class property_historylog
+       {
+               var $db;
+               var $appname;
+               var $table;
+               var $types = array(
+                       'C' => 'Created',
+                       'D' => 'Deleted',
+                       'E' => 'Edited'
+               );
+               var $alternate_handlers = array();
+
+               function property_historylog($appname)
+               {
+                       if (! $appname)
+                       {
+                               $appname = 'property'; 
//$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       }
+
+                       switch($appname)
+                       {
+                               case 'request':
+                                       $this->table='fm_request_history';
+                                       break;
+                               case 'workorder':
+                                       $this->table='fm_workorder_history';
+                                       break;
+                               case 'project':
+                                       $this->table='fm_project_history';
+                                       break;
+                               case 'tts':
+                                       $this->table='fm_tts_history';
+                                       break;
+                               case 'drawing':
+                                       $this->table='fm_drawing_history';
+                                       break;
+                               case 'document':
+                                       $this->table='fm_document_history';
+                                       break;
+                       }
+
+
+                       $this->appname = $appname;
+                       $this->db      = $GLOBALS['phpgw']->db;
+               }
+
+               function delete($record_id)
+               {
+                       $this->db->query("delete from $this->table where 
history_record_id='$record_id' and "
+                               . "history_appname='" . $this->appname . 
"'",__LINE__,__FILE__);
+               }
+
+               function add($status,$record_id,$new_value)
+               {
+                       $this->db->query("insert into $this->table 
(history_record_id,"
+                               . 
"history_appname,history_owner,history_status,history_new_value,history_timestamp)
 "
+                               . "values ('$record_id','" . $this->appname . 
"','"
+                               . $GLOBALS['phpgw_data']['user']['id'] . 
"','$status','"
+                               . addslashes($new_value) . "','" . 
$this->db->to_timestamp(time())
+                               . "')",__LINE__,__FILE__);
+               }
+
+               // array $filter_out
+               function return_array($filter_out,$only_show,$_orderby = 
'',$sort = '', $record_id)
+               {
+
+                       if (! $sort || ! $_orderby)
+                       {
+                               $orderby = 'order by 
history_timestamp,history_id';
+                       }
+                       else
+                       {
+                               $orderby = "order by $_orderby $sort";
+                       }
+
+                       while (is_array($filter_out) && list(,$_filter) = 
each($filter_out))
+                       {
+                               $filtered[] = "history_status != '$_filter'";
+                       }
+
+                       if (is_array($filtered))
+                       {
+                               $filter = ' and ' . implode(' and ',$filtered);
+                       }
+
+                       while (is_array($only_show) && list(,$_filter) = 
each($only_show))
+                       {
+                               $_only_show[] = "history_status='$_filter'";
+                       }
+
+                       if (is_array($_only_show))
+                       {
+                               $only_show_filter = ' and (' . implode(' or 
',$_only_show) . ')';
+                       }
+
+                       $this->db->query("select * from $this->table where 
history_appname='"
+                               . $this->appname . "' and 
history_record_id='$record_id' $filter $only_show_filter "
+                               . "$orderby",__LINE__,__FILE__);
+                       while ($this->db->next_record())
+                       {
+                               $return_values[] = array(
+                                       'id'         => 
$this->db->f('history_id'),
+                                       'record_id'  => 
$this->db->f('history_record_id'),
+                                       'owner'      => 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('history_owner')),
+//                                     'status'     => 
lang($this->types[$this->db->f('history_status')]),
+                                       'status'     => ereg_replace(' 
','',$this->db->f('history_status')),
+                                       'new_value'  => 
$this->db->f('history_new_value'),
+                                       'datetime'   => 
$this->db->from_timestamp($this->db->f('history_timestamp'))
+                               );
+                       }
+                       return $return_values;
+               }
+       }




reply via email to

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