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 !23
parents 2c22fa71 13e7a222
...@@ -19,11 +19,6 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form { ...@@ -19,11 +19,6 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
protected $_addressField = FALSE; protected $_addressField = FALSE;
protected $_customGroupExtends = ['Contribution']; protected $_customGroupExtends = ['Contribution'];
/**
* @var int
*/
protected $batchID;
public function __construct() { public function __construct() {
$this->_columns = [ $this->_columns = [
'civicrm_entity_batch' => [ 'civicrm_entity_batch' => [
...@@ -237,8 +232,8 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form { ...@@ -237,8 +232,8 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
public function where() { public function where() {
$this->_whereClauses[] = "{$this->_aliases['civicrm_value_gift_aid_submission']}.amount IS NOT NULL"; $this->_whereClauses[] = "{$this->_aliases['civicrm_value_gift_aid_submission']}.amount IS NOT NULL";
$this->_whereClauses[] = "{$this->_aliases['civicrm_contact']}.contact_type = 'Individual'"; $this->_whereClauses[] = "{$this->_aliases['civicrm_contact']}.contact_type = 'Individual'";
if ($this->batchID) { if ($this->get('batchID')) {
$this->_whereClauses[] = "{$this->_aliases['civicrm_entity_batch']}.batch_id IN ({$this->batchID})"; $this->_whereClauses[] = "{$this->_aliases['civicrm_entity_batch']}.batch_id IN ({$this->get('batchID')})";
} }
parent::where(); parent::where();
} }
...@@ -293,9 +288,10 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form { ...@@ -293,9 +288,10 @@ class CRM_Civigiftaid_Report_Form_Contribute_GiftAid extends CRM_Report_Form {
* @throws \CRM_Core_Exception * @throws \CRM_Core_Exception
*/ */
public function preProcess() { public function preProcess() {
$this->batchID = CRM_Utils_Request::retrieveValue('batch_id', 'Positive', NULL, FALSE, 'GET'); $batchID = CRM_Utils_Request::retrieveValue('batch_id', 'Positive', NULL, FALSE, 'GET');
if ($this->batchID) { if ($batchID) {
$this->_force = 1; $this->_force = 1;
$this->set('batchID', $batchID);
} }
parent::preProcess(); parent::preProcess();
} }
......
...@@ -9,6 +9,10 @@ Releases use the following numbering system: ...@@ -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. * **[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 ## Release 3.4.7
* When upgrading check and update customfield datatypes (`eligible_for_gift_aid` was `varchar` instead of `int` on some old installs). * When upgrading check and update customfield datatypes (`eligible_for_gift_aid` was `varchar` instead of `int` on some old installs).
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<author>MJW Consulting, Rich Lott (Artful Robot) Erawat Chamanont, Jamie Novick, Guanhuan Chen, Robin Mitra</author> <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> <email>mjw@mjwconsult.co.uk, https://artfulrobot.uk, jamie@compucorp.co.uk, guanhuan@compucorp.co.uk</email>
</maintainer> </maintainer>
<releaseDate>2021-03-23</releaseDate> <releaseDate>2021-03-24</releaseDate>
<version>3.4.7</version> <version>3.4.8-dev</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>5.28</ver> <ver>5.28</ver>
......
Supports Markdown
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