From: Alex Sadleir Date: Sat, 22 Jun 2013 06:52:26 +0000 Subject: Add public ranking listing, link charts better X-Git-Url: https://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=b2a4f893331253cf17473822d2e1c4792b7d191d --- Add public ranking listing, link charts better Former-commit-id: 889d2d51a7712e7454f582b671b6142d619ad672 --- --- a/about.php +++ b/about.php @@ -5,6 +5,10 @@

About/FAQ

+Document Dump icon designed by Iconathon, 2013 +Contact us: maxious@lambdacomplex.org + +Exports: All Agencies Agency Employee Headcounts

Attributions

National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm
data.gov.au http://data.gov.au/dataset/directory-gov-au-full-data-export/
--- a/admin/refreshDesignDoc.php +++ b/admin/refreshDesignDoc.php @@ -42,6 +42,7 @@ $obj->views->byWebServer->map = "function(doc) {\n emit(doc.web_server, doc);\n}"; $obj->views->datasets->map = "function(doc) {\nif (doc.fieldName == \"data\") {\n emit(doc._id, doc);\n}\n}"; +$obj->views->datasetGroups->map = "function(doc) {\nif (doc.fieldName == \"data\") {\n doc.metadata[\"data.gov.au Category\"] && doc.metadata[\"data.gov.au Category\"].forEach(function(tag) {\n emit(tag, doc.url); \n });\n}\n}"; $obj->views->getValidationRequired->map = "function(doc) {\nif (doc.mime_type == \"text/html\" \n&& typeof(doc.validation) == \"undefined\") {\n emit(doc._id, doc._attachments);\n}\n}"; $docdb->save($obj, true); --- a/charts.php +++ /dev/null @@ -1,133 +1,1 @@ -get_db('disclosr-agencies'); -?> -
-

Charts

-

Lorem ipsum.

-
-
-
- - - --- /dev/null +++ b/disclosr.iml @@ -1,1 +1,16 @@ + + + + + + + + + + + + + + + --- a/documents/charts.php +++ b/documents/charts.php @@ -13,10 +13,10 @@ ?>

Charts

-

Lorem ipsum.

+

-
+
+ + + --- a/getAgency.php +++ b/getAgency.php @@ -2,11 +2,12 @@ include_once('include/common.inc.php'); -function displayValue($key, $value, $mode) { +function displayValue($key, $value, $mode) +{ global $db, $schemas; - $ignoreKeys = Array("metadata" ,"metaTags", "statistics","rtkURLs","rtkDescriptions"); + $ignoreKeys = Array("metadata", "metaTags", "statistics", "rtkURLs", "rtkDescriptions"); if ($mode == "view") { - if (strpos($key, "_") === 0 || in_array($key,$ignoreKeys)) + if (strpos($key, "_") === 0 || in_array($key, $ignoreKeys)) return; echo ""; @@ -22,7 +23,8 @@ echo "
  • "; @@ -62,7 +64,7 @@ "; } else { if (strpos($key, "_") === 0) { - echo""; + echo ""; } else if ($key == "parentOrg") { echo ""; + echo " "; } else { echo ""; if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") { @@ -85,7 +87,8 @@ // } -function addDefaultFields($row) { +function addDefaultFields($row) +{ global $schemas; $defaultFields = array_keys($schemas['agency']['properties']); foreach ($defaultFields as $defaultField) { @@ -119,103 +122,103 @@ // by name = startkey="Ham"&endkey="Ham\ufff0" // edit? - $obj = $db->get($_REQUEST['id']); - include_header(isset($obj->name) ? $obj->name : ""); +$obj = $db->get($_REQUEST['id']); +include_header(isset($obj->name) ? $obj->name : ""); //print_r($row); - if (sizeof($_POST) > 0) { +if (sizeof($_POST) > 0) { //print_r($_POST); - foreach ($_POST as $postkey => $postvalue) { - if ($postvalue == "") { + foreach ($_POST as $postkey => $postvalue) { + if ($postvalue == "") { + unset($_POST[$postkey]); + } + if (is_array($postvalue)) { + if (count($postvalue) == 1 && $postvalue[0] == "") { unset($_POST[$postkey]); - } - if (is_array($postvalue)) { - if (count($postvalue) == 1 && $postvalue[0] == "") { - unset($_POST[$postkey]); - } else { - foreach ($_POST[$postkey] as $key => &$value) { - if ($value == "") { - unset($_POST[$postkey][$key]); - } + } else { + foreach ($_POST[$postkey] as $key => &$value) { + if ($value == "") { + unset($_POST[$postkey][$key]); } } } } - if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) { - echo "Edited version was latest version, continue saving"; - $newdoc = $_POST; - $newdoc['metadata']['lastModified'] = time(); - $obj = $db->save($newdoc); - } else { - echo "ALERT doc revised by someone else while editing. Document not saved."; - } - } - - $mode = "view"; - $rowArray = object_to_array($obj); - ksort($rowArray); - if ($mode == "edit") { - $row = addDefaultFields($rowArray); + } + if (isset($_POST['_id']) && $db->get_rev($_POST['_id']) == $_POST['_rev']) { + echo "Edited version was latest version, continue saving"; + $newdoc = $_POST; + $newdoc['metadata']['lastModified'] = time(); + $obj = $db->save($newdoc); } else { - $row = $rowArray; - } - - if ($mode == "view") { - echo '
    + echo "ALERT doc revised by someone else while editing. Document not saved."; + } +} + +$mode = "view"; +$rowArray = object_to_array($obj); +ksort($rowArray); +if ($mode == "edit") { + $row = addDefaultFields($rowArray); +} else { + $row = $rowArray; +} + +if ($mode == "view") { + echo '
    '; - echo '
    '; - echo '
    + echo '
    '; + echo '

    ' . $row['name'] . '

    '; - if (isset($row['description'])) { - echo '

    '.$row['description'].'

    '; - } - echo '
    '; - echo ""; - } - if ($mode == "edit") { - ?> - - - - ' . $row['description'] . '

    '; + } + echo '
    Field NameField Value
    '; + echo ""; +} +if ($mode == "edit") { +?> + +
    Field NameField Value