issue: link open count to filtered page
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 17 Nov 2021 01:21:00 +0000 (02:21 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 17 Nov 2021 01:54:56 +0000 (02:54 +0100)
format.inc.php
issue/index.php

index 35ecebb954ecd1de2f88658bcc5043921cb3b100..74d53e3fe833e5d6b3a6144084975cc61a8e8ab5 100644 (file)
@@ -26,3 +26,9 @@ function showsize($bytes)
        ]);
 }
 
+function showlink($title, $href)
+{
+       return empty($href) ? $title :
+               sprintf('<a href="%s">%s</a>', $href, $title);
+}
+
index df1aa6869c0511e57fafe1c7c3b5053cd3fbeac4..4f0f57f5b9beb1c94446cac70f9a762aee915248 100644 (file)
@@ -111,8 +111,12 @@ ob_start();
 $stats = $Db->query(
        "SELECT count(*) AS total, count(closed) AS closed FROM issues"
 )->fetch();
-printf("<h4>%d lopende zaken, %s opgelost</h4>\n",
-       $stats->total - $stats->closed, $stats->closed
+printf("<h4>%s, %s opgelost</h4>\n",
+       showlink(
+               sprintf('%d lopende zaken', $stats->total - $stats->closed),
+               isset($_GET['open']) ? FALSE : '?open'
+       ),
+       $stats->closed
 );
 print '<ul>';
 while ($row = $query->fetch()) {