From: Pradeep Nayak Date: Fri, 2 Aug 2013 14:57:49 +0000 (+0530) Subject: -- Fixed formatting and code fix for CRM-12694, removed mime_content_type since we... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f4114c3e1b10ed6c37bcfff5af2013612d3c44d4;p=civicrm-core.git -- Fixed formatting and code fix for CRM-12694, removed mime_content_type since we have only 2 export format CSV and IIF and both have text/plain mime_content_type ---------------------------------------- * CRM-12694: Eliminate/replace call to function mime_content_type() http://issues.civicrm.org/jira/browse/CRM-12694 --- diff --git a/CRM/Financial/BAO/ExportFormat.php b/CRM/Financial/BAO/ExportFormat.php index 033e8c3e5e..399261954c 100644 --- a/CRM/Financial/BAO/ExportFormat.php +++ b/CRM/Financial/BAO/ExportFormat.php @@ -74,7 +74,7 @@ class CRM_Financial_BAO_ExportFormat { case 'iif': $tplFile = $this->getTemplateFileName(); - $out = self::getTemplate()->fetch( $tplFile ); + $out = self::getTemplate()->fetch($tplFile); $fileName = $this->putFile($out); self::createActivityExport($this->_batchIds, $fileName); break; @@ -121,26 +121,26 @@ class CRM_Financial_BAO_ExportFormat { $config = CRM_Core_Config::singleton(); //zip files if more than one. if (count($this->_downloadFile)>1) { - $zip = $config->customFileUploadDir.'Financial_Transactions_'.date('YmdHis').'.zip'; + $zip = $config->customFileUploadDir . 'Financial_Transactions_' . date('YmdHis') . '.zip'; $result = $this->createZip($this->_downloadFile, $zip, TRUE); if ($result) { header('Content-Type: application/zip'); - header('Content-Disposition: attachment; filename='.CRM_Utils_File::cleanFileName(basename($zip))); + header('Content-Disposition: attachment; filename=' . CRM_Utils_File::cleanFileName(basename($zip))); header('Content-Length: ' . filesize($zip)); ob_clean(); flush(); - readfile($config->customFileUploadDir.CRM_Utils_File::cleanFileName(basename($zip))); + readfile($config->customFileUploadDir . CRM_Utils_File::cleanFileName(basename($zip))); unlink($zip); //delete the zip to avoid clutter. CRM_Utils_System::civiExit(); } } else { - header('Content-Type: '.mime_content_type($this->_downloadFile[0])); - header('Content-Disposition: attachment; filename='.CRM_Utils_File::cleanFileName(basename($this->_downloadFile[0]))); + header('Content-Type: text/plain'); + header('Content-Disposition: attachment; filename=' . CRM_Utils_File::cleanFileName(basename($this->_downloadFile[0]))); header('Content-Length: ' . filesize($this->_downloadFile[0])); ob_clean(); flush(); - readfile($config->customFileUploadDir.CRM_Utils_File::cleanFileName(basename($this->_downloadFile[0]))); + readfile($config->customFileUploadDir . CRM_Utils_File::cleanFileName(basename($this->_downloadFile[0]))); CRM_Utils_System::civiExit(); } }