From 7ff0b4b104e5514711d11796800f4d8ed04bd02d Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 24 Dec 2007 19:20:01 +0000 Subject: [PATCH] - Add more fields to the committee report type - Sort the report by the first field if no sort field is given --- admin/reports.inc.php | 6 +++- admin/reports_committees.inc.php | 53 +++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/admin/reports.inc.php b/admin/reports.inc.php index c217cf9c..061f2310 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -551,8 +551,8 @@ foreach($report_stock as $n=>$v) { } $x++; } - /* We also want to select any column groupings, but we won't display them */ + /* We also want to select any column groupings, but we won't display them */ foreach($report['group'] as $o=>$d) { $f = $d['field']; if(!isset($fieldname[$f])) { @@ -571,6 +571,10 @@ foreach($report_stock as $n=>$v) { } } + /* If no sort order is specified, make the first field the order */ + if(count($report['sort']) == 0) + $report['sort'] = array(0 => array('field' => $report['col'][0]['field'])); + foreach($report['sort'] as $o=>$d) { $f = $d['field']; if(!isset($fieldname[$f])) { diff --git a/admin/reports_committees.inc.php b/admin/reports_committees.inc.php index 15baa3d6..02e1030a 100644 --- a/admin/reports_committees.inc.php +++ b/admin/reports_committees.inc.php @@ -23,37 +23,74 @@ $report_committees_fields = array( 'name' => array( - 'name' => 'Committee -- Full Name ', + 'name' => 'Committee Member -- Full Name ', 'header' => 'Name', 'width' => 1.75, - 'table' => "CONCAT(users.firstname, ' ', users.lastname)"), - + 'table' => "CONCAT(users.firstname, ' ', users.lastname)", + 'table_sort' => 'users.lastname'), + + 'last_name' => array( + 'name' => 'Committee Member -- Last Name', + 'header' => 'Last Name', + 'width' => 1.0, + 'table' => 'users.lastname' ), + + 'first_name' => array( + 'name' => 'Committee Member -- First Name', + 'header' => 'First Name', + 'width' => 1.0, + 'table' => 'users.firstname' ), + 'email' => array( - 'name' => 'Committee -- Email', + 'name' => 'Committee Member -- Email', 'header' => 'Email', 'width' => 2.0, 'table' => 'users.email'), 'phone_home' => array( - 'name' => 'Committees -- Phone (Home)', + 'name' => 'Committee Member -- Phone (Home)', 'header' => 'Phone(Home)', 'width' => 1, 'table' => 'users.phonehome'), 'phone_work' => array( - 'name' => 'Committees -- Phone (Work)', + 'name' => 'Committee Member -- Phone (Work)', 'header' => 'Phone(Work)', 'width' => 1.25, 'table' => 'users.phonework'), 'phone_cel' => array( - 'name' => 'Committees -- Phone (Cel)', + 'name' => 'Committee Member -- Phone (Cel)', 'header' => 'Phone(Cel)', 'width' => 1, 'table' => 'users.phonecell'), + 'address' => array( + 'name' => 'Committee Member -- Address Street', + 'header' => 'Address', + 'width' => 2.0, + 'table' => "CONCAT(users.address, ' ', users.address2)"), + + 'city' => array( + 'name' => 'Committee Member -- Address City', + 'header' => 'City', + 'width' => 1.5, + 'table' => 'users.city' ), + + 'province' => array( + 'name' => 'Committee Member -- Address Province', + 'header' => 'Province', + 'width' => 0.75, + 'table' => 'users.province' ), + + 'postal' => array( + 'name' => 'Committee Member -- Address Postal Code', + 'header' => 'Postal', + 'width' => 0.75, + 'table' => 'users.postalcode' ), + 'organization' => array( - 'name' => 'Committees -- Organization', + 'name' => 'Committee Member -- Organization', 'header' => 'Organization', 'width' => 2, 'table' => 'users.organization'),