From: Maxious Date: Mon, 09 Jan 2012 05:14:04 +0000 Subject: Fix hard coded ABN bug X-Git-Url: https://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=13cc2f47e996abbcb48236e63a801309700d0561 --- Fix hard coded ABN bug Former-commit-id: 26cab951c09972aea499a6a2dfb4cbf2dcd8f3d7 --- --- a/about.php +++ b/about.php @@ -1,10 +1,27 @@ + +
+

About/FAQ

+

Lorem ipsum.

+
+

What is this?

+Disclosr is a project to monitor Australian Federal Government agencies +compliance with their "proactive disclosure requirements". +OGRE (Open Government Realization Evaluation) is a ranking of compliance with these requirements. +Prometheus is the agent which polls agency websites to assess compliance. -Organisational Data Sources +

Open everything

+all documents released CC-BY 3 AU +Open source git @ + +

Organisational Data Sources

http://www.comlaw.gov.au/Browse/Results/ByTitle/AdministrativeArrangementsOrders/Current/Ad/0 defines departments Agencies can be found in the Schedule to an Appropriation Bill (budget), Schedule to FMA Regulations and/or Public Service Act. -http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these +http://www.finance.gov.au/publications/flipchart/docs/FMACACFlipchart.pdf summarises these. view-source:https://www.tenders.gov.au/?event=public.advancedsearch.home is great for the suspended/active status When defining the hierachy, this system is designed towards monitoring accountablity. Thus large agencies that have registered their own ABN and have their own accountablity mechanisms/website recieve a seperate record as a child of their department. @@ -14,10 +31,20 @@ As agencies themselves shift between departments, there may be scope for providing time ranges but typically the newest hierarchy will be the one recorded. A department/agency name will be the newest active name assigned to that ABN. +ABN information is derived from the ABR. This is the definitive umpire about which former name should be linked to which current name. +For example "Department of Transport and Regional Services" became "Department of Infrastructure, Transport, Regional Development and Local Government" (same ABN) +however it later split into "Department of Infrastructure and Transport" (same ABN) +and "Department of Regional Australia, Regional Development and Local Government" (new ABN). + Statistical information from http://www.apsc.gov.au/stateoftheservice/1011/statsbulletin/section1.html#t2total https://www.apsedii.gov.au/apsedii/CustomQueryx33.shtml +and individual annual reports. -Open Government Scoring +

Open Government Scoring

+1 point for every true Has... attribute -1 point for every false Has... (ie. Has Not) attribute +Don't like this? Make your own score, suggest a better scoring mechanism. + --- a/getAgency.php +++ b/getAgency.php @@ -33,7 +33,13 @@ } if (strpos($key, "has") === 0) { echo ""; } else { - echo ""; + echo ""; + if ((strpos($key,"URL") > 0 || $key == 'website')&& $value != "") { + echo "view"; + } + if ($key == 'abn') { + echo "view abn"; + } } } } --- a/include/couchdb.inc.php +++ b/include/couchdb.inc.php @@ -8,12 +8,34 @@ $obj->_id = "_design/" . urlencode("app"); $obj->language = "javascript"; $obj->views->byABN->map = "function(doc) { emit(doc.abn, doc); };"; - $obj->views->byName->map = "function(doc) { emit(doc.name, doc); };"; + $obj->views->byName->map = "function(doc) { emit(doc.name, doc); + for (name in doc.otherNames) { +if (doc.otherNames[name] != '' && doc.otherNames[name] != doc.name) { + emit(doc.otherNames[name], doc); +} + } +};"; $obj->views->byLastModified->map = "function(doc) { emit(doc.metadata.lastModified, doc); }"; $obj->views->getActive->map = 'function(doc) { if (doc.status == "active") { emit(doc._id, doc); } };'; $obj->views->getSuspended->map = 'function(doc) { if (doc.status == "suspended") { emit(doc._id, doc); } };'; $obj->views->getScrapeRequired->map = "function(doc) { emit(doc.abn, doc); };"; $obj->views->showNamesABNs->map = "function(doc) { emit(doc._id, {name: doc.name, abn: doc.abn}); };"; + // http://stackoverflow.com/questions/646628/javascript-startswith + $obj->views->score->map = 'if(!String.prototype.startsWith){ + String.prototype.startsWith = function (str) { + return !this.indexOf(str); + } +} + +function(doc) { +count = 0; +for(var propName in doc) { + if(typeof(doc[propName]) != "undefined" && propName.startsWith("l")) { + count++ + } +} + emit(doc._id,{name: doc.name, score:count}); +}'; // allow safe updates (even if slightly slower due to extra: rev-detection check). return $db->save($obj, true); --- a/include/template.inc.php +++ b/include/template.inc.php @@ -43,7 +43,7 @@
Agencies - About + About/FAQ
--- a/schemas/agency.json.php +++ b/schemas/agency.json.php @@ -4,8 +4,8 @@ "description" => "Representation of government agency and online transparency measures", "type" => "object", "properties" => Array( - "name" => Array("type" => "string", "required" => true, "description" => "Agency Name, most recent and broadest"), - "othernames" => Array("type" => "array", "required" => true, "description" => "Agency Names", + "name" => Array("type" => "string", "required" => true, "x-title"=> "Agency Name", "description" => "Agency Name, most recent and broadest"), + "othernames" => Array("type" => "array", "required" => true, "x-title" => "Agency Past/Other Names", "description" => "Agency Names", "items" => Array("type" => "string")), ), /*"org":{"type":"object", --- /dev/null +++ b/score.php @@ -1,1 +1,19 @@ +get_db('disclosr-agencies'); + +try { + $rows = $db->get_view("score", "score")->rows; + //print_r($rows); + foreach ($rows as $row) { + echo $row->value->name." ".$row->value->score."
"; + } +} catch (SetteeRestClientException $e) { + setteErrorHandler($e); +} + +include_footer(); +?> --- a/stylesheets/app.css +++ b/stylesheets/app.css @@ -21,14 +21,7 @@ font-size: 16px; font-size: 1.6rem; font-weight: 800; } -#navbar h1 a { color: #fff; font-weight: bold; } -#navbar h2 a { - text-indent: -99999px; - display: block; - width: 82px; - height: 14px; - background: url('../images/by-zurb.png'); } - +#navbar a { color: #fff; font-weight: bold; } #navbar strong { display: block; margin: 0; padding: 0; height: 14px; line-height: 14px; position: relative; bottom: 4px; } #navbar strong a { @@ -39,5 +32,41 @@ } #navbar strong a.button { padding: 4px 10px; font-weight: bold; } +/* other zurb copied css */ +.row { max-width: 1200px; } + +div.foundation-header { margin: 0 0 40px 0; padding: 30px 0 0 0; border-bottom: solid 1px #ccc; } +div.foundation-header h1 { margin-bottom: 0; padding: 0; } +div.foundation-header h1 a { color: #181818; } +div.foundation-header h1 a:hover { color: #181818; } +div.foundation-header .subheader { margin-bottom: 9px; } + +div.highlight { margin-bottom: 12px; } + +img.beta { position: absolute; top: 0px; right: 0px; } + +/* Footer */ +footer.row { + margin-top: 80px; + border-top: solid 1px #e6e6e6; + padding-top: 20px; } +footer.row h6 { + color: #6f6f6f; + font-size: 14px; + font-size: 1.4rem; + margin-bottom: 4px; } +footer.row p { + color: #626262; + font-size: 12px; + font-size: 1.2rem; + line-height: 18px; } +footer.row a { + color: #222222; } +footer.row a:hover { + text-decoration: underline; } + +.row.display { background: #f4f4f4; margin-bottom: 10px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; } +.row.display .column, .row.display .columns { background: #e7e7e7; font-size: 11px; text-indent: 3px; padding-top: 6px; padding-bottom: 6px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; } +