Merge pull request #11728 from JMAConsulting/CRM-21809
[civicrm-core.git] / CRM / Batch / BAO / Batch.php
index 47901523d33d7f09230b8d6036b3b5bdc57da513..f7ec3dce4f9f21e4e830a14e518bd6af43f262bb 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
  */
 
 /**
@@ -594,8 +594,10 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
    *   Associated array of batch ids.
    * @param string $exportFormat
    *   Export format.
+   * @param bool $downloadFile
+   *   Download export file?.
    */
-  public static function exportFinancialBatch($batchIds, $exportFormat) {
+  public static function exportFinancialBatch($batchIds, $exportFormat, $downloadFile) {
     if (empty($batchIds)) {
       CRM_Core_Error::fatal(ts('No batches were selected.'));
       return;
@@ -615,6 +617,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
       CRM_Core_Error::fatal("Could not locate exporter: $exporterClass");
     }
     $export = array();
+    $exporter->_isDownloadFile = $downloadFile;
     foreach ($batchIds as $batchId) {
       // export only batches whose status is set to Exported.
       $result = civicrm_api3('Batch', 'getcount', array(