change CSV heading description

This commit is contained in:
2016-06-22 22:45:07 +10:00
parent 925907cadb
commit f26af4a0fb

View File

@@ -643,12 +643,6 @@ function booking_csv_report() {
'booking_rtrnflight_destination_ts', 'booking_timestamp', 'booking_flight_datetime_inbound', 'booking_flight_datetime_outbound');
$number_only_fields = array('booking_postcode', 'booking_mobile', 'booking_phone', 'booking_guardian_phone', 'booking_guardian_phone_alt');
//this isn't required since we already have the info directly as a field
//so there is no need to rewrite the ID field with a user-friendly description
//look up room location descriptions for presenting a friendly name rather than an ID
//$room_query = db_query("SELECT * FROM {booking_room_locations} WHERE booking_roomlocation_active = 'Y'");
//$room_locations = $room_query->fetchAllAssoc('lid');
//look up the titles of the study groups and add to array for updating in the header
$studygroup_descriptions = array();
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid",
@@ -677,23 +671,23 @@ function booking_csv_report() {
//write the header based on the first result
$header_array = array();
foreach (reset($result) as $key => $value)
{
if (in_array($key, $fields_to_skip))
foreach (reset($result) as $key => $value) {
if (in_array($key, $fields_to_skip)) {
continue;
}
/*
//Replace headings for study group sessions and roles with the name of the study group rather than just sessionN and sessionN_role etc
if (array_key_exists($key, $studygroup_descriptions))
{
if (array_key_exists($key, $studygroup_descriptions)) {
$header_array[] = $studygroup_descriptions[$key];
continue;
}
*/
$header_array[] = $key;
//add in a special column for a processed version of the date of birth
if (strcmp($key,"booking_dob") == 0)
if (strcmp($key,"booking_dob") == 0) {
$header_array[] = "booking_dob_processed";
}
//add in a calculated field for amount owing
if (strcmp($key, "nid") == 0) {
$header_array[] = "booking_amount_owing_gross";