From: Maxious Date: Sun, 29 Jan 2012 05:43:33 +0000 Subject: Add some more fields to schemas/agency.json.php X-Git-Url: http://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=17fa1ddfb56b4a6d90d50bef37331e7b8e826450 --- 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, mandated by the Senate"), - "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 , mandated by the Senate"), "advertisingURL" => Array("type" => "string", "required" => true, "x-title" => "Approved Advertising Campaigns", "description" => " Agency advertising and public information projects, mandated by the Senate "), "hasRSS" => Array("type" => "string", "required" => true, "x-title" => "Has RSS", "description" => ""),