Commit de7397ac authored by mattwire's avatar mattwire
Browse files

Merge branch 'reportbatchexport' into 'master'

Fix exporting when batchID filter is specified via URL

See merge request extensions/ukgiftaid!23
parents 2c22fa71 13e7a222
......@@ -19,11 +19,6 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
protected $_addressField = FALSE;
protected $_customGroupExtends = ['Contribution'];
/**
* @var int
*/
protected $batchID;
public function __construct() {
$this->_columns = [
'civicrm_entity_batch' => [
......@@ -237,8 +232,8 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
public function where() {
$this->_whereClauses[] = "{$this->_aliases['civicrm_value_gift_aid_submission']}.amount IS NOT NULL";
$this->_whereClauses[] = "{$this->_aliases['civicrm_contact']}.contact_type = 'Individual'";
if ($this->batchID) {
$this->_whereClauses[] = "{$this->_aliases['civicrm_entity_batch']}.batch_id IN ({$this->batchID})";
if ($this->get('batchID')) {
$this->_whereClauses[] = "{$this->_aliases['civicrm_entity_batch']}.batch_id IN ({$this->get('batchID')})";
}
parent::where();
}
......@@ -293,9 +288,10 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
* @throws \CRM_Core_Exception
*/
public function preProcess() {
$this->batchID = CRM_Utils_Request::retrieveValue('batch_id', 'Positive', NULL, FALSE, 'GET');
if ($this->batchID) {
$batchID = CRM_Utils_Request::retrieveValue('batch_id', 'Positive', NULL, FALSE, 'GET');
if ($batchID) {
$this->_force = 1;
$this->set('batchID', $batchID);
}
parent::preProcess();
}
......
......@@ -9,6 +9,10 @@ Releases use the following numbering system:
* **[BC]**: Items marked with [BC] indicate a breaking change that will require updates to your code if you are using that code in your extension.
## Release 3.4.8 (Not yet released 2021-03-24)
* Fix exporting when batchID filter is specified via URL.
## Release 3.4.7
* When upgrading check and update customfield datatypes (`eligible_for_gift_aid` was `varchar` instead of `int` on some old installs).
......
......@@ -18,8 +18,8 @@
<author>MJW Consulting, Rich Lott (Artful Robot) Erawat Chamanont, Jamie Novick, Guanhuan Chen, Robin Mitra</author>
<email>mjw@mjwconsult.co.uk, https://artfulrobot.uk, jamie@compucorp.co.uk, guanhuan@compucorp.co.uk</email>
</maintainer>
<releaseDate>2021-03-23</releaseDate>
<version>3.4.7</version>
<releaseDate>2021-03-24</releaseDate>
<version>3.4.8-dev</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.28</ver>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment