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