*
* Generated from xml/schema/CRM/Contribute/Contribution.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b4e84298d9ba23d3b2fae0768fc5cb58)
+ * (GenCodeChecksum:a9f83aa612e82ee87ace74e75fe23466)
*/
/**
*/
public $revenue_recognition_date;
+ /**
+ * Shows this is a template for recurring contributions.
+ *
+ * @var bool
+ */
+ public $is_template;
+
/**
* Class constructor.
*/
'formatType' => 'activityDateTime',
],
],
+ 'is_template' => [
+ 'name' => 'is_template',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ 'title' => ts('Is a Template Contribution'),
+ 'description' => ts('Shows this is a template for recurring contributions.'),
+ 'import' => TRUE,
+ 'where' => 'civicrm_contribution.is_template',
+ 'export' => TRUE,
+ 'default' => '0',
+ 'table_name' => 'civicrm_contribution',
+ 'entity' => 'Contribution',
+ 'bao' => 'CRM_Contribute_BAO_Contribution',
+ 'localizable' => 0,
+ 'html' => [
+ 'type' => 'CheckBox',
+ ],
+ ],
];
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
* (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', [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;
// }
public function upgrade_5_20_alpha1($rev) {
$this->addTask('Add frontend title column to contribution page table', 'addColumn', 'civicrm_contribution_page',
'frontend_title', "varchar(255) DEFAULT NULL COMMENT 'Contribution Page Public title'", TRUE, '5.20.alpha1');
+ $this->addTask('Add is_template field to civicrm_contribution', 'addColumn', 'civicrm_contribution', 'is_template',
+ "tinyint(4) DEFAULT '0' COMMENT 'Shows this is a template for recurring contributions.'", FALSE, '5.20.alpha1');
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
}
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 31,
+ 'contact_id' => 32,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'net_amount' => '95',
'source' => 'SSF',
'contribution_status_id' => 1,
- 'honor_contact_id' => 32,
+ 'honor_contact_id' => 33,
];
try{
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '31',
+ 'contact_id' => '32',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '4',
'creditnote_id' => '',
'tax_amount' => '',
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
],
],
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 25,
+ 'contact_id' => 26,
'receive_date' => '2012-01-01',
'total_amount' => '100',
'financial_type_id' => 1,
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '25',
+ 'contact_id' => '26',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '1',
'creditnote_id' => '',
'tax_amount' => '',
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
],
],
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 27,
+ 'contact_id' => 28,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'contribution_status_id' => 1,
'soft_credit' => [
'1' => [
- 'contact_id' => 28,
+ 'contact_id' => 29,
'amount' => 50,
'soft_credit_type_id' => 3,
],
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '27',
+ 'contact_id' => '28',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '4',
'creditnote_id' => '',
'tax_amount' => '',
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
],
],
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 29,
+ 'contact_id' => 30,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'net_amount' => '95',
'source' => 'SSF',
'contribution_status_id' => 1,
- 'soft_credit_to' => 30,
+ 'soft_credit_to' => 31,
];
try{
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '29',
+ 'contact_id' => '30',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '4',
'creditnote_id' => '',
'tax_amount' => '',
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
],
],
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 1,
+ 'contact_id' => 39,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '1',
+ 'contact_id' => '39',
'financial_type_id' => '1',
'contribution_page_id' => '1',
'payment_instrument_id' => '4',
'creditnote_id' => '',
'tax_amount' => '',
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
],
],
*/
function contribution_create_example() {
$params = [
- 'contact_id' => 12,
+ 'contact_id' => 13,
'receive_date' => '20120511',
'total_amount' => '100',
'financial_type_id' => 1,
'values' => [
'1' => [
'id' => '1',
- 'contact_id' => '12',
+ 'contact_id' => '13',
'financial_type_id' => '1',
'contribution_page_id' => '',
'payment_instrument_id' => '1',
'creditnote_id' => '',
'tax_amount' => 0,
'revenue_recognition_date' => '',
+ 'is_template' => '',
'contribution_type_id' => '1',
'api.line_item.create' => [
'0' => [
</html>
<add>4.7</add>
</field>
+ <field>
+ <name>is_template</name>
+ <title>Is a Template Contribution</title>
+ <type>boolean</type>
+ <default>0</default>
+ <import>true</import>
+ <comment>Shows this is a template for recurring contributions.</comment>
+ <html>
+ <type>CheckBox</type>
+ </html>
+ <add>5.20</add>
+ </field>
</table>