From 6e245a4c52e33f92ad73ac80e762c64757c7790f Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 4 Apr 2010 18:57:27 +0000 Subject: [PATCH] Add option group support, and as a test implement it for awards report. It would be nice to remove the "Award -- " off the front of each field name, but if we do that it only displays "Name" after its' selected, which can be confusing if there's an "Award -- Name" and a "Prize -- Name". But the division into optgroups still look nice. --- admin/reports_awards.inc.php | 4 ++++ admin/reports_editor.php | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/admin/reports_awards.inc.php b/admin/reports_awards.inc.php index 2ba6593..4519e19 100644 --- a/admin/reports_awards.inc.php +++ b/admin/reports_awards.inc.php @@ -23,6 +23,7 @@ $report_awards_fields = array( 'name' => array( + 'start_option_group' => 'Award Information', 'name' => 'Award -- Name', 'header' => 'Award Name', 'width' => 3.0, @@ -60,6 +61,7 @@ $report_awards_fields = array( 'table' => 'award_types.type' ), 'sponsor_organization' => array( + 'start_option_group' => 'Sponsor Information', 'name' => 'Sponsor -- Organization', 'header' => 'Sponsor Organization', 'width' => 2.0, @@ -115,6 +117,7 @@ $report_awards_fields = array( 'value_map' => array ('pending' => 'Pending', 'confirmed' => 'Confirmed'), "received"=>"Received"), 'pcontact_salutation' => array( + 'start_option_group' => 'Sponsor Primary Contact', 'name' => 'Primary Contact -- Salutation', 'header' => 'Cnct. Salutation', 'width' => 1.0, @@ -189,6 +192,7 @@ $report_awards_fields = array( 'table' => 'PRIMARYCONTACT.notes' ), 'judgeteamname' => array( + 'start_option_group' => 'Judging Team', 'components' => array('judgingteam'), 'name' => 'Judging Team -- Name', 'header' => 'Judging Team', diff --git a/admin/reports_editor.php b/admin/reports_editor.php index a1eacf1..980e127 100644 --- a/admin/reports_editor.php +++ b/admin/reports_editor.php @@ -44,13 +44,19 @@ function field_selector($name, $id, $selected) { global $fields; + $in_optgroup = false; echo ""; }