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