From 8a188f37b1c702b1b77069d19dcdac0745941cd8 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 25 Nov 2019 16:46:59 +1300 Subject: [PATCH] Remove unused parameter This parameter is always TRUE so it adds no value, removing --- CRM/Core/Report/Excel.php | 29 ++++------------------------- CRM/Export/BAO/ExportProcessor.php | 2 +- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/CRM/Core/Report/Excel.php b/CRM/Core/Report/Excel.php index dc0e11f280..46c4943a93 100644 --- a/CRM/Core/Report/Excel.php +++ b/CRM/Core/Report/Excel.php @@ -27,21 +27,17 @@ class CRM_Core_Report_Excel { * @param array $rows * result set rows. * @param string $titleHeader - * @param bool $print - * Should the output be printed. * @param bool $outputHeader * * @return mixed * empty if output is printed, else output * */ - public static function makeCSVTable($header, $rows, $titleHeader = NULL, $print = TRUE, $outputHeader = TRUE) { + public static function makeCSVTable($header, $rows, $titleHeader = NULL, $outputHeader = TRUE) { if ($titleHeader) { echo $titleHeader; } - $result = ''; - $config = CRM_Core_Config::singleton(); $seperator = $config->fieldSeparator; $enclosed = '"'; @@ -59,12 +55,7 @@ class CRM_Core_Report_Excel { // need to add PMA_exportOutputHandler functionality out here, rather than // doing it the moronic way of assembling a buffer $out = trim(substr($schema_insert, 0, -1)) . $add_character; - if ($print) { - echo $out; - } - else { - $result .= $out; - } + echo $out; } $fields_cnt = count($header); @@ -110,19 +101,7 @@ class CRM_Core_Report_Excel { // end for $out = $schema_insert . $add_character; - if ($print) { - echo $out; - } - else { - $result .= $out; - } - } - - if ($print) { - return; - } - else { - return $result; + echo $out; } } @@ -189,7 +168,7 @@ class CRM_Core_Report_Excel { } if (!empty($rows)) { - return self::makeCSVTable($header, $rows, $titleHeader, TRUE, $outputHeader); + return self::makeCSVTable($header, $rows, $titleHeader, $outputHeader); } } diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index cba408b566..5fda71b013 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -2387,7 +2387,7 @@ LIMIT $offset, $limit 'csv', FALSE ); - CRM_Core_Report_Excel::makeCSVTable($headerRows, [], NULL, TRUE, TRUE); + CRM_Core_Report_Excel::makeCSVTable($headerRows, [], NULL, TRUE); } /** -- 2.25.1