Merge pull request #22483 from eileenmcnaughton/token1
[civicrm-core.git] / CRM / Contribute / DAO / ContributionPage.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e33f9a31d9be56f20e20c753313478d1)
10 */
11
12 /**
13 * Database access object for the ContributionPage entity.
14 */
15 class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.3';
18 const COMPONENT = 'CiviContribute';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_contribution_page';
26
27 /**
28 * Field to show when displaying a record.
29 *
30 * @var string
31 */
32 public static $_labelField = 'title';
33
34 /**
35 * Should CiviCRM log any modifications to this table in the civicrm_log table.
36 *
37 * @var bool
38 */
39 public static $_log = TRUE;
40
41 /**
42 * Contribution ID
43 *
44 * @var int|string|null
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
47 */
48 public $id;
49
50 /**
51 * Contribution Page title. For top of page display
52 *
53 * @var string|null
54 * (SQL type: varchar(255))
55 * Note that values will be retrieved from the database as a string.
56 */
57 public $title;
58
59 /**
60 * Text and html allowed. Displayed below title.
61 *
62 * @var string|null
63 * (SQL type: text)
64 * Note that values will be retrieved from the database as a string.
65 */
66 public $intro_text;
67
68 /**
69 * default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution
70 *
71 * @var int|string|null
72 * (SQL type: int unsigned)
73 * Note that values will be retrieved from the database as a string.
74 */
75 public $financial_type_id;
76
77 /**
78 * Payment Processors configured for this contribution Page
79 *
80 * @var string|null
81 * (SQL type: varchar(128))
82 * Note that values will be retrieved from the database as a string.
83 */
84 public $payment_processor;
85
86 /**
87 * if true - processing logic must reject transaction at confirmation stage if pay method != credit card
88 *
89 * @var bool|string|null
90 * (SQL type: tinyint)
91 * Note that values will be retrieved from the database as a string.
92 */
93 public $is_credit_card_only;
94
95 /**
96 * if true - allows real-time monetary transactions otherwise non-monetary transactions
97 *
98 * @var bool|string|null
99 * (SQL type: tinyint)
100 * Note that values will be retrieved from the database as a string.
101 */
102 public $is_monetary;
103
104 /**
105 * if true - allows recurring contributions, valid only for PayPal_Standard
106 *
107 * @var bool|string|null
108 * (SQL type: tinyint)
109 * Note that values will be retrieved from the database as a string.
110 */
111 public $is_recur;
112
113 /**
114 * if false, the confirm page in contribution pages gets skipped
115 *
116 * @var bool|string|null
117 * (SQL type: tinyint)
118 * Note that values will be retrieved from the database as a string.
119 */
120 public $is_confirm_enabled;
121
122 /**
123 * Supported recurring frequency units.
124 *
125 * @var string|null
126 * (SQL type: varchar(128))
127 * Note that values will be retrieved from the database as a string.
128 */
129 public $recur_frequency_unit;
130
131 /**
132 * if true - supports recurring intervals
133 *
134 * @var bool|string|null
135 * (SQL type: tinyint)
136 * Note that values will be retrieved from the database as a string.
137 */
138 public $is_recur_interval;
139
140 /**
141 * if true - asks user for recurring installments
142 *
143 * @var bool|string|null
144 * (SQL type: tinyint)
145 * Note that values will be retrieved from the database as a string.
146 */
147 public $is_recur_installments;
148
149 /**
150 * if true - user is able to adjust payment start date
151 *
152 * @var bool|string|null
153 * (SQL type: tinyint)
154 * Note that values will be retrieved from the database as a string.
155 */
156 public $adjust_recur_start_date;
157
158 /**
159 * if true - allows the user to send payment directly to the org later
160 *
161 * @var bool|string|null
162 * (SQL type: tinyint)
163 * Note that values will be retrieved from the database as a string.
164 */
165 public $is_pay_later;
166
167 /**
168 * The text displayed to the user in the main form
169 *
170 * @var string|null
171 * (SQL type: text)
172 * Note that values will be retrieved from the database as a string.
173 */
174 public $pay_later_text;
175
176 /**
177 * The receipt sent to the user instead of the normal receipt text
178 *
179 * @var string|null
180 * (SQL type: text)
181 * Note that values will be retrieved from the database as a string.
182 */
183 public $pay_later_receipt;
184
185 /**
186 * is partial payment enabled for this online contribution page
187 *
188 * @var bool|string|null
189 * (SQL type: tinyint)
190 * Note that values will be retrieved from the database as a string.
191 */
192 public $is_partial_payment;
193
194 /**
195 * Initial amount label for partial payment
196 *
197 * @var string|null
198 * (SQL type: varchar(255))
199 * Note that values will be retrieved from the database as a string.
200 */
201 public $initial_amount_label;
202
203 /**
204 * Initial amount help text for partial payment
205 *
206 * @var string|null
207 * (SQL type: text)
208 * Note that values will be retrieved from the database as a string.
209 */
210 public $initial_amount_help_text;
211
212 /**
213 * Minimum initial amount for partial payment
214 *
215 * @var float|string|null
216 * (SQL type: decimal(20,2))
217 * Note that values will be retrieved from the database as a string.
218 */
219 public $min_initial_amount;
220
221 /**
222 * if true, page will include an input text field where user can enter their own amount
223 *
224 * @var bool|string|null
225 * (SQL type: tinyint)
226 * Note that values will be retrieved from the database as a string.
227 */
228 public $is_allow_other_amount;
229
230 /**
231 * FK to civicrm_option_value.
232 *
233 * @var int|string|null
234 * (SQL type: int unsigned)
235 * Note that values will be retrieved from the database as a string.
236 */
237 public $default_amount_id;
238
239 /**
240 * if other amounts allowed, user can configure minimum allowed.
241 *
242 * @var float|string|null
243 * (SQL type: decimal(20,2))
244 * Note that values will be retrieved from the database as a string.
245 */
246 public $min_amount;
247
248 /**
249 * if other amounts allowed, user can configure maximum allowed.
250 *
251 * @var float|string|null
252 * (SQL type: decimal(20,2))
253 * Note that values will be retrieved from the database as a string.
254 */
255 public $max_amount;
256
257 /**
258 * The target goal for this page, allows people to build a goal meter
259 *
260 * @var float|string|null
261 * (SQL type: decimal(20,2))
262 * Note that values will be retrieved from the database as a string.
263 */
264 public $goal_amount;
265
266 /**
267 * Title for Thank-you page (header title tag, and display at the top of the page).
268 *
269 * @var string|null
270 * (SQL type: varchar(255))
271 * Note that values will be retrieved from the database as a string.
272 */
273 public $thankyou_title;
274
275 /**
276 * text and html allowed. displayed above result on success page
277 *
278 * @var string|null
279 * (SQL type: text)
280 * Note that values will be retrieved from the database as a string.
281 */
282 public $thankyou_text;
283
284 /**
285 * Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.
286 *
287 * @var string|null
288 * (SQL type: text)
289 * Note that values will be retrieved from the database as a string.
290 */
291 public $thankyou_footer;
292
293 /**
294 * if true, receipt is automatically emailed to contact on success
295 *
296 * @var bool|string|null
297 * (SQL type: tinyint)
298 * Note that values will be retrieved from the database as a string.
299 */
300 public $is_email_receipt;
301
302 /**
303 * FROM email name used for receipts generated by contributions to this contribution page.
304 *
305 * @var string|null
306 * (SQL type: varchar(255))
307 * Note that values will be retrieved from the database as a string.
308 */
309 public $receipt_from_name;
310
311 /**
312 * FROM email address used for receipts generated by contributions to this contribution page.
313 *
314 * @var string|null
315 * (SQL type: varchar(255))
316 * Note that values will be retrieved from the database as a string.
317 */
318 public $receipt_from_email;
319
320 /**
321 * comma-separated list of email addresses to cc each time a receipt is sent
322 *
323 * @var string|null
324 * (SQL type: varchar(255))
325 * Note that values will be retrieved from the database as a string.
326 */
327 public $cc_receipt;
328
329 /**
330 * comma-separated list of email addresses to bcc each time a receipt is sent
331 *
332 * @var string|null
333 * (SQL type: varchar(255))
334 * Note that values will be retrieved from the database as a string.
335 */
336 public $bcc_receipt;
337
338 /**
339 * text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now
340 *
341 * @var string|null
342 * (SQL type: text)
343 * Note that values will be retrieved from the database as a string.
344 */
345 public $receipt_text;
346
347 /**
348 * Is this property active?
349 *
350 * @var bool|string|null
351 * (SQL type: tinyint)
352 * Note that values will be retrieved from the database as a string.
353 */
354 public $is_active;
355
356 /**
357 * Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.
358 *
359 * @var string|null
360 * (SQL type: text)
361 * Note that values will be retrieved from the database as a string.
362 */
363 public $footer_text;
364
365 /**
366 * Is this property active?
367 *
368 * @var bool|string|null
369 * (SQL type: tinyint)
370 * Note that values will be retrieved from the database as a string.
371 */
372 public $amount_block_is_active;
373
374 /**
375 * Date and time that this page starts.
376 *
377 * @var string|null
378 * (SQL type: datetime)
379 * Note that values will be retrieved from the database as a string.
380 */
381 public $start_date;
382
383 /**
384 * Date and time that this page ends. May be NULL if no defined end date/time
385 *
386 * @var string|null
387 * (SQL type: datetime)
388 * Note that values will be retrieved from the database as a string.
389 */
390 public $end_date;
391
392 /**
393 * FK to civicrm_contact, who created this contribution page
394 *
395 * @var int|string|null
396 * (SQL type: int unsigned)
397 * Note that values will be retrieved from the database as a string.
398 */
399 public $created_id;
400
401 /**
402 * Date and time that contribution page was created.
403 *
404 * @var string|null
405 * (SQL type: datetime)
406 * Note that values will be retrieved from the database as a string.
407 */
408 public $created_date;
409
410 /**
411 * 3 character string, value from config setting or input via user.
412 *
413 * @var string|null
414 * (SQL type: varchar(3))
415 * Note that values will be retrieved from the database as a string.
416 */
417 public $currency;
418
419 /**
420 * The campaign for which we are collecting contributions with this page.
421 *
422 * @var int|string|null
423 * (SQL type: int unsigned)
424 * Note that values will be retrieved from the database as a string.
425 */
426 public $campaign_id;
427
428 /**
429 * Can people share the contribution page through social media?
430 *
431 * @var bool|string|null
432 * (SQL type: tinyint)
433 * Note that values will be retrieved from the database as a string.
434 */
435 public $is_share;
436
437 /**
438 * if true - billing block is required for online contribution page
439 *
440 * @var bool|string|null
441 * (SQL type: tinyint)
442 * Note that values will be retrieved from the database as a string.
443 */
444 public $is_billing_required;
445
446 /**
447 * Contribution Page Public title
448 *
449 * @var string|null
450 * (SQL type: varchar(255))
451 * Note that values will be retrieved from the database as a string.
452 */
453 public $frontend_title;
454
455 /**
456 * Class constructor.
457 */
458 public function __construct() {
459 $this->__table = 'civicrm_contribution_page';
460 parent::__construct();
461 }
462
463 /**
464 * Returns localized title of this entity.
465 *
466 * @param bool $plural
467 * Whether to return the plural version of the title.
468 */
469 public static function getEntityTitle($plural = FALSE) {
470 return $plural ? ts('Contribution Pages') : ts('Contribution Page');
471 }
472
473 /**
474 * Returns foreign keys and entity references.
475 *
476 * @return array
477 * [CRM_Core_Reference_Interface]
478 */
479 public static function getReferenceColumns() {
480 if (!isset(Civi::$statics[__CLASS__]['links'])) {
481 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
482 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'financial_type_id', 'civicrm_financial_type', 'id');
483 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
484 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
485 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
486 }
487 return Civi::$statics[__CLASS__]['links'];
488 }
489
490 /**
491 * Returns all the column names of this table
492 *
493 * @return array
494 */
495 public static function &fields() {
496 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
497 Civi::$statics[__CLASS__]['fields'] = [
498 'id' => [
499 'name' => 'id',
500 'type' => CRM_Utils_Type::T_INT,
501 'title' => ts('Contribution Page ID'),
502 'description' => ts('Contribution ID'),
503 'required' => TRUE,
504 'where' => 'civicrm_contribution_page.id',
505 'table_name' => 'civicrm_contribution_page',
506 'entity' => 'ContributionPage',
507 'bao' => 'CRM_Contribute_BAO_ContributionPage',
508 'localizable' => 0,
509 'html' => [
510 'type' => 'Number',
511 ],
512 'readonly' => TRUE,
513 'add' => '1.3',
514 ],
515 'title' => [
516 'name' => 'title',
517 'type' => CRM_Utils_Type::T_STRING,
518 'title' => ts('Contribution Page Title'),
519 'description' => ts('Contribution Page title. For top of page display'),
520 'maxlength' => 255,
521 'size' => CRM_Utils_Type::HUGE,
522 'where' => 'civicrm_contribution_page.title',
523 'table_name' => 'civicrm_contribution_page',
524 'entity' => 'ContributionPage',
525 'bao' => 'CRM_Contribute_BAO_ContributionPage',
526 'localizable' => 1,
527 'add' => '1.3',
528 ],
529 'intro_text' => [
530 'name' => 'intro_text',
531 'type' => CRM_Utils_Type::T_TEXT,
532 'title' => ts('Contribution Page Introduction Text'),
533 'description' => ts('Text and html allowed. Displayed below title.'),
534 'rows' => 6,
535 'cols' => 50,
536 'where' => 'civicrm_contribution_page.intro_text',
537 'table_name' => 'civicrm_contribution_page',
538 'entity' => 'ContributionPage',
539 'bao' => 'CRM_Contribute_BAO_ContributionPage',
540 'localizable' => 1,
541 'html' => [
542 'type' => 'RichTextEditor',
543 ],
544 'add' => '1.3',
545 ],
546 'financial_type_id' => [
547 'name' => 'financial_type_id',
548 'type' => CRM_Utils_Type::T_INT,
549 'title' => ts('Financial Type ID'),
550 'description' => ts('default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution'),
551 'where' => 'civicrm_contribution_page.financial_type_id',
552 'table_name' => 'civicrm_contribution_page',
553 'entity' => 'ContributionPage',
554 'bao' => 'CRM_Contribute_BAO_ContributionPage',
555 'localizable' => 0,
556 'FKClassName' => 'CRM_Financial_DAO_FinancialType',
557 'html' => [
558 'type' => 'Select',
559 'label' => ts("Financial Type"),
560 ],
561 'pseudoconstant' => [
562 'table' => 'civicrm_financial_type',
563 'keyColumn' => 'id',
564 'labelColumn' => 'name',
565 ],
566 'add' => '4.3',
567 ],
568 'payment_processor' => [
569 'name' => 'payment_processor',
570 'type' => CRM_Utils_Type::T_STRING,
571 'title' => ts('Payment Processor'),
572 'description' => ts('Payment Processors configured for this contribution Page'),
573 'maxlength' => 128,
574 'size' => CRM_Utils_Type::HUGE,
575 'where' => 'civicrm_contribution_page.payment_processor',
576 'table_name' => 'civicrm_contribution_page',
577 'entity' => 'ContributionPage',
578 'bao' => 'CRM_Contribute_BAO_ContributionPage',
579 'localizable' => 0,
580 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
581 'html' => [
582 'type' => 'Select',
583 'label' => ts("Payment Processors"),
584 ],
585 'pseudoconstant' => [
586 'table' => 'civicrm_payment_processor',
587 'keyColumn' => 'id',
588 'labelColumn' => 'name',
589 ],
590 'add' => '1.8',
591 ],
592 'is_credit_card_only' => [
593 'name' => 'is_credit_card_only',
594 'type' => CRM_Utils_Type::T_BOOLEAN,
595 'title' => ts('Is Credit Card Only?'),
596 'description' => ts('if true - processing logic must reject transaction at confirmation stage if pay method != credit card'),
597 'where' => 'civicrm_contribution_page.is_credit_card_only',
598 'default' => '0',
599 'table_name' => 'civicrm_contribution_page',
600 'entity' => 'ContributionPage',
601 'bao' => 'CRM_Contribute_BAO_ContributionPage',
602 'localizable' => 0,
603 'add' => '1.3',
604 ],
605 'is_monetary' => [
606 'name' => 'is_monetary',
607 'type' => CRM_Utils_Type::T_BOOLEAN,
608 'title' => ts('Is Monetary'),
609 'description' => ts('if true - allows real-time monetary transactions otherwise non-monetary transactions'),
610 'where' => 'civicrm_contribution_page.is_monetary',
611 'default' => '1',
612 'table_name' => 'civicrm_contribution_page',
613 'entity' => 'ContributionPage',
614 'bao' => 'CRM_Contribute_BAO_ContributionPage',
615 'localizable' => 0,
616 'add' => '1.6',
617 ],
618 'is_recur' => [
619 'name' => 'is_recur',
620 'type' => CRM_Utils_Type::T_BOOLEAN,
621 'title' => ts('Is Recurring'),
622 'description' => ts('if true - allows recurring contributions, valid only for PayPal_Standard'),
623 'where' => 'civicrm_contribution_page.is_recur',
624 'default' => '0',
625 'table_name' => 'civicrm_contribution_page',
626 'entity' => 'ContributionPage',
627 'bao' => 'CRM_Contribute_BAO_ContributionPage',
628 'localizable' => 0,
629 'add' => '1.6',
630 ],
631 'is_confirm_enabled' => [
632 'name' => 'is_confirm_enabled',
633 'type' => CRM_Utils_Type::T_BOOLEAN,
634 'title' => ts('Confirmation Page?'),
635 'description' => ts('if false, the confirm page in contribution pages gets skipped'),
636 'where' => 'civicrm_contribution_page.is_confirm_enabled',
637 'default' => '1',
638 'table_name' => 'civicrm_contribution_page',
639 'entity' => 'ContributionPage',
640 'bao' => 'CRM_Contribute_BAO_ContributionPage',
641 'localizable' => 0,
642 'add' => '4.2',
643 ],
644 'recur_frequency_unit' => [
645 'name' => 'recur_frequency_unit',
646 'type' => CRM_Utils_Type::T_STRING,
647 'title' => ts('Recurring Frequency'),
648 'description' => ts('Supported recurring frequency units.'),
649 'maxlength' => 128,
650 'size' => CRM_Utils_Type::HUGE,
651 'where' => 'civicrm_contribution_page.recur_frequency_unit',
652 'table_name' => 'civicrm_contribution_page',
653 'entity' => 'ContributionPage',
654 'bao' => 'CRM_Contribute_BAO_ContributionPage',
655 'localizable' => 0,
656 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
657 'html' => [
658 'type' => 'Select',
659 ],
660 'pseudoconstant' => [
661 'optionGroupName' => 'recur_frequency_units',
662 'keyColumn' => 'name',
663 'optionEditPath' => 'civicrm/admin/options/recur_frequency_units',
664 ],
665 'add' => '2.1',
666 ],
667 'is_recur_interval' => [
668 'name' => 'is_recur_interval',
669 'type' => CRM_Utils_Type::T_BOOLEAN,
670 'title' => ts('Support Recurring Intervals'),
671 'description' => ts('if true - supports recurring intervals'),
672 'where' => 'civicrm_contribution_page.is_recur_interval',
673 'default' => '0',
674 'table_name' => 'civicrm_contribution_page',
675 'entity' => 'ContributionPage',
676 'bao' => 'CRM_Contribute_BAO_ContributionPage',
677 'localizable' => 0,
678 'add' => '2.1',
679 ],
680 'is_recur_installments' => [
681 'name' => 'is_recur_installments',
682 'type' => CRM_Utils_Type::T_BOOLEAN,
683 'title' => ts('Recurring Installments?'),
684 'description' => ts('if true - asks user for recurring installments'),
685 'where' => 'civicrm_contribution_page.is_recur_installments',
686 'default' => '0',
687 'table_name' => 'civicrm_contribution_page',
688 'entity' => 'ContributionPage',
689 'bao' => 'CRM_Contribute_BAO_ContributionPage',
690 'localizable' => 0,
691 'add' => '4.3',
692 ],
693 'adjust_recur_start_date' => [
694 'name' => 'adjust_recur_start_date',
695 'type' => CRM_Utils_Type::T_BOOLEAN,
696 'title' => ts('Adjust Recurring Start Date'),
697 'description' => ts('if true - user is able to adjust payment start date'),
698 'where' => 'civicrm_contribution_page.adjust_recur_start_date',
699 'default' => '0',
700 'table_name' => 'civicrm_contribution_page',
701 'entity' => 'ContributionPage',
702 'bao' => 'CRM_Contribute_BAO_ContributionPage',
703 'localizable' => 0,
704 'add' => '4.7',
705 ],
706 'is_pay_later' => [
707 'name' => 'is_pay_later',
708 'type' => CRM_Utils_Type::T_BOOLEAN,
709 'title' => ts('Pay Later'),
710 'description' => ts('if true - allows the user to send payment directly to the org later'),
711 'where' => 'civicrm_contribution_page.is_pay_later',
712 'default' => '0',
713 'table_name' => 'civicrm_contribution_page',
714 'entity' => 'ContributionPage',
715 'bao' => 'CRM_Contribute_BAO_ContributionPage',
716 'localizable' => 0,
717 'add' => '2.0',
718 ],
719 'pay_later_text' => [
720 'name' => 'pay_later_text',
721 'type' => CRM_Utils_Type::T_TEXT,
722 'title' => ts('Pay Later Text'),
723 'description' => ts('The text displayed to the user in the main form'),
724 'where' => 'civicrm_contribution_page.pay_later_text',
725 'table_name' => 'civicrm_contribution_page',
726 'entity' => 'ContributionPage',
727 'bao' => 'CRM_Contribute_BAO_ContributionPage',
728 'localizable' => 1,
729 'add' => '2.0',
730 ],
731 'pay_later_receipt' => [
732 'name' => 'pay_later_receipt',
733 'type' => CRM_Utils_Type::T_TEXT,
734 'title' => ts('Pay Later Receipt'),
735 'description' => ts('The receipt sent to the user instead of the normal receipt text'),
736 'where' => 'civicrm_contribution_page.pay_later_receipt',
737 'table_name' => 'civicrm_contribution_page',
738 'entity' => 'ContributionPage',
739 'bao' => 'CRM_Contribute_BAO_ContributionPage',
740 'localizable' => 1,
741 'add' => '2.0',
742 ],
743 'is_partial_payment' => [
744 'name' => 'is_partial_payment',
745 'type' => CRM_Utils_Type::T_BOOLEAN,
746 'title' => ts('Allow Partial Payment'),
747 'description' => ts('is partial payment enabled for this online contribution page'),
748 'where' => 'civicrm_contribution_page.is_partial_payment',
749 'default' => '0',
750 'table_name' => 'civicrm_contribution_page',
751 'entity' => 'ContributionPage',
752 'bao' => 'CRM_Contribute_BAO_ContributionPage',
753 'localizable' => 0,
754 'add' => '4.3',
755 ],
756 'initial_amount_label' => [
757 'name' => 'initial_amount_label',
758 'type' => CRM_Utils_Type::T_STRING,
759 'title' => ts('Initial Amount Label'),
760 'description' => ts('Initial amount label for partial payment'),
761 'maxlength' => 255,
762 'size' => CRM_Utils_Type::HUGE,
763 'where' => 'civicrm_contribution_page.initial_amount_label',
764 'table_name' => 'civicrm_contribution_page',
765 'entity' => 'ContributionPage',
766 'bao' => 'CRM_Contribute_BAO_ContributionPage',
767 'localizable' => 1,
768 'html' => [
769 'label' => ts("Initial Amount Label"),
770 ],
771 'add' => '4.3',
772 ],
773 'initial_amount_help_text' => [
774 'name' => 'initial_amount_help_text',
775 'type' => CRM_Utils_Type::T_TEXT,
776 'title' => ts('Initial Amount Help Text'),
777 'description' => ts('Initial amount help text for partial payment'),
778 'where' => 'civicrm_contribution_page.initial_amount_help_text',
779 'table_name' => 'civicrm_contribution_page',
780 'entity' => 'ContributionPage',
781 'bao' => 'CRM_Contribute_BAO_ContributionPage',
782 'localizable' => 1,
783 'html' => [
784 'label' => ts("Initial Amount Help Text"),
785 ],
786 'add' => '4.3',
787 ],
788 'min_initial_amount' => [
789 'name' => 'min_initial_amount',
790 'type' => CRM_Utils_Type::T_MONEY,
791 'title' => ts('Min Initial Amount'),
792 'description' => ts('Minimum initial amount for partial payment'),
793 'precision' => [
794 20,
795 2,
796 ],
797 'where' => 'civicrm_contribution_page.min_initial_amount',
798 'table_name' => 'civicrm_contribution_page',
799 'entity' => 'ContributionPage',
800 'bao' => 'CRM_Contribute_BAO_ContributionPage',
801 'localizable' => 0,
802 'html' => [
803 'label' => ts("Min. Initial Amount"),
804 ],
805 'add' => '4.3',
806 ],
807 'is_allow_other_amount' => [
808 'name' => 'is_allow_other_amount',
809 'type' => CRM_Utils_Type::T_BOOLEAN,
810 'title' => ts('Allow Other Amounts'),
811 'description' => ts('if true, page will include an input text field where user can enter their own amount'),
812 'where' => 'civicrm_contribution_page.is_allow_other_amount',
813 'default' => '0',
814 'table_name' => 'civicrm_contribution_page',
815 'entity' => 'ContributionPage',
816 'bao' => 'CRM_Contribute_BAO_ContributionPage',
817 'localizable' => 0,
818 'add' => '1.3',
819 ],
820 'default_amount_id' => [
821 'name' => 'default_amount_id',
822 'type' => CRM_Utils_Type::T_INT,
823 'title' => ts('Default Amount'),
824 'description' => ts('FK to civicrm_option_value.'),
825 'where' => 'civicrm_contribution_page.default_amount_id',
826 'table_name' => 'civicrm_contribution_page',
827 'entity' => 'ContributionPage',
828 'bao' => 'CRM_Contribute_BAO_ContributionPage',
829 'localizable' => 0,
830 'add' => '1.7',
831 ],
832 'min_amount' => [
833 'name' => 'min_amount',
834 'type' => CRM_Utils_Type::T_MONEY,
835 'title' => ts('Minimum Amount'),
836 'description' => ts('if other amounts allowed, user can configure minimum allowed.'),
837 'precision' => [
838 20,
839 2,
840 ],
841 'where' => 'civicrm_contribution_page.min_amount',
842 'table_name' => 'civicrm_contribution_page',
843 'entity' => 'ContributionPage',
844 'bao' => 'CRM_Contribute_BAO_ContributionPage',
845 'localizable' => 0,
846 'add' => '1.3',
847 ],
848 'max_amount' => [
849 'name' => 'max_amount',
850 'type' => CRM_Utils_Type::T_MONEY,
851 'title' => ts('Maximum Amount'),
852 'description' => ts('if other amounts allowed, user can configure maximum allowed.'),
853 'precision' => [
854 20,
855 2,
856 ],
857 'where' => 'civicrm_contribution_page.max_amount',
858 'table_name' => 'civicrm_contribution_page',
859 'entity' => 'ContributionPage',
860 'bao' => 'CRM_Contribute_BAO_ContributionPage',
861 'localizable' => 0,
862 'add' => '1.3',
863 ],
864 'goal_amount' => [
865 'name' => 'goal_amount',
866 'type' => CRM_Utils_Type::T_MONEY,
867 'title' => ts('Goal Amount'),
868 'description' => ts('The target goal for this page, allows people to build a goal meter'),
869 'precision' => [
870 20,
871 2,
872 ],
873 'where' => 'civicrm_contribution_page.goal_amount',
874 'table_name' => 'civicrm_contribution_page',
875 'entity' => 'ContributionPage',
876 'bao' => 'CRM_Contribute_BAO_ContributionPage',
877 'localizable' => 0,
878 'html' => [
879 'label' => ts("Goal Amount"),
880 ],
881 'add' => '1.5',
882 ],
883 'thankyou_title' => [
884 'name' => 'thankyou_title',
885 'type' => CRM_Utils_Type::T_STRING,
886 'title' => ts('Thank-you Title'),
887 'description' => ts('Title for Thank-you page (header title tag, and display at the top of the page).'),
888 'maxlength' => 255,
889 'size' => CRM_Utils_Type::HUGE,
890 'where' => 'civicrm_contribution_page.thankyou_title',
891 'table_name' => 'civicrm_contribution_page',
892 'entity' => 'ContributionPage',
893 'bao' => 'CRM_Contribute_BAO_ContributionPage',
894 'localizable' => 1,
895 'add' => '1.3',
896 ],
897 'thankyou_text' => [
898 'name' => 'thankyou_text',
899 'type' => CRM_Utils_Type::T_TEXT,
900 'title' => ts('Thank-you Text'),
901 'description' => ts('text and html allowed. displayed above result on success page'),
902 'rows' => 8,
903 'cols' => 60,
904 'where' => 'civicrm_contribution_page.thankyou_text',
905 'table_name' => 'civicrm_contribution_page',
906 'entity' => 'ContributionPage',
907 'bao' => 'CRM_Contribute_BAO_ContributionPage',
908 'localizable' => 1,
909 'html' => [
910 'type' => 'RichTextEditor',
911 ],
912 'add' => '1.3',
913 ],
914 'thankyou_footer' => [
915 'name' => 'thankyou_footer',
916 'type' => CRM_Utils_Type::T_TEXT,
917 'title' => ts('Thank-you Footer'),
918 'description' => ts('Text and html allowed. displayed at the bottom of the success page. Common usage is to include link(s) to other pages such as tell-a-friend, etc.'),
919 'rows' => 8,
920 'cols' => 60,
921 'where' => 'civicrm_contribution_page.thankyou_footer',
922 'table_name' => 'civicrm_contribution_page',
923 'entity' => 'ContributionPage',
924 'bao' => 'CRM_Contribute_BAO_ContributionPage',
925 'localizable' => 1,
926 'html' => [
927 'type' => 'RichTextEditor',
928 ],
929 'add' => '1.3',
930 ],
931 'is_email_receipt' => [
932 'name' => 'is_email_receipt',
933 'type' => CRM_Utils_Type::T_BOOLEAN,
934 'title' => ts('Send email Receipt'),
935 'description' => ts('if true, receipt is automatically emailed to contact on success'),
936 'where' => 'civicrm_contribution_page.is_email_receipt',
937 'default' => '0',
938 'table_name' => 'civicrm_contribution_page',
939 'entity' => 'ContributionPage',
940 'bao' => 'CRM_Contribute_BAO_ContributionPage',
941 'localizable' => 0,
942 'add' => '1.3',
943 ],
944 'receipt_from_name' => [
945 'name' => 'receipt_from_name',
946 'type' => CRM_Utils_Type::T_STRING,
947 'title' => ts('Receipt From'),
948 'description' => ts('FROM email name used for receipts generated by contributions to this contribution page.'),
949 'maxlength' => 255,
950 'size' => CRM_Utils_Type::HUGE,
951 'where' => 'civicrm_contribution_page.receipt_from_name',
952 'table_name' => 'civicrm_contribution_page',
953 'entity' => 'ContributionPage',
954 'bao' => 'CRM_Contribute_BAO_ContributionPage',
955 'localizable' => 1,
956 'add' => '1.3',
957 ],
958 'receipt_from_email' => [
959 'name' => 'receipt_from_email',
960 'type' => CRM_Utils_Type::T_STRING,
961 'title' => ts('Receipt From email'),
962 'description' => ts('FROM email address used for receipts generated by contributions to this contribution page.'),
963 'maxlength' => 255,
964 'size' => CRM_Utils_Type::HUGE,
965 'where' => 'civicrm_contribution_page.receipt_from_email',
966 'table_name' => 'civicrm_contribution_page',
967 'entity' => 'ContributionPage',
968 'bao' => 'CRM_Contribute_BAO_ContributionPage',
969 'localizable' => 0,
970 'add' => '1.3',
971 ],
972 'cc_receipt' => [
973 'name' => 'cc_receipt',
974 'type' => CRM_Utils_Type::T_STRING,
975 'title' => ts('Receipt cc'),
976 'description' => ts('comma-separated list of email addresses to cc each time a receipt is sent'),
977 'maxlength' => 255,
978 'size' => CRM_Utils_Type::HUGE,
979 'where' => 'civicrm_contribution_page.cc_receipt',
980 'table_name' => 'civicrm_contribution_page',
981 'entity' => 'ContributionPage',
982 'bao' => 'CRM_Contribute_BAO_ContributionPage',
983 'localizable' => 0,
984 'add' => '1.3',
985 ],
986 'bcc_receipt' => [
987 'name' => 'bcc_receipt',
988 'type' => CRM_Utils_Type::T_STRING,
989 'title' => ts('Receipt bcc'),
990 'description' => ts('comma-separated list of email addresses to bcc each time a receipt is sent'),
991 'maxlength' => 255,
992 'size' => CRM_Utils_Type::HUGE,
993 'where' => 'civicrm_contribution_page.bcc_receipt',
994 'table_name' => 'civicrm_contribution_page',
995 'entity' => 'ContributionPage',
996 'bao' => 'CRM_Contribute_BAO_ContributionPage',
997 'localizable' => 0,
998 'add' => '1.3',
999 ],
1000 'receipt_text' => [
1001 'name' => 'receipt_text',
1002 'type' => CRM_Utils_Type::T_TEXT,
1003 'title' => ts('Receipt Text'),
1004 'description' => ts('text to include above standard receipt info on receipt email. emails are text-only, so do not allow html for now'),
1005 'rows' => 6,
1006 'cols' => 50,
1007 'where' => 'civicrm_contribution_page.receipt_text',
1008 'table_name' => 'civicrm_contribution_page',
1009 'entity' => 'ContributionPage',
1010 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1011 'localizable' => 1,
1012 'html' => [
1013 'type' => 'TextArea',
1014 ],
1015 'add' => '1.3',
1016 ],
1017 'is_active' => [
1018 'name' => 'is_active',
1019 'type' => CRM_Utils_Type::T_BOOLEAN,
1020 'title' => ts('Is Page Active?'),
1021 'description' => ts('Is this property active?'),
1022 'where' => 'civicrm_contribution_page.is_active',
1023 'table_name' => 'civicrm_contribution_page',
1024 'entity' => 'ContributionPage',
1025 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1026 'localizable' => 0,
1027 'add' => '1.3',
1028 ],
1029 'footer_text' => [
1030 'name' => 'footer_text',
1031 'type' => CRM_Utils_Type::T_TEXT,
1032 'title' => ts('Footer Text'),
1033 'description' => ts('Text and html allowed. Displayed at the bottom of the first page of the contribution wizard.'),
1034 'rows' => 6,
1035 'cols' => 50,
1036 'where' => 'civicrm_contribution_page.footer_text',
1037 'table_name' => 'civicrm_contribution_page',
1038 'entity' => 'ContributionPage',
1039 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1040 'localizable' => 1,
1041 'html' => [
1042 'type' => 'RichTextEditor',
1043 ],
1044 'add' => '1.4',
1045 ],
1046 'amount_block_is_active' => [
1047 'name' => 'amount_block_is_active',
1048 'type' => CRM_Utils_Type::T_BOOLEAN,
1049 'title' => ts('Is Amount Block Active?'),
1050 'description' => ts('Is this property active?'),
1051 'where' => 'civicrm_contribution_page.amount_block_is_active',
1052 'default' => '1',
1053 'table_name' => 'civicrm_contribution_page',
1054 'entity' => 'ContributionPage',
1055 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1056 'localizable' => 0,
1057 'add' => '1.5',
1058 ],
1059 'start_date' => [
1060 'name' => 'start_date',
1061 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1062 'title' => ts('Contribution Page Start Date'),
1063 'description' => ts('Date and time that this page starts.'),
1064 'where' => 'civicrm_contribution_page.start_date',
1065 'table_name' => 'civicrm_contribution_page',
1066 'entity' => 'ContributionPage',
1067 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1068 'localizable' => 0,
1069 'add' => '1.8',
1070 ],
1071 'end_date' => [
1072 'name' => 'end_date',
1073 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1074 'title' => ts('Contribution Page End Date'),
1075 'description' => ts('Date and time that this page ends. May be NULL if no defined end date/time'),
1076 'where' => 'civicrm_contribution_page.end_date',
1077 'table_name' => 'civicrm_contribution_page',
1078 'entity' => 'ContributionPage',
1079 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1080 'localizable' => 0,
1081 'add' => '1.8',
1082 ],
1083 'created_id' => [
1084 'name' => 'created_id',
1085 'type' => CRM_Utils_Type::T_INT,
1086 'title' => ts('Created By Contact ID'),
1087 'description' => ts('FK to civicrm_contact, who created this contribution page'),
1088 'where' => 'civicrm_contribution_page.created_id',
1089 'table_name' => 'civicrm_contribution_page',
1090 'entity' => 'ContributionPage',
1091 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1092 'localizable' => 0,
1093 'FKClassName' => 'CRM_Contact_DAO_Contact',
1094 'html' => [
1095 'label' => ts("Created By"),
1096 ],
1097 'add' => '3.0',
1098 ],
1099 'created_date' => [
1100 'name' => 'created_date',
1101 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1102 'title' => ts('Contribution Page Created Date'),
1103 'description' => ts('Date and time that contribution page was created.'),
1104 'where' => 'civicrm_contribution_page.created_date',
1105 'table_name' => 'civicrm_contribution_page',
1106 'entity' => 'ContributionPage',
1107 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1108 'localizable' => 0,
1109 'add' => '3.0',
1110 ],
1111 'currency' => [
1112 'name' => 'currency',
1113 'type' => CRM_Utils_Type::T_STRING,
1114 'title' => ts('Contribution Page Currency'),
1115 'description' => ts('3 character string, value from config setting or input via user.'),
1116 'maxlength' => 3,
1117 'size' => CRM_Utils_Type::FOUR,
1118 'where' => 'civicrm_contribution_page.currency',
1119 'headerPattern' => '/cur(rency)?/i',
1120 'dataPattern' => '/^[A-Z]{3}$/i',
1121 'default' => NULL,
1122 'table_name' => 'civicrm_contribution_page',
1123 'entity' => 'ContributionPage',
1124 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1125 'localizable' => 0,
1126 'html' => [
1127 'type' => 'Select',
1128 ],
1129 'pseudoconstant' => [
1130 'table' => 'civicrm_currency',
1131 'keyColumn' => 'name',
1132 'labelColumn' => 'full_name',
1133 'nameColumn' => 'name',
1134 'abbrColumn' => 'symbol',
1135 ],
1136 'add' => '3.3',
1137 ],
1138 'campaign_id' => [
1139 'name' => 'campaign_id',
1140 'type' => CRM_Utils_Type::T_INT,
1141 'title' => ts('Campaign ID'),
1142 'description' => ts('The campaign for which we are collecting contributions with this page.'),
1143 'where' => 'civicrm_contribution_page.campaign_id',
1144 'table_name' => 'civicrm_contribution_page',
1145 'entity' => 'ContributionPage',
1146 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1147 'localizable' => 0,
1148 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
1149 'component' => 'CiviCampaign',
1150 'html' => [
1151 'type' => 'EntityRef',
1152 'label' => ts("Campaign"),
1153 ],
1154 'pseudoconstant' => [
1155 'table' => 'civicrm_campaign',
1156 'keyColumn' => 'id',
1157 'labelColumn' => 'title',
1158 'prefetch' => 'FALSE',
1159 ],
1160 'add' => '3.4',
1161 ],
1162 'is_share' => [
1163 'name' => 'is_share',
1164 'type' => CRM_Utils_Type::T_BOOLEAN,
1165 'title' => ts('Is Contribution Page Shared?'),
1166 'description' => ts('Can people share the contribution page through social media?'),
1167 'where' => 'civicrm_contribution_page.is_share',
1168 'default' => '1',
1169 'table_name' => 'civicrm_contribution_page',
1170 'entity' => 'ContributionPage',
1171 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1172 'localizable' => 0,
1173 'add' => '4.1',
1174 ],
1175 'is_billing_required' => [
1176 'name' => 'is_billing_required',
1177 'type' => CRM_Utils_Type::T_BOOLEAN,
1178 'title' => ts('Is billing block required'),
1179 'description' => ts('if true - billing block is required for online contribution page'),
1180 'where' => 'civicrm_contribution_page.is_billing_required',
1181 'default' => '0',
1182 'table_name' => 'civicrm_contribution_page',
1183 'entity' => 'ContributionPage',
1184 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1185 'localizable' => 0,
1186 'add' => '4.6',
1187 ],
1188 'contribution_page_frontend_title' => [
1189 'name' => 'frontend_title',
1190 'type' => CRM_Utils_Type::T_STRING,
1191 'title' => ts('Public Title'),
1192 'description' => ts('Contribution Page Public title'),
1193 'maxlength' => 255,
1194 'size' => CRM_Utils_Type::HUGE,
1195 'where' => 'civicrm_contribution_page.frontend_title',
1196 'default' => NULL,
1197 'table_name' => 'civicrm_contribution_page',
1198 'entity' => 'ContributionPage',
1199 'bao' => 'CRM_Contribute_BAO_ContributionPage',
1200 'localizable' => 1,
1201 'html' => [
1202 'type' => 'Text',
1203 ],
1204 'add' => '5.20',
1205 ],
1206 ];
1207 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1208 }
1209 return Civi::$statics[__CLASS__]['fields'];
1210 }
1211
1212 /**
1213 * Return a mapping from field-name to the corresponding key (as used in fields()).
1214 *
1215 * @return array
1216 * Array(string $name => string $uniqueName).
1217 */
1218 public static function &fieldKeys() {
1219 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1220 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1221 }
1222 return Civi::$statics[__CLASS__]['fieldKeys'];
1223 }
1224
1225 /**
1226 * Returns the names of this table
1227 *
1228 * @return string
1229 */
1230 public static function getTableName() {
1231 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
1232 }
1233
1234 /**
1235 * Returns if this table needs to be logged
1236 *
1237 * @return bool
1238 */
1239 public function getLog() {
1240 return self::$_log;
1241 }
1242
1243 /**
1244 * Returns the list of fields that can be imported
1245 *
1246 * @param bool $prefix
1247 *
1248 * @return array
1249 */
1250 public static function &import($prefix = FALSE) {
1251 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_page', $prefix, []);
1252 return $r;
1253 }
1254
1255 /**
1256 * Returns the list of fields that can be exported
1257 *
1258 * @param bool $prefix
1259 *
1260 * @return array
1261 */
1262 public static function &export($prefix = FALSE) {
1263 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_page', $prefix, []);
1264 return $r;
1265 }
1266
1267 /**
1268 * Returns the list of indices
1269 *
1270 * @param bool $localize
1271 *
1272 * @return array
1273 */
1274 public static function indices($localize = TRUE) {
1275 $indices = [];
1276 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1277 }
1278
1279 }