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'); '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'); $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 //look up the titles of the study groups and add to array for updating in the header
$studygroup_descriptions = array(); $studygroup_descriptions = array();
$studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", $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 //write the header based on the first result
$header_array = array(); $header_array = array();
foreach (reset($result) as $key => $value) foreach (reset($result) as $key => $value) {
{ if (in_array($key, $fields_to_skip)) {
if (in_array($key, $fields_to_skip))
continue; continue;
}
/*
//Replace headings for study group sessions and roles with the name of the study group rather than just sessionN and sessionN_role etc //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]; $header_array[] = $studygroup_descriptions[$key];
continue; continue;
} }
*/
$header_array[] = $key; $header_array[] = $key;
//add in a special column for a processed version of the date of birth //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"; $header_array[] = "booking_dob_processed";
}
//add in a calculated field for amount owing //add in a calculated field for amount owing
if (strcmp($key, "nid") == 0) { if (strcmp($key, "nid") == 0) {
$header_array[] = "booking_amount_owing_gross"; $header_array[] = "booking_amount_owing_gross";