Commit 0a050998 authored by mattwire's avatar mattwire
Browse files

Add GiftAid.Ensuredatastructures API and update release notes

parent 36ded718
......@@ -38,7 +38,6 @@ class CRM_Civigiftaid_Upgrader extends CRM_Civigiftaid_Upgrader_Base {
/**
*/
public function install() {
$this->ensureDataStructures();
// Nb. this is kept to preserve previous behaviour, it should not be needed.
......@@ -64,7 +63,6 @@ class CRM_Civigiftaid_Upgrader extends CRM_Civigiftaid_Upgrader_Base {
$this->ensureCustomFields();
$this->setDefaultSettings();
$this->ensureProfiles();
}
/**
* Ensure we have the custom groups defined.
......
......@@ -7,13 +7,8 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt).
## Requirements
* PHP v7.2+
* CiviCRM 5.24+
* CiviCRM 5.28+
## Installation
See: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension
### Support
Documentation: [docs/index.md](/docs/index.md)
For online submission directly to HMRC see https://lab.civicrm.org/extensions/ukgiftaidsubmission
Documentation is available [here](https://docs.civicrm.org/ukgiftaid).
......@@ -9,6 +9,8 @@
+--------------------------------------------------------------------+
*/
use CRM_Civigiftaid_ExtensionUtil as E;
/**
* @param array $params
*/
......@@ -288,3 +290,9 @@ function civicrm_api3_gift_aid_updatedeclarations($params) {
return civicrm_api3_create_success($updated, $params, 'GiftAid', 'Updatedeclarations');
}
function civicrm_api3_gift_aid_ensuredatastructures($params) {
$upgrader = new CRM_Civigiftaid_Upgrader(E::LONG_NAME, E::path());
$upgrader->ensureDataStructures();
return civicrm_api3_create_success([], $params, 'GiftAid', 'Ensuredatastructures');
}
......@@ -5,7 +5,7 @@
You can use the `limit` and `offset` API3 options to control how many entities these APIs will process each run.
### Update Eligible Contributions
GiftAid.updateeligiblecontributions - API to set "Eligible for Gift Aid" on all contributions where
`GiftAid.updateeligiblecontributions` - API to set "Eligible for Gift Aid" on all contributions where
it was not previously set.
This allows to to "fix" any contributions that were created with an older version of the extension.
......@@ -21,7 +21,7 @@ Note that a contribution's eligibility is based on the financial types of the li
- If true, recalculate Gift Aid amounts (but not eligibility) for contributions that have the eligible flag set.
### Recalculate Contribution Amounts
GiftAid.recalculatecontributionamounts - API to recalculate gift aid amounts for contributions.
`GiftAid.recalculatecontributionamounts` - API to recalculate gift aid amounts for contributions.
This is also done by updateeligiblecontributions but there are two main differences:
1. The eligibility status is not changed.
......@@ -30,7 +30,7 @@ This is also done by updateeligiblecontributions but there are two main differen
- `batch_name` (string): The batch name (note that you see the label in the UI but you need the name which you can find from the `gift_aid_batch_name` option group).
### Update Declarations
GiftAid.updatedeclarations - API to update existing declarations that may be invalid (eg. were imported, missing address etc.).
`GiftAid.updatedeclarations` - API to update existing declarations that may be invalid (eg. were imported, missing address etc.).
!! note
This API only updates the first declaration for a contact
......@@ -41,3 +41,10 @@ GiftAid.updatedeclarations - API to update existing declarations that may be inv
- `given_date` (string): Declaration given date - if not set defaults to existing date or start_date or contact created_date.
- `source` (string): Source text if existing declaration source text is empty.
- `has_start_date` (bool): Existing declaration has start date? Choose whether to update declarations which have/have not a start_date set. This is useful for updating ones with a start_date differently to ones without (eg. adding different source text).
### Ensure Data Structures
**WARNING: This will make changes to custom fields, option groups, profiles without asking and may lead to data loss! Always run on a test site first**.
`GiftAid.Ensuredatastructures` - API to validate and update data structures (custom fields, option groups, profiles) required by the GiftAid extension.
This should be done automatically by the extension upgrader but if necessary you can use this API to do so.
......@@ -7,18 +7,18 @@ The extension is licensed under [AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0
## Requirements
* PHP v7.2+
* CiviCRM 5.24+
* CiviCRM 5.28+
## Installation
See: https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension
See: [Installing a new extension](https://docs.civicrm.org/sysadmin/en/latest/customize/extensions/#installing-a-new-extension).
## Related
To make online submissions directly from CiviCRM you can install the https://lab.civicrm.org/extensions/ukgiftaidsubmission extension.
To make online submissions directly from CiviCRM you can install the [Online Gift Aid Submission](https://lab.civicrm.org/extensions/ukgiftaidsubmission) extension.
## Future development
#### Addresses
Think about improvements to handling address updates. Maybe this could be useful? https://lab.civicrm.org/extensions/formercommunicationdata
Think about improvements to handling address updates. Maybe the [formercommunicationdata](https://lab.civicrm.org/extensions/formercommunicationdata) extension could be useful?
......@@ -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.6 (not yet released 2020-11-08)
* Add `GiftAid.Ensuredatastructures` API.
## Release 3.4.5
* Fix [#10](https://lab.civicrm.org/extensions/ukgiftaid/-/issues/10) - issues with Gift Aid profile description and fields.
......
......@@ -18,11 +18,11 @@
<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>2020-10-05</releaseDate>
<version>3.4.5</version>
<develStage>stable</develStage>
<releaseDate>2020-11-08</releaseDate>
<version>3.4.6-dev</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.25</ver>
<ver>5.28</ver>
</compatibility>
<civix>
<namespace>CRM/Civigiftaid</namespace>
......
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