alphabetize other foi bodies in export
alphabetize other foi bodies in export


Former-commit-id: 84d5de2ae6fbb5e0ff72cfa07a602b3c8c3f1a3d

--- a/alaveteli/exportAgencies.csv.php
+++ b/alaveteli/exportAgencies.csv.php
@@ -52,7 +52,7 @@
                 $row["request_email"] = (isset($agency->value->foiEmail) ? $agency->value->foiEmail : "");
                 $row["short_name"] = (isset($agency->value->shortName) ? $agency->value->shortName : "");
                 $row["notes"] = (isset($agency->value->description) ? $agency->value->description : "");
-                
+
                 $otherBodies = Array();
                 if (isset($agency->value->foiBodies)) {
                     $otherBodies = array_merge($otherBodies, $agency->value->foiBodies);
@@ -60,10 +60,11 @@
                 if (isset($agency->value->positions)) {
                     $otherBodies = array_merge($otherBodies, $agency->value->positions);
                 }
+                sort($otherBodies);
                 if (count($otherBodies) > 0) {
-                    $row["notes"] .= "<br/> This department also responds to requests for information held by ".implode(",",$otherBodies);
+                    $row["notes"] .= "<br/> This department also responds to requests for information held by " . implode(", ", $otherBodies);
                 }
-                
+
                 $row["publication_scheme"] = (isset($agency->value->infoPublicationSchemeURL) ? $agency->value->infoPublicationSchemeURL : "");
                 $row["home_page"] = (isset($agency->value->website) ? $agency->value->website : "");
                 if ($agency->value->orgType == "FMA-DepartmentOfState") {
@@ -74,9 +75,6 @@
                 $row["tag_string"] .= " " . $agency->value->orgType;
                 $row["tag_string"] .= " federal";
                 fputcsv($fp, array_values($row));
-
-            
-        
             }
         }
     } catch (SetteeRestClientException $e) {