[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.historylog.inc.php,1.6,1.6.2.
From: |
Joseph Engo <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.historylog.inc.php,1.6,1.6.2.1 |
Date: |
Thu, 24 Jan 2002 14:26:35 -0500 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv11279/inc
Modified Files:
Tag: Version-0_9_14-branch
class.historylog.inc.php
Log Message:
- Added old value to history class
- The history class will now detect weather or not changes have been made to an
item rather then the developer having a million ifs in there code
Index: class.historylog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.historylog.inc.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** class.historylog.inc.php 17 Oct 2001 02:33:05 -0000 1.6
--- class.historylog.inc.php 24 Jan 2002 19:26:33 -0000 1.6.2.1
***************
*** 21,25 ****
\**************************************************************************/
! /* $Id$ */
class historylog
--- 21,26 ----
\**************************************************************************/
! // $Id$
! // $Source$
class historylog
***************
*** 53,63 ****
}
! function add($status,$record_id,$new_value)
{
! $this->db->query("insert into phpgw_history_log
(history_record_id,"
! .
"history_appname,history_owner,history_status,history_new_value) "
! . "values ('$record_id','" . $this->appname .
"','"
! . $GLOBALS['phpgw_info']['user']['account_id']
. "','$status','"
! . addslashes($new_value) .
"')",__LINE__,__FILE__);
}
--- 54,67 ----
}
! function add($status,$record_id,$new_value,$old_value)
{
! if ($new_value != $old_value)
! {
! $this->db->query("insert into phpgw_history_log
(history_record_id,"
! .
"history_appname,history_owner,history_status,history_new_value,history_old_value)
"
! . "values ('$record_id','" .
$this->appname . "','"
! .
$GLOBALS['phpgw_info']['user']['account_id'] . "','$status','"
! . addslashes($new_value) . "','" .
addslashes($old_value) . "')",__LINE__,__FILE__);
! }
}
***************
*** 107,110 ****
--- 111,115 ----
'status' => ereg_replace('
','',$this->db->f('history_status')),
'new_value' =>
$this->db->f('history_new_value'),
+ 'old_value' =>
$this->db->f('history_old_value'),
'datetime' =>
$this->db->from_timestamp($this->db->f('history_timestamp'))
);
***************
*** 134,137 ****
--- 139,143 ----
$this->template->set_var('sort_status',lang('Status'));
$this->template->set_var('sort_new_value',lang('New
value'));
+ $this->template->set_var('sort_old_value',lang('Old
value'));
$values =
$this->return_array($filter_out,array(),$orderby,$sort,$record_id);
***************
*** 157,165 ****
--- 163,177 ----
$this->template->set_var('row_new_value',$s);
unset($s);
+
+ eval('\$s = ' .
$this->alternate_handlers[$value['status']] . '(' . $value['old_value'] . ');');
+
$this->template->set_var('row_old_value',$s);
+ unset($s);
}
else
{
$this->template->set_var('row_new_value',$value['new_value']);
+
$this->template->set_var('row_old_value',$value['old_value']);
}
+
$this->template->set_var('row_status',$this->types[$value['status']]);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.historylog.inc.php,1.6,1.6.2.1,
Joseph Engo <address@hidden> <=