Skip to content

Commit

Permalink
Merge pull request #17051 from eileenmcnaughton/ex
Browse files Browse the repository at this point in the history
Remove outputHeader as a param for writeCSVFile as it is always true
  • Loading branch information
seamuslee001 authored Apr 17, 2020
2 parents 1535825 + c93c138 commit 0aa61b6
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions CRM/Core/Report/Excel.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,20 @@ public function writeHTMLFile($fileName, $header, $rows, $titleHeader = NULL, $o
* An array of the headers.
* @param array $rows
* An array of arrays of the table contents.
* @param bool $outputHeader
* Should we output the header row.
*
* @return void
*/
public static function writeCSVFile($fileName, $header, $rows, $outputHeader = TRUE) {
if ($outputHeader) {
CRM_Utils_System::download(CRM_Utils_String::munge($fileName),
'text/x-csv',
CRM_Core_DAO::$_nullObject,
'csv',
FALSE
);
}
public static function writeCSVFile($fileName, $header, $rows) {
$null = NULL;
CRM_Utils_System::download(CRM_Utils_String::munge($fileName),
'text/x-csv',
$null,
'csv',
FALSE
);

if (!empty($rows)) {
return self::makeCSVTable($header, $rows, $outputHeader);
return self::makeCSVTable($header, $rows, TRUE);
}
}

Expand Down

0 comments on commit 0aa61b6

Please sign in to comment.