dev/financial#2 add PaymentProcessor.title field
authoreileen <emcnaughton@wikimedia.org>
Thu, 4 Apr 2019 01:39:17 +0000 (14:39 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 4 Apr 2019 02:10:42 +0000 (15:10 +1300)
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
CRM/Upgrade/Incremental/php/FiveThirteen.php
xml/schema/Financial/PaymentProcessor.xml

index 0cca1db687b39c0edfa5bdca7cb76191c2110f27..311fe33b96d6519b827ba214e56b99f1f7a5c677 100644 (file)
@@ -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,
index d3c74f06a5f7d41c08046f8b8d2ca7061c7360cb..5bfafc9e970cf5211cc16827387b2b86f1ac3f77 100644 (file)
@@ -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
+    );
   }
 
 }
index 0538fcc6983d9897b4019bc1cb3595a527819120..ceeba6b0ad715c13cf46f38fbaaab6ba8f9b84d5 100644 (file)
       <type>Text</type>
     </html>
   </field>
+  <field>
+    <name>title</name>
+    <title>Payment Processor Title</title>
+    <type>varchar</type>
+    <length>127</length>
+    <html>
+      <type>Text</type>
+    </html>
+    <comment>Payment Processor Descriptive Name.</comment>
+    <add>5.13</add>
+  </field>
   <field>
     <name>description</name>
     <title>Processor Description</title>