From f316947b98249a964b814d65377efda2405e2de1 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 17 Nov 2021 02:21:00 +0100 Subject: [PATCH] issue: link open count to filtered page --- format.inc.php | 6 ++++++ issue/index.php | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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 '