From: Alex Sadleir Date: Sun, 03 Nov 2013 06:20:13 +0000 Subject: sort agencies by name X-Git-Url: https://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=a377d3925bd3611b7507e3b51a900f4d4274cf5d --- sort agencies by name Former-commit-id: 24f1070892cb642be8833a65922d273623957f27 --- --- a/documents/agency.php +++ b/documents/agency.php @@ -31,6 +31,12 @@ } else { $rows = $foidocsdb->get_view("app", "byAgencyID?group=true", null, false, false, true)->rows; if ($rows) { +function cmp($a, $b) +{ + global $idtoname; + return strcmp($idtoname[$a->key], $idtoname[$b->key]); +} +usort($rows, "cmp"); foreach ($rows as $row) { echo '' . $idtoname[$row->key] . " (" . $row->value . " records)
\n"; } --- a/documents/template.inc.php +++ b/documents/template.inc.php @@ -77,7 +77,7 @@