phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api/class.history.php, 1.1.2.14


From: nomail
Subject: [Phpgroupware-cvs] api/class.history.php, 1.1.2.14
Date: Sun, 11 Jul 2004 20:34:37 +0200

Update of /api
Modified Files:
        Branch: proposal-branch
          class.history.php

date: 2004/07/11 18:34:37;  author: jengo;  state: Exp;  lines: +17 -5

Log Message:
Fixed history not always returning the proper results
=====================================================================
Index: api/class.history.php
diff -u api/class.history.php:1.1.2.13 api/class.history.php:1.1.2.14
--- api/class.history.php:1.1.2.13      Fri Jul  9 06:44:56 2004
+++ api/class.history.php       Sun Jul 11 18:34:37 2004
@@ -50,11 +50,19 @@
                        $args->set('location',REQUIRED,'string');
                        $args = $args->get(func_get_args());
 
-                       $dbresult = $GLOBALS['phpgw']->db->Execute("select * 
from phpgw_history where history_location='" . $args['location'] . "'");
+                       $dbresult = $GLOBALS['phpgw']->db->Execute('
+                               SELECT
+                                       *
+                               FROM
+                                       phpgw_history
+                               WHERE
+                                       history_location=' . 
$GLOBALS['phpgw']->db->qstr($args['location'])
+                       );
 
                        $result = array();
                        while (! $dbresult->EOF)
                        {
+                               unset($new_value,$old_value);
                                if 
(strlen($this->field_execMethod[$dbresult->fields['history_field']]))
                                {
                                        $old_value = 
execMethod($this->field_execMethod[$dbresult->fields['history_field']],$dbresult->fields['history_o_value']);
@@ -62,10 +70,14 @@
                                }
                                else
                                {
-                                       if (! isset($old_value) && ! 
isset($new_value))
+                                       if (! isset($old_value))
+                                       {
+                                               $old_value = 
$dbresult->fields['history_o_value'];      
+                                       }
+
+                                       if (! isset($new_value))
                                        {
-                                               $old_value = 
$dbresult->fields['history_o_value'];
-                                               $new_value = 
$dbresult->fields['history_n_value'];
+                                               $new_value = 
$dbresult->fields['history_n_value'];      
                                        }
                                }
 




reply via email to

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