add prefix for positions
add prefix for positions


Former-commit-id: 2eb28a3a36f76484db67773b1c6df6f238257aad

--- a/.gitmodules
+++ b/.gitmodules
@@ -25,4 +25,7 @@
 [submodule "lib/querypath"]
 	path = lib/querypath
 	url = https://github.com/technosophos/querypath.git
+[submodule "lib/amon-php"]
+	path = lib/amon-php
+	url = https://github.com/martinrusev/amon-php.git
 

--- a/alaveteli/exportAgencies.csv.php
+++ b/alaveteli/exportAgencies.csv.php
@@ -52,18 +52,23 @@
                 $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);
                 }
                 if (isset($agency->value->positions)) {
-                    $otherBodies = array_merge($otherBodies, $agency->value->positions);
+                    $positions = Array();
+                    foreach ($agency->value->positions as $position) {
+                        $positions[] = "Office of the ".$position;
+                    }
+                    $otherBodies = array_merge($otherBodies, $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 +79,6 @@
                 $row["tag_string"] .= " " . $agency->value->orgType;
                 $row["tag_string"] .= " federal";
                 fputcsv($fp, array_values($row));
-
-            
-        
             }
         }
     } catch (SetteeRestClientException $e) {

--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -14,6 +14,11 @@
 require_once $basePath.'lib/Requests/library/Requests.php';
 
 Requests::register_autoloader();
+require $basePath."lib/amon-php/amon.php";
+Amon::config(array('address'=> 'http://127.0.0.1:2464', 
+		'protocol' => 'http', 
+		'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw"));
+Amon::setup_exception_handler();
 # Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735
 
 function object_to_array(stdClass $Class) {

--- a/include/couchdb.inc.php
+++ b/include/couchdb.inc.php
@@ -168,6 +168,7 @@
 $server = new SetteeServer($serverAddr);
 
 function setteErrorHandler($e) {
+    Amon::log($e->getMessage() . " " . print_r($_SERVER,true), array('error'));
     echo $e->getMessage() . "<br>" . PHP_EOL;
 }
 

directory:b/js/bubbletree (new)
--- /dev/null
+++ b/js/bubbletree

directory:b/js/flotr2 (new)
--- /dev/null
+++ b/js/flotr2

directory:b/js/sigma (new)
--- /dev/null
+++ b/js/sigma

directory:b/lib/amon-php (new)
--- /dev/null
+++ b/lib/amon-php