Adding travel form

This commit is contained in:
2014-02-15 20:59:28 +11:00
parent 7c252d4ff6
commit 01da63e694
7 changed files with 643 additions and 32 deletions

View File

@@ -399,7 +399,15 @@ function booking_csv_report() {
$delimiter_esc = preg_quote($delimiter, '/');
$enclosure_esc = preg_quote($enclosure, '/');
$fields_to_skip = array('booking_payment_id', 'booking_event_id', 'booking_tempid');
/*
$fields_to_skip = array('booking_payment_id', 'booking_event_id', 'booking_skills_childminding', 'booking_passport_issue_date',
'booking_passport_expiry_date', 'booking_passport_num', 'booking_passport_num', 'booking_mission_experience_details',
'booking_passport_issue_location', 'booking_passport_issue_name', 'booking_skills_builder', 'booking_skills_cooking',
'booking_skills_language', 'booking_skills_language_details', 'booking_skills_other', 'booking_skills_other_details');
*/
$builtin_fields_to_skip = array('booking_event_id');
$custom_fields_to_skip = explode(";", variable_get('booking_csv_exclude_fields', ''));
$fields_to_skip = array_merge($builtin_fields_to_skip, $custom_fields_to_skip);
//query the db
/*
@@ -438,6 +446,9 @@ function booking_csv_report() {
//add in a special column for a processed version of the date of birth
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";
}
$header = implode( $delimiter, $header_array );
@@ -488,6 +499,14 @@ function booking_csv_report() {
continue;
}
//add in the amount owing using the nid as the key
if ($key == 'nid')
{
$output[] = $value;
$output[] = _booking_amount_owing($value);
continue;
}
// Enclose fields containing $delimiter, $enclosure or whitespace
if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $value ) ) {
$output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $value) . $enclosure;
@@ -496,6 +515,8 @@ function booking_csv_report() {
$output[] = $field;
}
}
$row = implode($delimiter, $output) . "\n";