Add some more fields to schemas/agency.json.php
Add some more fields to schemas/agency.json.php


Former-commit-id: 5e018df129442a3c232365a62b8eed715abb25b4

--- a/getAgency.php
+++ b/getAgency.php
@@ -124,7 +124,7 @@
         }
     }
 
-    $mode = "view";
+    $mode = "edit";
     if ($mode == "edit") {
         $row = addDefaultFields(object_to_array($row));
     } else {

--- a/include/couchdb.inc.php
+++ b/include/couchdb.inc.php
@@ -26,14 +26,16 @@
         emit(doc._id, doc.parentOrg);
         }
 };";
-    $obj->views->byName->map = "function(doc) {  
+    $obj->views->byName->map = 'function(doc) { 
+        if (typeof(doc["status"]) == "undefined" || doc["status"] != "suspended") {
         emit(doc.name, doc._id); 
  for (name in doc.otherNames) {
-if (doc.otherNames[name] != '' && doc.otherNames[name] != doc.name) {
+if (doc.otherNames[name] != "" && doc.otherNames[name] != doc.name) {
        	 emit(doc.otherNames[name], doc._id); 
 }
         }
-};";
+        }
+};';
 
     $obj->views->foiEmails->map = "function(doc) {  
         emit(doc._id, doc.foiEmail);

--- a/schemas/agency.json.php
+++ b/schemas/agency.json.php
@@ -24,8 +24,10 @@
         "consultanciesURL" => Array("type" => "string", "required" => true, "x-title" => "Consultants Hired", "description" => ""),
         "legalExpenditureURL" => Array("type" => "string", "required" => true, "x-title" => "Legal Services Expenditure", "description" => "Legal Services Expenditure mandated by Legal Services Directions 2005"),
         "recordsListURL" => Array("type" => "string", "required" => true, "x-title" => "Files/Records Held", "description" => "Indexed lists of departmental and agency files, <a href='http://www.aph.gov.au/senate/pubs/standing_orders/d05.htm'>mandated by the Senate</a>"),
-        "FOIDocumentsURL" => Array("type" => "string", "required" => true, "x-title" => "FOI Documents Released", "description" => ""),
-        "infoPublicationSchemeURL" => Array("type" => "string", "required" => true, "x-title" => "Information Publication Scheme", "description" => ""),
+        "FOIDocumentsURL" => Array("type" => "string", "required" => true, "x-title" => "FOI Documents Released", "description" => "FOI Disclosure Log URL"),
+   "FOIDocumentsRSSURL" => Array("type" => "string", "required" => false, "x-title" => "RSS Feed of FOI Documents Released", "description" => "FOI Disclosure Log in RSS format"),
+        "hasFOIPDF" => Array("type" => "string", "required" => false, "x-title" => "Has FOI Documents Released in PDF", "description" => "FOI Disclosure Log contains any PDFs"),
+         "infoPublicationSchemeURL" => Array("type" => "string", "required" => true, "x-title" => "Information Publication Scheme", "description" => ""),
         "appointmentsURL" => Array("type" => "string", "required" => true, "x-title" => "Agency Appointments/Boards", "description" => "Departmental and agency appointments and vacancies , <a href='http://www.aph.gov.au/senate/pubs/standing_orders/d05.htm'>mandated by the Senate</a>"),
         "advertisingURL" => Array("type" => "string", "required" => true, "x-title" => "Approved Advertising Campaigns", "description" => " Agency advertising and public information projects, <a href='http://www.aph.gov.au/senate/pubs/standing_orders/d05.htm'>mandated by the Senate</a> "),
         "hasRSS" => Array("type" => "string", "required" => true, "x-title" => "Has RSS", "description" => ""),