X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FBatch%2FBAO%2FBatch.php;h=1f420a0c57787e8db840b464b0c7390d2300284a;hb=10c5467b83d76cce872aa7e80eb51bda0d4907d6;hp=f44c0e4999485fcd03a7a35621bd2bd1ba4e9a9c;hpb=8b2203a551d0651f5d13515bb0a4de2df5e3c071;p=civicrm-core.git diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index f44c0e4999..1f420a0c57 100644 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -450,8 +450,8 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { 'export' => [ 'name' => ts('Export'), 'title' => ts('Export Batch'), - 'url' => '#', - 'extra' => 'rel="export"', + 'url' => 'civicrm/financial/batch/export', + 'qs' => 'reset=1&id=%%id%%&status=1', ], 'reopen' => [ 'name' => ts('Re-open'), @@ -579,12 +579,10 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { */ public static function exportFinancialBatch($batchIds, $exportFormat, $downloadFile) { if (empty($batchIds)) { - CRM_Core_Error::fatal(ts('No batches were selected.')); - return; + throw new CRM_Core_Exception(ts('No batches were selected.')); } if (empty($exportFormat)) { - CRM_Core_Error::fatal(ts('No export format selected.')); - return; + throw new CRM_Core_Exception(ts('No export format selected.')); } self::$_exportFormat = $exportFormat; @@ -594,7 +592,7 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch { $exporter = new $exporterClass(); } else { - CRM_Core_Error::fatal("Could not locate exporter: $exporterClass"); + throw new CRM_Core_Exception("Could not locate exporter: $exporterClass"); } $export = []; $exporter->_isDownloadFile = $downloadFile;