r1400: Fixed the issue with logging in mass updates
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 13 Feb 2007 06:45:26 +0000 (06:45 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 13 Feb 2007 06:45:26 +0000 (06:45 +0000)
editreport.php
includes/class_logging.php
search.php

index 170ac044d5e12af83445e26f4e48f55c536cd1f4..992a1702fb60b74921efe2058a246a1a0cc54b8b 100644 (file)
@@ -55,16 +55,6 @@ require_once('./includes/class_logging.php');
 $log = new Logging;
 $log->set_bugid($bug['bugid']);
 
-$excludeFields = array(
-       'bugid',
-       'lastposttime',
-       'lastpostby',
-       'lastpostbyname',
-       'hiddenlastposttime',
-       'hiddenlastpostby',
-       'hiddenlastpostbyname',
-);
-
 $notif = new NotificationCenter;
 
 $bugapi = new BugAPI($bugsys);
@@ -108,7 +98,7 @@ if ($_POST['do'] == 'update')
                $message->error_permission();
        }
        
-       $log->add_data(true, $bugapi->objdata, $excludeFields, true);
+       $log->add_data(true, $bugapi->objdata, $log->getCommonFields(), true);
        
        // -------------------------------------------------------------------
        // handle automations
@@ -213,7 +203,7 @@ if ($_POST['do'] == 'update')
        // handle logging and perform updates
        
        $notif->set_bug_data($bugapi->objdata, $bugapi->values);
-       $log->add_data(false, $bugapi->values, $excludeFields, true);
+       $log->add_data(false, $bugapi->values, $log->getCommonFields(), true);
                
        $bugapi->update();
        
index 782eb2fe4e4539347f47168c0ca22e3083a3518a..dfceac75e35d67896d8e49defbb4bf6de46c79ec 100644 (file)
@@ -228,27 +228,22 @@ class Logging
        
        // ###################################################################
        /**
-       * Returns an array of the common fields used by the logging mechanism
+       * Returns an array of the fields commonly ignored
        *
        * @access       public
        *
-       * @return       array   Fields used in logging
+       * @return       array   Fields ignored in logging
        */
        function getCommonFields()
        {
                return array(
-                       'duplicateof',
-                       'dependency',
-                       'hidden',
-                       'summary',
-                       'status',
-                       'severity',
-                       'priority',
-                       'version',
-                       'assignedto'    => 'assignto',
-                       'resolution',
-                       'product',
-                       'component'
+                       'bugid',
+                       'lastposttime',
+                       'lastpostby',
+                       'lastpostbyname',
+                       'hiddenlastposttime',
+                       'hiddenlastpostby',
+                       'hiddenlastpostbyname'
                );
        }
 }
index d32ce571f9c71074f8f8984dfb2f7842b4d2f8ed..82cbfebd5d143e4b6aec2dfebb7d4b8b04bc2827 100644 (file)
@@ -518,10 +518,11 @@ if ($_POST['do'] == 'doupdate')
                $api = new BugApi($bugsys);
                $api->set('bugid', $bug['bugid']);
                $api->set_condition();
-               
+               $api->values = $bug;
+                               
                $log = new Logging();
                $log->set_bugid($bug['bugid']);
-               $log->add_data(true, $bug, $log->getCommonFields());
+               $log->add_data(true, $bug, $log->getCommonFields(), true);
 
                if ($bugsys->in['status'] AND can_perform('canchangestatus', $bug['product']))
                {
@@ -553,7 +554,7 @@ if ($_POST['do'] == 'doupdate')
                
                process_custom_fields($api, $message, false, true);
                
-               $log->add_data(false, $api->values, $log->getCommonFields());
+               $log->add_data(false, $api->values, $log->getCommonFields(), true);
                                
                $api->update();
                $log->update_history();