no need to add quote marks for excel output

This commit is contained in:
2018-07-13 14:37:21 +10:00
parent 2f83967ba7
commit 42a91a9d7f

View File

@@ -592,9 +592,9 @@ function booking_varietysessions_csv_report($timeslot_id) {
//make the column headings a bit more user friendly
$heading = $variety_sessions[$column]->booking_variety_descrip;
//enclose $heading if necessary
if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $heading ) ) {
$heading = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $heading) . $enclosure;
}
//if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $heading ) ) {
// $heading = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $heading) . $enclosure;
//}
// Adjusted for excel, assume each column is just a string
//$column_headings[] = array($heading => 'string');
@@ -612,12 +612,12 @@ function booking_varietysessions_csv_report($timeslot_id) {
$field = isset($data[$column][$i]) ? $data[$column][$i] : '';
//enclose $field if necessary
if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field ) ) {
$output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure;
}
else {
//if ( $encloseAll || preg_match( "/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field ) ) {
// $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure;
//}
//else {
$output[] = $field;
}
//}
} //loop through columns
$rows[] = $output;
//$row = implode($delimiter, $output) . "\n";