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/charts.php +++ /dev/null @@ -1,133 +1,1 @@ -get_db('disclosr-agencies'); -?> -
-

Charts

-

Lorem ipsum.

-
-
-
- - - --- 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") { +?> + + + + $value) { @@ -223,7 +226,7 @@ } if ($mode == "view") { echo "
    Field NameField Value
    "; - echo '
    + echo '
    '; @@ -231,16 +234,16 @@ if ($mode == "edit") { echo ''; } -} else { + } else { // show all list - include_header('Agencies'); - echo '
    + include_header('Agencies'); + echo '
    @@ -251,28 +254,28 @@
    '; - try { - $rows = $db->get_view("app", "byCanonicalName")->rows; - //print_r($rows); - $rowCount = count($rows); - foreach ($rows as $i => $row) { - if ($i % ($rowCount/3) == 0 && $i != 0 && $i != $rowCount -2 ) echo '
    '; - // print_r($row); - echo ' + try { + $rows = $db->get_view("app", "byCanonicalName")->rows; + //print_r($rows); + $rowCount = count($rows); + foreach ($rows as $i => $row) { + if ($i % ($rowCount / 3) == 0 && $i != 0 && $i != $rowCount - 2) echo '
    '; + // print_r($row); + echo '

    '; - } - - } catch (SetteeRestClientException $e) { - setteErrorHandler($e); - } - echo '
    + (isset($row->value->name) ? $row->value->name : "ERROR NAME MISSING") + . '

    '; + } + + } catch (SetteeRestClientException $e) { + setteErrorHandler($e); + } + echo '
    '; -} - -include_footer(); -?> - + } + + include_footer(); + ?> + --- a/include/common.inc.php +++ b/include/common.inc.php @@ -19,7 +19,7 @@ Requests::register_autoloader(); $ENV = "DEV"; -if (isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') { +if (false && isset($_SERVER['SERVER_NAME']) && $_SERVER['SERVER_NAME'] != 'localhost') { require $basePath."lib/amon-php/amon.php"; Amon::config(array('address'=> 'http://127.0.0.1:2464', --- a/include/couchdb.inc.php +++ b/include/couchdb.inc.php @@ -14,8 +14,8 @@ } else if (php_uname('n') == "ikurt-20") { - $serverAddr = 'http://192.168.1.113:5984/'; - //$serverAddr = 'http://127.0.0.1:5984/'; + //$serverAddr = 'http://192.168.1.113:5984/'; + $serverAddr = 'http://127.0.0.1:5984/'; } else { $serverAddr = 'http://127.0.0.1:5984/'; } --- a/include/template.inc.php +++ b/include/template.inc.php @@ -28,6 +28,9 @@ .sidebar-nav { padding: 9px 0; } + .flotr-dummy-div { + margin-left: -999px; + }