Merge pull request #18847 from civicrm/5.31
[civicrm-core.git] / ext / contributioncancelactions / contributioncancelactions.php
1 <?php
2
3 require_once 'contributioncancelactions.civix.php';
4 // phpcs:disable
5 use CRM_Contributioncancelactions_ExtensionUtil as E;
6 // phpcs:enable
7
8 /**
9 * Implements hook_civicrm_preProcess().
10 *
11 * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_post
12 */
13 function contributioncancelactions_civicrm_post($op, $objectName, $objectId, $objectRef) {
14 if ($op === 'edit' && $objectName === 'Contribution') {
15 if ($objectRef->contribution_status_id === CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Cancelled')) {
16 // Do the stuff.
17 }
18 }
19 }