Skip to content

Commit

Permalink
Add cancel_reason field
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Apr 1, 2019
1 parent 46e0ade commit ac7a239
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 17 deletions.
22 changes: 21 additions & 1 deletion CRM/Contribute/DAO/ContributionRecur.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:e69f645ae471e887f56e95ee10a8678d)
* (GenCodeChecksum:2ccc42487b9e4e5774fcfcde7db9c5ae)
*/

/**
Expand Down Expand Up @@ -105,6 +105,13 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
*/
public $cancel_date;

/**
* Free text field for a reason for cancelling
*
* @var text
*/
public $cancel_reason;

/**
* Date this recurring contribution finished successfully
*
Expand Down Expand Up @@ -427,6 +434,19 @@ public static function &fields() {
'formatType' => 'activityDate',
],
],
'contribution_recur_cancel_reason' => [
'name' => 'cancel_reason',
'type' => CRM_Utils_Type::T_TEXT,
'title' => ts('Cancellation Reason'),
'description' => ts('Free text field for a reason for cancelling'),
'table_name' => 'civicrm_contribution_recur',
'entity' => 'ContributionRecur',
'bao' => 'CRM_Contribute_BAO_ContributionRecur',
'localizable' => 0,
'html' => [
'type' => 'Text',
],
],
'end_date' => [
'name' => 'end_date',
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
Expand Down
26 changes: 10 additions & 16 deletions CRM/Upgrade/Incremental/php/FiveThirteen.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,15 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
* (change the x in the function name):
*/

// /**
// * Upgrade function.
// *
// * @param string $rev
// */
// public function upgrade_5_0_x($rev) {
// $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
// $this->addTask('Do the foo change', 'taskFoo', ...);
// // Additional tasks here...
// // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }

// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// return TRUE;
// }
/**
* Upgrade function.
*
* @param string $rev
*/
public function upgrade_5_13_alpha1($rev) {
$this->addTask('Add cancel reason column to civicrm_contribution_recur', 'addColumn',
'civicrm_contribution_recur', 'cancel_reason', "text COMMENT 'Free text field for a reason for cancelling'", FALSE
);
}

}
12 changes: 12 additions & 0 deletions xml/schema/Contribute/ContributionRecur.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@
<formatType>activityDate</formatType>
</html>
</field>
<field>
<name>cancel_reason</name>
<type>text</type>
<title>Cancellation Reason</title>
<uniqueName>contribution_recur_cancel_reason</uniqueName>
<comment>Free text field for a reason for cancelling</comment>
<html>
<type>Text</type>
<size>40</size>
</html>
<add>5.13</add>
</field>
<field>
<name>end_date</name>
<title>Recurring Contribution End Date</title>
Expand Down

0 comments on commit ac7a239

Please sign in to comment.