Group history changes by date and user.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 11 Apr 2020 05:44:51 +0000 (01:44 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 11 Apr 2020 05:49:22 +0000 (01:49 -0400)
showreport.php
templates/history_bit.tpl
templates/history_group.tpl [new file with mode: 0644]

index da3fbbb2af2c305201119249c41d07679fc6f5d9..fe3e51d29d19fee94e4d1a618a5a7eb0082c7433 100644 (file)
@@ -24,6 +24,7 @@ $fetchtemplates = array(
        'showreport_attachment',
        'showreport_comment',
        'history_bit',
+       'history_group',
        'quicksearch',
        'bugfield_static_text'
 );
@@ -320,7 +321,7 @@ $customfield_logs = $db->query("
 
 while ($field = $db->fetch_array($customfield_logs))
 {
-       $fieldlist["$field[fieldid]"] = sprintf(T('Custom Field %1$s (%2$s)'), $field['fieldid'], $field['name']);
+       $fieldlist["$field[fieldid]"] = $field['name'];
 }
 
 $logs = array();
@@ -347,8 +348,7 @@ $logusers = array();
 
 foreach ($logs AS $dateline => $logitems)
 {
-       $show['group'] = true;
-
+       $changes = '';
        foreach ($logitems AS $log)
        {
                if ($log['field'] == '.' OR ($log['original'] == '' AND $log['changed'] == ''))
@@ -418,13 +418,9 @@ foreach ($logs AS $dateline => $logitems)
                                }
                        }
                }
-
-               $funct->exec_swap_bg('', 'altcolor');
-               $bgcolor = $funct->bgcolour;
-
-               eval('$BUGITEMS[$dateline] .= "' . $template->fetch('history_bit') . '";');
-               $show['group'] = false;
+               eval('$changes .= "' . $template->fetch('history_bit') . '";');
        }
+       eval('$BUGITEMS[$dateline] .= "' . $template->fetch('history_group') . '";');
 }
 
 // we can now remove all useless logs
@@ -472,7 +468,6 @@ while ($comment = $db->fetch_array($comments_fetch))
        }
        else
        {
-               $comments .= $temp;
                $BUGITEMS[$comment['dateline']] = $temp . $BUGITEMS[$comment['dateline']];
        }
 }
index e87be81322b1920bc2918ccfdb7ef1d985e42cbb..8d1be3273d62a7029a8e47903f42ab509c928888 100644 (file)
@@ -1,3 +1 @@
-<div class="history">
-  <if condition="$show['group']">$log[user] changed </if>$log[field] from "$log[original]" to "$log[changed]".
-</div>
+  <li>$log[field] from "$log[original]" to "$log[changed]"</li>
diff --git a/templates/history_group.tpl b/templates/history_group.tpl
new file mode 100644 (file)
index 0000000..d0d2d8e
--- /dev/null
@@ -0,0 +1,6 @@
+<div class="history">
+  On $log[date], $log[user] changed:
+  <ul>
+  $changes
+  </ul>
+</div>