From 95b037f55a21f6bd70c50801f5c6b0a23daee27c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 27 Apr 2021 20:43:52 +0200 Subject: [PATCH] issue/activity: concatenate similar replies Omit title for unchanged ticket and author, causing stacked images from different messages. Don't bother with closing
for simplicity. --- widget/issue/activity.php | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/widget/issue/activity.php b/widget/issue/activity.php index 153034e..23b95c6 100644 --- a/widget/issue/activity.php +++ b/widget/issue/activity.php @@ -17,28 +17,29 @@ $msgformat = [ print '
'; -$group = NULL; +$prev = NULL; while ($row = $query->fetch()) { - print '
'; - if ($group !== $row->issue) { - $group = $row->issue; - printf('%s', $row->page, $row->subject); - if ($row->closed) { - print ' (opgelost)'; + if (!$prev or $prev->issue !== $row->issue or $prev->author !== $row->author) { + print '
'; + if (!$prev or $prev->issue !== $row->issue) { + printf('%s', $row->page, $row->subject); + if ($row->closed) { + print ' (opgelost)'; + } } + print ''; + if ($row->author and $rowuser = new User("profile/{$row->author}")) { + printf('%s ', $rowuser->html); + } + printf('%s', + showdate(preg_split('/\D/', $row->created)) + ); + print ""; + print '
'; + print '
'; } - print ''; - if ($row->author and $rowuser = new User("profile/{$row->author}")) { - printf('%s ', $rowuser->html); - } - printf('%s', - showdate(preg_split('/\D/', $row->created)) - ); - print ""; - print ''; - print '
'; print preg_replace(array_keys($msgformat), array_values($msgformat), $row->message); - print "
\n"; + $prev = $row; } print "
\n"; -- 2.30.0