From 388dec3be75680eb5a2fe5a511bc70bb60f759b6 Mon Sep 17 00:00:00 2001 From: Glen Barnes Date: Thu, 23 Jul 2009 19:17:13 +1200 Subject: [PATCH] Updated groupings of departments [#11] --- themes/open-data-theme/category-25.php | 118 ++++++++++++++----------- themes/open-data-theme/functions.php | 33 +++++++ themes/open-data-theme/style.css | 5 ++ 3 files changed, 103 insertions(+), 53 deletions(-) diff --git a/themes/open-data-theme/category-25.php b/themes/open-data-theme/category-25.php index 91189ac..f1a5b13 100644 --- a/themes/open-data-theme/category-25.php +++ b/themes/open-data-theme/category-25.php @@ -4,64 +4,76 @@ ?> "Office of Parliament", - 87 => "Public Service Department", - 90 => "State Sector", - 75 => "Autonomous Crown Entity", - 84 => "Non Public Service Department", - 86 => "Other PFA 4th Schedule organisation", - 76 => "City Council", - 80 => "District Council", - 88 => "Regional Council", - 91 => "Territorial Authority", - 81 => "District Health Board", - 82 => "Education", - 77 => "Conservation Sector Organisation", - 78 => "Crown Agent", - 79 => "Crown Research Institute", - 83 => "Independent Crown entity", - 89 => "State Owned Enterprise/Commercial Organisations", - 92 => "Trust", - 93 => "Wananga") + // $cats = array( + // 85 => "Office of Parliament", + // // 87 => "Public Service Department", + // // 90 => "State Sector", + // // 75 => "Autonomous Crown Entity", + // 84 => "Non Public Service Department", + // 86 => "Other PFA 4th Schedule organisation", + // 76 => "City Council", + // 80 => "District Council", + // 88 => "Regional Council", + // 91 => "Territorial Authority", + // 81 => "District Health Board", + // 82 => "Education", + // 77 => "Conservation Sector Organisation", + // 78 => "Crown Agent", + // 79 => "Crown Research Institute", + // 83 => "Independent Crown entity", + // 89 => "State Owned Enterprise/Commercial Organisations", + // 92 => "Trust", + // 93 => "Wananga") + + // Central Government + // >Public Service Department + // >Crown Agents, Autonomous Crown Entities, Crown Entitity Companies, Trusts (suggest merge these categories into one alpha list) + // >DHBs + // >Crown Research Institutes + // >Reserve Bank of New Zealand + // >Non Public Service Departments + // >Office of Parliament + // >Education Institutions and Wananga (suggest merge these categories) + // >State-Owned Enterprises + // *Local Government* + // >City and District Councils + // > Regional Councils and Territorial Authorities ?>

List of Departments, Agencies, Crown Research Institutes, Councils and Other Government Organsations

Click through to see what datasets we have listed for each entity.

- $title) : ?> - prefix . "posts as p, " . - $wpdb->prefix . "supple_dataset as sd, " . - $wpdb->prefix . "term_relationships as tr)" . - " left outer join " . - " (select sd.department, count(sd.department) as num_sets" . - " from " . $wpdb->prefix . "posts as p, " . - " " . $wpdb->prefix . "supple_dataset as sd," . - " " . $wpdb->prefix . "term_relationships as tr" . - " where p.ID = sd.post_id" . - " and p.ID = tr.object_id" . - " and tr.term_taxonomy_id = 3" . - " group by sd.department) as ds_count " . - " on sd.department = ds_count.department " . - " where p.ID = sd.post_id" . - " and p.ID = tr.object_id" . - " and tr.term_taxonomy_id = " . $cat_id . - " order by p.post_title ASC;"; - - $departments = $wpdb->get_results($sql, ARRAY_A); ?> - -

- - - +

Central Government

+

Public Service Department

+ +

Crown Agents, Autonomous Crown Entities, Crown Entitity Companies, Trusts

+ + + + +

DHBs

+ +

Crown Research Institutes

+ +

Reserve Bank of New Zealand

+ +

Non Public Service Departments

+ +

Office of Parliament

+ +

Education Institutions and Wananga

+ + +

State-Owned Enterprises

+ +

Local Government

+

City and District Councils

+ + +

Regional Councils and Territorial Authorities

+ + +
\ No newline at end of file diff --git a/themes/open-data-theme/functions.php b/themes/open-data-theme/functions.php index 682bc88..d39d9fc 100644 --- a/themes/open-data-theme/functions.php +++ b/themes/open-data-theme/functions.php @@ -79,6 +79,39 @@ function output_label($value, $lookup) { return $str; } +function output_department($cat_id, $wpdb) { + $sql = "select p.ID, p.post_title, sd.department, tr.term_taxonomy_id, ds_count.num_sets" . + " from (" . $wpdb->prefix . "posts as p, " . + $wpdb->prefix . "supple_dataset as sd, " . + $wpdb->prefix . "term_relationships as tr)" . + " left outer join " . + " (select sd.department, count(sd.department) as num_sets" . + " from " . $wpdb->prefix . "posts as p, " . + " " . $wpdb->prefix . "supple_dataset as sd," . + " " . $wpdb->prefix . "term_relationships as tr" . + " where p.ID = sd.post_id" . + " and p.ID = tr.object_id" . + " and tr.term_taxonomy_id = 3" . + " group by sd.department) as ds_count " . + " on sd.department = ds_count.department " . + " where p.ID = sd.post_id" . + " and p.ID = tr.object_id" . + " and tr.term_taxonomy_id = " . $cat_id . + " order by p.post_title ASC;"; + + $departments = $wpdb->get_results($sql, ARRAY_A); + if($departments) : + echo ""; + endif; +} + $licenses ?> \ No newline at end of file diff --git a/themes/open-data-theme/style.css b/themes/open-data-theme/style.css index d390f79..d2b6086 100644 --- a/themes/open-data-theme/style.css +++ b/themes/open-data-theme/style.css @@ -471,4 +471,9 @@ h2.department { font-size:20px; font-weight:bold; padding: 10px 0 10px 0; +} +h3.department { + font-size:17px; + font-weight:bold; + padding: 10px 0 10px 0; } \ No newline at end of file