From 63b162c6abeffe5ff3981d6351fc00cf59bef080 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 4 Apr 2019 14:39:17 +1300 Subject: [PATCH] dev/financial#2 add PaymentProcessor.title field There was a long discussion a while back about adding a label or title field to the civicrm_payment_processor table. It kinda died but since 5.13 adds another field (contribution_recur.cancel_reason) which is kinda rare I thought we should probably add this field in the same release as we can better keep most releases to no schema changes that way. At this stage the field is not in use - but I figure getting it added will make the next steps of exposing it easier & there is general agreement we need something of this nature. (the cancel reason field will also take further commits to expose in the UI) --- CRM/Financial/DAO/PaymentProcessor.php | 24 +++++++++++++++++++- CRM/Upgrade/Incremental/php/FiveThirteen.php | 3 +++ xml/schema/Financial/PaymentProcessor.xml | 11 +++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CRM/Financial/DAO/PaymentProcessor.php b/CRM/Financial/DAO/PaymentProcessor.php index 0cca1db687..311fe33b96 100644 --- a/CRM/Financial/DAO/PaymentProcessor.php +++ b/CRM/Financial/DAO/PaymentProcessor.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:10649ac7d8d06b411aa6e800484f459b) + * (GenCodeChecksum:42c6dc8a71daeb67aaa687156121ebf4) */ /** @@ -49,6 +49,13 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO { */ public $name; + /** + * Payment Processor Descriptive Name. + * + * @var string + */ + public $title; + /** * Payment Processor Description. * @@ -237,6 +244,21 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO { 'type' => 'Text', ], ], + 'title' => [ + 'name' => 'title', + 'type' => CRM_Utils_Type::T_STRING, + 'title' => ts('Payment Processor Title'), + 'description' => ts('Payment Processor Descriptive Name.'), + 'maxlength' => 127, + 'size' => CRM_Utils_Type::HUGE, + 'table_name' => 'civicrm_payment_processor', + 'entity' => 'PaymentProcessor', + 'bao' => 'CRM_Financial_BAO_PaymentProcessor', + 'localizable' => 0, + 'html' => [ + 'type' => 'Text', + ], + ], 'description' => [ 'name' => 'description', 'type' => CRM_Utils_Type::T_STRING, diff --git a/CRM/Upgrade/Incremental/php/FiveThirteen.php b/CRM/Upgrade/Incremental/php/FiveThirteen.php index d3c74f06a5..5bfafc9e97 100644 --- a/CRM/Upgrade/Incremental/php/FiveThirteen.php +++ b/CRM/Upgrade/Incremental/php/FiveThirteen.php @@ -77,6 +77,9 @@ class CRM_Upgrade_Incremental_php_FiveThirteen extends CRM_Upgrade_Incremental_B $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 ); + $this->addTask('Add title to civicrm_payment_processor', 'addColumn', + 'civicrm_payment_processor', 'title', "text COMMENT 'Payment Processor Descriptive Name.'", FALSE + ); } } diff --git a/xml/schema/Financial/PaymentProcessor.xml b/xml/schema/Financial/PaymentProcessor.xml index 0538fcc698..ceeba6b0ad 100644 --- a/xml/schema/Financial/PaymentProcessor.xml +++ b/xml/schema/Financial/PaymentProcessor.xml @@ -47,6 +47,17 @@ Text + + title + Payment Processor Title + varchar + 127 + + Text + + Payment Processor Descriptive Name. + 5.13 + description Processor Description -- 2.25.1