From ed4898fd4105bc86bf368fcd5e1772dd0dbd8e95 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 11 Apr 2020 01:44:51 -0400 Subject: [PATCH] Group history changes by date and user. --- showreport.php | 15 +++++---------- templates/history_bit.tpl | 4 +--- templates/history_group.tpl | 6 ++++++ 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 templates/history_group.tpl diff --git a/showreport.php b/showreport.php index da3fbbb..fe3e51d 100644 --- a/showreport.php +++ b/showreport.php @@ -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']]; } } diff --git a/templates/history_bit.tpl b/templates/history_bit.tpl index e87be81..8d1be32 100644 --- a/templates/history_bit.tpl +++ b/templates/history_bit.tpl @@ -1,3 +1 @@ -
- $log[user] changed $log[field] from "$log[original]" to "$log[changed]". -
+
  • $log[field] from "$log[original]" to "$log[changed]"
  • diff --git a/templates/history_group.tpl b/templates/history_group.tpl new file mode 100644 index 0000000..d0d2d8e --- /dev/null +++ b/templates/history_group.tpl @@ -0,0 +1,6 @@ +
    + On $log[date], $log[user] changed: + +
    -- 2.22.5