From: Mischa POSLAWSKY Date: Wed, 17 Nov 2021 01:21:00 +0000 (+0100) Subject: issue: link open count to filtered page X-Git-Tag: v5.4~5 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/f316947b98249a964b814d65377efda2405e2de1 issue: link open count to filtered page --- diff --git a/format.inc.php b/format.inc.php index 35ecebb..74d53e3 100644 --- a/format.inc.php +++ b/format.inc.php @@ -26,3 +26,9 @@ function showsize($bytes) ]); } +function showlink($title, $href) +{ + return empty($href) ? $title : + sprintf('%s', $href, $title); +} + diff --git a/issue/index.php b/issue/index.php index df1aa68..4f0f57f 100644 --- a/issue/index.php +++ b/issue/index.php @@ -111,8 +111,12 @@ ob_start(); $stats = $Db->query( "SELECT count(*) AS total, count(closed) AS closed FROM issues" )->fetch(); -printf("

%d lopende zaken, %s opgelost

\n", - $stats->total - $stats->closed, $stats->closed +printf("

%s, %s opgelost

\n", + showlink( + sprintf('%d lopende zaken', $stats->total - $stats->closed), + isset($_GET['open']) ? FALSE : '?open' + ), + $stats->closed ); print '