Merge pull request #22902 from mattwire/contributionconfirm
[civicrm-core.git] / CRM / Event / DAO / Event.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Event/Event.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6a26fb9bb9dfd05cdbecc91904f4b1d4)
10 */
11
12 /**
13 * Database access object for the Event entity.
14 */
15 class CRM_Event_DAO_Event extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.7';
18 const COMPONENT = 'CiviEvent';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_event';
26
27 /**
28 * Icon associated with this entity.
29 *
30 * @var string
31 */
32 public static $_icon = 'fa-calendar';
33
34 /**
35 * Field to show when displaying a record.
36 *
37 * @var string
38 */
39 public static $_labelField = 'title';
40
41 /**
42 * Should CiviCRM log any modifications to this table in the civicrm_log table.
43 *
44 * @var bool
45 */
46 public static $_log = TRUE;
47
48 /**
49 * Paths for accessing this entity in the UI.
50 *
51 * @var string[]
52 */
53 protected static $_paths = [
54 'add' => 'civicrm/event/add?reset=1',
55 'view' => 'civicrm/event/info?reset=1&id=[id]',
56 ];
57
58 /**
59 * Event
60 *
61 * @var int|string|null
62 * (SQL type: int unsigned)
63 * Note that values will be retrieved from the database as a string.
64 */
65 public $id;
66
67 /**
68 * Event Title (e.g. Fall Fundraiser Dinner)
69 *
70 * @var string|null
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
73 */
74 public $title;
75
76 /**
77 * Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary.
78 *
79 * @var string|null
80 * (SQL type: text)
81 * Note that values will be retrieved from the database as a string.
82 */
83 public $summary;
84
85 /**
86 * Full description of event. Text and html allowed. Displayed on built-in Event Information screens.
87 *
88 * @var string|null
89 * (SQL type: text)
90 * Note that values will be retrieved from the database as a string.
91 */
92 public $description;
93
94 /**
95 * Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.
96 *
97 * @var int|string|null
98 * (SQL type: int unsigned)
99 * Note that values will be retrieved from the database as a string.
100 */
101 public $event_type_id;
102
103 /**
104 * Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.
105 *
106 * @var int|string|null
107 * (SQL type: int unsigned)
108 * Note that values will be retrieved from the database as a string.
109 */
110 public $participant_listing_id;
111
112 /**
113 * Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.
114 *
115 * @var bool|string
116 * (SQL type: tinyint)
117 * Note that values will be retrieved from the database as a string.
118 */
119 public $is_public;
120
121 /**
122 * Date and time that event starts.
123 *
124 * @var string
125 * (SQL type: timestamp)
126 * Note that values will be retrieved from the database as a string.
127 */
128 public $start_date;
129
130 /**
131 * Date and time that event ends. May be NULL if no defined end date/time
132 *
133 * @var string
134 * (SQL type: timestamp)
135 * Note that values will be retrieved from the database as a string.
136 */
137 public $end_date;
138
139 /**
140 * If true, include registration link on Event Info page.
141 *
142 * @var bool|string
143 * (SQL type: tinyint)
144 * Note that values will be retrieved from the database as a string.
145 */
146 public $is_online_registration;
147
148 /**
149 * Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.
150 *
151 * @var string|null
152 * (SQL type: varchar(255))
153 * Note that values will be retrieved from the database as a string.
154 */
155 public $registration_link_text;
156
157 /**
158 * Date and time that online registration starts.
159 *
160 * @var string
161 * (SQL type: timestamp)
162 * Note that values will be retrieved from the database as a string.
163 */
164 public $registration_start_date;
165
166 /**
167 * Date and time that online registration ends.
168 *
169 * @var string
170 * (SQL type: timestamp)
171 * Note that values will be retrieved from the database as a string.
172 */
173 public $registration_end_date;
174
175 /**
176 * Maximum number of registered participants to allow. After max is reached, a custom Event Full message is displayed. If NULL, allow unlimited number of participants.
177 *
178 * @var int|string|null
179 * (SQL type: int unsigned)
180 * Note that values will be retrieved from the database as a string.
181 */
182 public $max_participants;
183
184 /**
185 * Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed.
186 *
187 * @var string|null
188 * (SQL type: text)
189 * Note that values will be retrieved from the database as a string.
190 */
191 public $event_full_text;
192
193 /**
194 * If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.
195 *
196 * @var bool|string
197 * (SQL type: tinyint)
198 * Note that values will be retrieved from the database as a string.
199 */
200 public $is_monetary;
201
202 /**
203 * Financial type assigned to paid event registrations for this event. Required if is_monetary is true.
204 *
205 * @var int|string|null
206 * (SQL type: int unsigned)
207 * Note that values will be retrieved from the database as a string.
208 */
209 public $financial_type_id;
210
211 /**
212 * Payment Processors configured for this Event (if is_monetary is true)
213 *
214 * @var string|null
215 * (SQL type: varchar(128))
216 * Note that values will be retrieved from the database as a string.
217 */
218 public $payment_processor;
219
220 /**
221 * Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?
222 *
223 * @var bool|string
224 * (SQL type: tinyint)
225 * Note that values will be retrieved from the database as a string.
226 */
227 public $is_map;
228
229 /**
230 * Is this Event enabled or disabled/cancelled?
231 *
232 * @var bool|string
233 * (SQL type: tinyint)
234 * Note that values will be retrieved from the database as a string.
235 */
236 public $is_active;
237
238 /**
239 * @var string|null
240 * (SQL type: varchar(255))
241 * Note that values will be retrieved from the database as a string.
242 */
243 public $fee_label;
244
245 /**
246 * If true, show event location.
247 *
248 * @var bool|string
249 * (SQL type: tinyint)
250 * Note that values will be retrieved from the database as a string.
251 */
252 public $is_show_location;
253
254 /**
255 * FK to Location Block ID
256 *
257 * @var int|string|null
258 * (SQL type: int unsigned)
259 * Note that values will be retrieved from the database as a string.
260 */
261 public $loc_block_id;
262
263 /**
264 * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.
265 *
266 * @var int|string|null
267 * (SQL type: int unsigned)
268 * Note that values will be retrieved from the database as a string.
269 */
270 public $default_role_id;
271
272 /**
273 * Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.
274 *
275 * @var string|null
276 * (SQL type: text)
277 * Note that values will be retrieved from the database as a string.
278 */
279 public $intro_text;
280
281 /**
282 * Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.
283 *
284 * @var string|null
285 * (SQL type: text)
286 * Note that values will be retrieved from the database as a string.
287 */
288 public $footer_text;
289
290 /**
291 * Title for Confirmation page.
292 *
293 * @var string|null
294 * (SQL type: varchar(255))
295 * Note that values will be retrieved from the database as a string.
296 */
297 public $confirm_title;
298
299 /**
300 * Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.
301 *
302 * @var string|null
303 * (SQL type: text)
304 * Note that values will be retrieved from the database as a string.
305 */
306 public $confirm_text;
307
308 /**
309 * Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.
310 *
311 * @var string|null
312 * (SQL type: text)
313 * Note that values will be retrieved from the database as a string.
314 */
315 public $confirm_footer_text;
316
317 /**
318 * If true, confirmation is automatically emailed to contact on successful registration.
319 *
320 * @var bool|string
321 * (SQL type: tinyint)
322 * Note that values will be retrieved from the database as a string.
323 */
324 public $is_email_confirm;
325
326 /**
327 * text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now
328 *
329 * @var string|null
330 * (SQL type: text)
331 * Note that values will be retrieved from the database as a string.
332 */
333 public $confirm_email_text;
334
335 /**
336 * FROM email name used for confirmation emails.
337 *
338 * @var string|null
339 * (SQL type: varchar(255))
340 * Note that values will be retrieved from the database as a string.
341 */
342 public $confirm_from_name;
343
344 /**
345 * FROM email address used for confirmation emails.
346 *
347 * @var string|null
348 * (SQL type: varchar(255))
349 * Note that values will be retrieved from the database as a string.
350 */
351 public $confirm_from_email;
352
353 /**
354 * comma-separated list of email addresses to cc each time a confirmation is sent
355 *
356 * @var string|null
357 * (SQL type: varchar(255))
358 * Note that values will be retrieved from the database as a string.
359 */
360 public $cc_confirm;
361
362 /**
363 * comma-separated list of email addresses to bcc each time a confirmation is sent
364 *
365 * @var string|null
366 * (SQL type: varchar(255))
367 * Note that values will be retrieved from the database as a string.
368 */
369 public $bcc_confirm;
370
371 /**
372 * FK to civicrm_option_value.
373 *
374 * @var int|string|null
375 * (SQL type: int unsigned)
376 * Note that values will be retrieved from the database as a string.
377 */
378 public $default_fee_id;
379
380 /**
381 * FK to civicrm_option_value.
382 *
383 * @var int|string|null
384 * (SQL type: int unsigned)
385 * Note that values will be retrieved from the database as a string.
386 */
387 public $default_discount_fee_id;
388
389 /**
390 * Title for ThankYou page.
391 *
392 * @var string|null
393 * (SQL type: varchar(255))
394 * Note that values will be retrieved from the database as a string.
395 */
396 public $thankyou_title;
397
398 /**
399 * ThankYou Text.
400 *
401 * @var string|null
402 * (SQL type: text)
403 * Note that values will be retrieved from the database as a string.
404 */
405 public $thankyou_text;
406
407 /**
408 * Footer message.
409 *
410 * @var string|null
411 * (SQL type: text)
412 * Note that values will be retrieved from the database as a string.
413 */
414 public $thankyou_footer_text;
415
416 /**
417 * if true - allows the user to send payment directly to the org later
418 *
419 * @var bool|string
420 * (SQL type: tinyint)
421 * Note that values will be retrieved from the database as a string.
422 */
423 public $is_pay_later;
424
425 /**
426 * The text displayed to the user in the main form
427 *
428 * @var string|null
429 * (SQL type: text)
430 * Note that values will be retrieved from the database as a string.
431 */
432 public $pay_later_text;
433
434 /**
435 * The receipt sent to the user instead of the normal receipt text
436 *
437 * @var string|null
438 * (SQL type: text)
439 * Note that values will be retrieved from the database as a string.
440 */
441 public $pay_later_receipt;
442
443 /**
444 * is partial payment enabled for this event
445 *
446 * @var bool|string
447 * (SQL type: tinyint)
448 * Note that values will be retrieved from the database as a string.
449 */
450 public $is_partial_payment;
451
452 /**
453 * Initial amount label for partial payment
454 *
455 * @var string|null
456 * (SQL type: varchar(255))
457 * Note that values will be retrieved from the database as a string.
458 */
459 public $initial_amount_label;
460
461 /**
462 * Initial amount help text for partial payment
463 *
464 * @var string|null
465 * (SQL type: text)
466 * Note that values will be retrieved from the database as a string.
467 */
468 public $initial_amount_help_text;
469
470 /**
471 * Minimum initial amount for partial payment
472 *
473 * @var float|string|null
474 * (SQL type: decimal(20,2))
475 * Note that values will be retrieved from the database as a string.
476 */
477 public $min_initial_amount;
478
479 /**
480 * if true - allows the user to register multiple participants for event
481 *
482 * @var bool|string
483 * (SQL type: tinyint)
484 * Note that values will be retrieved from the database as a string.
485 */
486 public $is_multiple_registrations;
487
488 /**
489 * Maximum number of additional participants that can be registered on a single booking
490 *
491 * @var int|string|null
492 * (SQL type: int unsigned)
493 * Note that values will be retrieved from the database as a string.
494 */
495 public $max_additional_participants;
496
497 /**
498 * if true - allows the user to register multiple registrations from same email address.
499 *
500 * @var bool|string
501 * (SQL type: tinyint)
502 * Note that values will be retrieved from the database as a string.
503 */
504 public $allow_same_participant_emails;
505
506 /**
507 * Whether the event has waitlist support.
508 *
509 * @var bool|string
510 * (SQL type: tinyint)
511 * Note that values will be retrieved from the database as a string.
512 */
513 public $has_waitlist;
514
515 /**
516 * Whether participants require approval before they can finish registering.
517 *
518 * @var bool|string
519 * (SQL type: tinyint)
520 * Note that values will be retrieved from the database as a string.
521 */
522 public $requires_approval;
523
524 /**
525 * Expire pending but unconfirmed registrations after this many hours.
526 *
527 * @var int|string|null
528 * (SQL type: int unsigned)
529 * Note that values will be retrieved from the database as a string.
530 */
531 public $expiration_time;
532
533 /**
534 * Allow self service cancellation or transfer for event?
535 *
536 * @var bool|string
537 * (SQL type: tinyint)
538 * Note that values will be retrieved from the database as a string.
539 */
540 public $allow_selfcancelxfer;
541
542 /**
543 * Number of hours prior to event start date to allow self-service cancellation or transfer.
544 *
545 * @var int|string|null
546 * (SQL type: int)
547 * Note that values will be retrieved from the database as a string.
548 */
549 public $selfcancelxfer_time;
550
551 /**
552 * Text to display when the event is full, but participants can signup for a waitlist.
553 *
554 * @var string|null
555 * (SQL type: text)
556 * Note that values will be retrieved from the database as a string.
557 */
558 public $waitlist_text;
559
560 /**
561 * Text to display when the approval is required to complete registration for an event.
562 *
563 * @var string|null
564 * (SQL type: text)
565 * Note that values will be retrieved from the database as a string.
566 */
567 public $approval_req_text;
568
569 /**
570 * whether the event has template
571 *
572 * @var bool|string
573 * (SQL type: tinyint)
574 * Note that values will be retrieved from the database as a string.
575 */
576 public $is_template;
577
578 /**
579 * Event Template Title
580 *
581 * @var string|null
582 * (SQL type: varchar(255))
583 * Note that values will be retrieved from the database as a string.
584 */
585 public $template_title;
586
587 /**
588 * FK to civicrm_contact, who created this event
589 *
590 * @var int|string|null
591 * (SQL type: int unsigned)
592 * Note that values will be retrieved from the database as a string.
593 */
594 public $created_id;
595
596 /**
597 * Date and time that event was created.
598 *
599 * @var string|null
600 * (SQL type: datetime)
601 * Note that values will be retrieved from the database as a string.
602 */
603 public $created_date;
604
605 /**
606 * 3 character string, value from config setting or input via user.
607 *
608 * @var string|null
609 * (SQL type: varchar(3))
610 * Note that values will be retrieved from the database as a string.
611 */
612 public $currency;
613
614 /**
615 * The campaign for which this event has been created.
616 *
617 * @var int|string|null
618 * (SQL type: int unsigned)
619 * Note that values will be retrieved from the database as a string.
620 */
621 public $campaign_id;
622
623 /**
624 * Can people share the event through social media?
625 *
626 * @var bool|string
627 * (SQL type: tinyint)
628 * Note that values will be retrieved from the database as a string.
629 */
630 public $is_share;
631
632 /**
633 * If false, the event booking confirmation screen gets skipped
634 *
635 * @var bool|string
636 * (SQL type: tinyint)
637 * Note that values will be retrieved from the database as a string.
638 */
639 public $is_confirm_enabled;
640
641 /**
642 * Implicit FK to civicrm_event: parent event
643 *
644 * @var int|string|null
645 * (SQL type: int unsigned)
646 * Note that values will be retrieved from the database as a string.
647 */
648 public $parent_event_id;
649
650 /**
651 * Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot.
652 *
653 * @var int|string|null
654 * (SQL type: int unsigned)
655 * Note that values will be retrieved from the database as a string.
656 */
657 public $slot_label_id;
658
659 /**
660 * Rule to use when matching registrations for this event
661 *
662 * @var int|string|null
663 * (SQL type: int unsigned)
664 * Note that values will be retrieved from the database as a string.
665 */
666 public $dedupe_rule_group_id;
667
668 /**
669 * if true than billing block is required this event
670 *
671 * @var bool|string
672 * (SQL type: tinyint)
673 * Note that values will be retrieved from the database as a string.
674 */
675 public $is_billing_required;
676
677 /**
678 * Event's native time zone
679 *
680 * @var string|null
681 * (SQL type: text)
682 * Note that values will be retrieved from the database as a string.
683 */
684 public $event_tz;
685
686 /**
687 * Class constructor.
688 */
689 public function __construct() {
690 $this->__table = 'civicrm_event';
691 parent::__construct();
692 }
693
694 /**
695 * Returns localized title of this entity.
696 *
697 * @param bool $plural
698 * Whether to return the plural version of the title.
699 */
700 public static function getEntityTitle($plural = FALSE) {
701 return $plural ? ts('Events') : ts('Event');
702 }
703
704 /**
705 * Returns user-friendly description of this entity.
706 *
707 * @return string
708 */
709 public static function getEntityDescription() {
710 return ts('Scheduled in-person or online events which contacts can register for and attend.');
711 }
712
713 /**
714 * Returns foreign keys and entity references.
715 *
716 * @return array
717 * [CRM_Core_Reference_Interface]
718 */
719 public static function getReferenceColumns() {
720 if (!isset(Civi::$statics[__CLASS__]['links'])) {
721 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
722 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'loc_block_id', 'civicrm_loc_block', 'id');
723 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
724 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
725 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
726 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
727 }
728 return Civi::$statics[__CLASS__]['links'];
729 }
730
731 /**
732 * Returns all the column names of this table
733 *
734 * @return array
735 */
736 public static function &fields() {
737 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
738 Civi::$statics[__CLASS__]['fields'] = [
739 'id' => [
740 'name' => 'id',
741 'type' => CRM_Utils_Type::T_INT,
742 'title' => ts('Event ID'),
743 'description' => ts('Event'),
744 'required' => TRUE,
745 'where' => 'civicrm_event.id',
746 'table_name' => 'civicrm_event',
747 'entity' => 'Event',
748 'bao' => 'CRM_Event_BAO_Event',
749 'localizable' => 0,
750 'html' => [
751 'type' => 'Number',
752 ],
753 'readonly' => TRUE,
754 'add' => '1.7',
755 ],
756 'event_title' => [
757 'name' => 'title',
758 'type' => CRM_Utils_Type::T_STRING,
759 'title' => ts('Event Title'),
760 'description' => ts('Event Title (e.g. Fall Fundraiser Dinner)'),
761 'maxlength' => 255,
762 'size' => CRM_Utils_Type::HUGE,
763 'import' => TRUE,
764 'where' => 'civicrm_event.title',
765 'headerPattern' => '/(event.)?title$/i',
766 'export' => TRUE,
767 'table_name' => 'civicrm_event',
768 'entity' => 'Event',
769 'bao' => 'CRM_Event_BAO_Event',
770 'localizable' => 1,
771 'html' => [
772 'type' => 'Text',
773 ],
774 'add' => '1.7',
775 ],
776 'summary' => [
777 'name' => 'summary',
778 'type' => CRM_Utils_Type::T_TEXT,
779 'title' => ts('Event Summary'),
780 'description' => ts('Brief summary of event. Text and html allowed. Displayed on Event Registration form and can be used on other CMS pages which need an event summary.'),
781 'rows' => 4,
782 'cols' => 60,
783 'where' => 'civicrm_event.summary',
784 'table_name' => 'civicrm_event',
785 'entity' => 'Event',
786 'bao' => 'CRM_Event_BAO_Event',
787 'localizable' => 1,
788 'html' => [
789 'type' => 'TextArea',
790 ],
791 'add' => '1.7',
792 ],
793 'event_description' => [
794 'name' => 'description',
795 'type' => CRM_Utils_Type::T_TEXT,
796 'title' => ts('Event Description'),
797 'description' => ts('Full description of event. Text and html allowed. Displayed on built-in Event Information screens.'),
798 'rows' => 8,
799 'cols' => 60,
800 'where' => 'civicrm_event.description',
801 'table_name' => 'civicrm_event',
802 'entity' => 'Event',
803 'bao' => 'CRM_Event_BAO_Event',
804 'localizable' => 1,
805 'html' => [
806 'type' => 'RichTextEditor',
807 ],
808 'add' => '1.7',
809 ],
810 'event_type_id' => [
811 'name' => 'event_type_id',
812 'type' => CRM_Utils_Type::T_INT,
813 'title' => ts('Event Type'),
814 'description' => ts('Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.'),
815 'where' => 'civicrm_event.event_type_id',
816 'default' => '0',
817 'table_name' => 'civicrm_event',
818 'entity' => 'Event',
819 'bao' => 'CRM_Event_BAO_Event',
820 'localizable' => 0,
821 'html' => [
822 'type' => 'Select',
823 ],
824 'pseudoconstant' => [
825 'optionGroupName' => 'event_type',
826 'optionEditPath' => 'civicrm/admin/options/event_type',
827 ],
828 'add' => '1.7',
829 ],
830 'participant_listing_id' => [
831 'name' => 'participant_listing_id',
832 'type' => CRM_Utils_Type::T_INT,
833 'title' => ts('Participant Listing'),
834 'description' => ts('Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.'),
835 'where' => 'civicrm_event.participant_listing_id',
836 'default' => NULL,
837 'table_name' => 'civicrm_event',
838 'entity' => 'Event',
839 'bao' => 'CRM_Event_BAO_Event',
840 'localizable' => 0,
841 'html' => [
842 'type' => 'Select',
843 ],
844 'pseudoconstant' => [
845 'optionGroupName' => 'participant_listing',
846 'optionEditPath' => 'civicrm/admin/options/participant_listing',
847 ],
848 'add' => '2.0',
849 ],
850 'is_public' => [
851 'name' => 'is_public',
852 'type' => CRM_Utils_Type::T_BOOLEAN,
853 'title' => ts('Is Event Public'),
854 'description' => ts('Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.'),
855 'required' => TRUE,
856 'where' => 'civicrm_event.is_public',
857 'default' => '1',
858 'table_name' => 'civicrm_event',
859 'entity' => 'Event',
860 'bao' => 'CRM_Event_BAO_Event',
861 'localizable' => 0,
862 'html' => [
863 'type' => 'CheckBox',
864 ],
865 'add' => '1.7',
866 ],
867 'event_start_date' => [
868 'name' => 'start_date',
869 'type' => CRM_Utils_Type::T_TIMESTAMP,
870 'title' => ts('Event Start Date'),
871 'description' => ts('Date and time that event starts.'),
872 'required' => FALSE,
873 'import' => TRUE,
874 'where' => 'civicrm_event.start_date',
875 'headerPattern' => '/^start|(s(tart\s)?date)$/i',
876 'export' => TRUE,
877 'default' => NULL,
878 'table_name' => 'civicrm_event',
879 'entity' => 'Event',
880 'bao' => 'CRM_Event_BAO_Event',
881 'localizable' => 0,
882 'html' => [
883 'type' => 'Select Date',
884 'formatType' => 'activityDateTime',
885 ],
886 'add' => '1.7',
887 ],
888 'event_end_date' => [
889 'name' => 'end_date',
890 'type' => CRM_Utils_Type::T_TIMESTAMP,
891 'title' => ts('Event End Date'),
892 'description' => ts('Date and time that event ends. May be NULL if no defined end date/time'),
893 'required' => FALSE,
894 'import' => TRUE,
895 'where' => 'civicrm_event.end_date',
896 'headerPattern' => '/^end|(e(nd\s)?date)$/i',
897 'export' => TRUE,
898 'default' => NULL,
899 'table_name' => 'civicrm_event',
900 'entity' => 'Event',
901 'bao' => 'CRM_Event_BAO_Event',
902 'localizable' => 0,
903 'html' => [
904 'type' => 'Select Date',
905 'formatType' => 'activityDateTime',
906 ],
907 'add' => '1.7',
908 ],
909 'is_online_registration' => [
910 'name' => 'is_online_registration',
911 'type' => CRM_Utils_Type::T_BOOLEAN,
912 'title' => ts('Is Online Registration'),
913 'description' => ts('If true, include registration link on Event Info page.'),
914 'required' => TRUE,
915 'where' => 'civicrm_event.is_online_registration',
916 'default' => '0',
917 'table_name' => 'civicrm_event',
918 'entity' => 'Event',
919 'bao' => 'CRM_Event_BAO_Event',
920 'localizable' => 0,
921 'html' => [
922 'type' => 'CheckBox',
923 ],
924 'add' => '1.7',
925 ],
926 'registration_link_text' => [
927 'name' => 'registration_link_text',
928 'type' => CRM_Utils_Type::T_STRING,
929 'title' => ts('Event Registration Link Text'),
930 'description' => ts('Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.'),
931 'maxlength' => 255,
932 'size' => CRM_Utils_Type::HUGE,
933 'where' => 'civicrm_event.registration_link_text',
934 'table_name' => 'civicrm_event',
935 'entity' => 'Event',
936 'bao' => 'CRM_Event_BAO_Event',
937 'localizable' => 1,
938 'html' => [
939 'type' => 'Text',
940 ],
941 'add' => '1.7',
942 ],
943 'registration_start_date' => [
944 'name' => 'registration_start_date',
945 'type' => CRM_Utils_Type::T_TIMESTAMP,
946 'title' => ts('Registration Start Date'),
947 'description' => ts('Date and time that online registration starts.'),
948 'required' => FALSE,
949 'where' => 'civicrm_event.registration_start_date',
950 'default' => NULL,
951 'table_name' => 'civicrm_event',
952 'entity' => 'Event',
953 'bao' => 'CRM_Event_BAO_Event',
954 'localizable' => 0,
955 'html' => [
956 'type' => 'Select Date',
957 'formatType' => 'activityDateTime',
958 'label' => ts("Registration Start Date"),
959 ],
960 'add' => '1.8',
961 ],
962 'registration_end_date' => [
963 'name' => 'registration_end_date',
964 'type' => CRM_Utils_Type::T_TIMESTAMP,
965 'title' => ts('Registration End Date'),
966 'description' => ts('Date and time that online registration ends.'),
967 'required' => FALSE,
968 'where' => 'civicrm_event.registration_end_date',
969 'default' => NULL,
970 'table_name' => 'civicrm_event',
971 'entity' => 'Event',
972 'bao' => 'CRM_Event_BAO_Event',
973 'localizable' => 0,
974 'html' => [
975 'type' => 'Select Date',
976 'formatType' => 'activityDateTime',
977 'label' => ts("Registration End Date"),
978 ],
979 'add' => '1.8',
980 ],
981 'max_participants' => [
982 'name' => 'max_participants',
983 'type' => CRM_Utils_Type::T_INT,
984 'title' => ts('Max Participants'),
985 'description' => ts('Maximum number of registered participants to allow. After max is reached, a custom Event Full message is displayed. If NULL, allow unlimited number of participants.'),
986 'where' => 'civicrm_event.max_participants',
987 'default' => NULL,
988 'table_name' => 'civicrm_event',
989 'entity' => 'Event',
990 'bao' => 'CRM_Event_BAO_Event',
991 'localizable' => 0,
992 'html' => [
993 'type' => 'Text',
994 ],
995 'add' => '1.7',
996 ],
997 'event_full_text' => [
998 'name' => 'event_full_text',
999 'type' => CRM_Utils_Type::T_TEXT,
1000 'title' => ts('Event Information'),
1001 'description' => ts('Message to display on Event Information page and INSTEAD OF Event Registration form if maximum participants are signed up. Can include email address/info about getting on a waiting list, etc. Text and html allowed.'),
1002 'rows' => 4,
1003 'cols' => 60,
1004 'where' => 'civicrm_event.event_full_text',
1005 'table_name' => 'civicrm_event',
1006 'entity' => 'Event',
1007 'bao' => 'CRM_Event_BAO_Event',
1008 'localizable' => 1,
1009 'html' => [
1010 'type' => 'TextArea',
1011 ],
1012 'add' => '1.7',
1013 ],
1014 'is_monetary' => [
1015 'name' => 'is_monetary',
1016 'type' => CRM_Utils_Type::T_BOOLEAN,
1017 'title' => ts('Is this a PAID event?'),
1018 'description' => ts('If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.'),
1019 'required' => TRUE,
1020 'where' => 'civicrm_event.is_monetary',
1021 'default' => '0',
1022 'table_name' => 'civicrm_event',
1023 'entity' => 'Event',
1024 'bao' => 'CRM_Event_BAO_Event',
1025 'localizable' => 0,
1026 'html' => [
1027 'type' => 'CheckBox',
1028 ],
1029 'add' => '1.7',
1030 ],
1031 'financial_type_id' => [
1032 'name' => 'financial_type_id',
1033 'type' => CRM_Utils_Type::T_INT,
1034 'title' => ts('Financial Type'),
1035 'description' => ts('Financial type assigned to paid event registrations for this event. Required if is_monetary is true.'),
1036 'where' => 'civicrm_event.financial_type_id',
1037 'default' => NULL,
1038 'table_name' => 'civicrm_event',
1039 'entity' => 'Event',
1040 'bao' => 'CRM_Event_BAO_Event',
1041 'localizable' => 0,
1042 'html' => [
1043 'type' => 'Select',
1044 ],
1045 'pseudoconstant' => [
1046 'table' => 'civicrm_financial_type',
1047 'keyColumn' => 'id',
1048 'labelColumn' => 'name',
1049 ],
1050 'add' => '4.3',
1051 ],
1052 'payment_processor' => [
1053 'name' => 'payment_processor',
1054 'type' => CRM_Utils_Type::T_STRING,
1055 'title' => ts('Payment Processor'),
1056 'description' => ts('Payment Processors configured for this Event (if is_monetary is true)'),
1057 'maxlength' => 128,
1058 'size' => CRM_Utils_Type::HUGE,
1059 'where' => 'civicrm_event.payment_processor',
1060 'table_name' => 'civicrm_event',
1061 'entity' => 'Event',
1062 'bao' => 'CRM_Event_BAO_Event',
1063 'localizable' => 0,
1064 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
1065 'html' => [
1066 'type' => 'Select',
1067 'label' => ts("Payment Processors"),
1068 ],
1069 'pseudoconstant' => [
1070 'table' => 'civicrm_payment_processor',
1071 'keyColumn' => 'id',
1072 'labelColumn' => 'name',
1073 ],
1074 'add' => '1.8',
1075 ],
1076 'is_map' => [
1077 'name' => 'is_map',
1078 'type' => CRM_Utils_Type::T_BOOLEAN,
1079 'title' => ts('Map Enabled'),
1080 'description' => ts('Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?'),
1081 'required' => TRUE,
1082 'where' => 'civicrm_event.is_map',
1083 'default' => '0',
1084 'table_name' => 'civicrm_event',
1085 'entity' => 'Event',
1086 'bao' => 'CRM_Event_BAO_Event',
1087 'localizable' => 0,
1088 'html' => [
1089 'type' => 'CheckBox',
1090 ],
1091 'add' => '1.7',
1092 ],
1093 'is_active' => [
1094 'name' => 'is_active',
1095 'type' => CRM_Utils_Type::T_BOOLEAN,
1096 'title' => ts('Is Active'),
1097 'description' => ts('Is this Event enabled or disabled/cancelled?'),
1098 'required' => TRUE,
1099 'where' => 'civicrm_event.is_active',
1100 'default' => '0',
1101 'table_name' => 'civicrm_event',
1102 'entity' => 'Event',
1103 'bao' => 'CRM_Event_BAO_Event',
1104 'localizable' => 0,
1105 'html' => [
1106 'type' => 'CheckBox',
1107 ],
1108 'add' => '1.7',
1109 ],
1110 'fee_label' => [
1111 'name' => 'fee_label',
1112 'type' => CRM_Utils_Type::T_STRING,
1113 'title' => ts('Fee Label'),
1114 'maxlength' => 255,
1115 'size' => CRM_Utils_Type::HUGE,
1116 'import' => TRUE,
1117 'where' => 'civicrm_event.fee_label',
1118 'headerPattern' => '/^fee|(f(ee\s)?label)$/i',
1119 'export' => TRUE,
1120 'table_name' => 'civicrm_event',
1121 'entity' => 'Event',
1122 'bao' => 'CRM_Event_BAO_Event',
1123 'localizable' => 1,
1124 'html' => [
1125 'type' => 'Text',
1126 ],
1127 'add' => '1.8',
1128 ],
1129 'is_show_location' => [
1130 'name' => 'is_show_location',
1131 'type' => CRM_Utils_Type::T_BOOLEAN,
1132 'title' => ts('show location'),
1133 'description' => ts('If true, show event location.'),
1134 'required' => TRUE,
1135 'where' => 'civicrm_event.is_show_location',
1136 'default' => '1',
1137 'table_name' => 'civicrm_event',
1138 'entity' => 'Event',
1139 'bao' => 'CRM_Event_BAO_Event',
1140 'localizable' => 0,
1141 'html' => [
1142 'type' => 'CheckBox',
1143 ],
1144 'add' => '1.7',
1145 ],
1146 'loc_block_id' => [
1147 'name' => 'loc_block_id',
1148 'type' => CRM_Utils_Type::T_INT,
1149 'title' => ts('Location Block ID'),
1150 'description' => ts('FK to Location Block ID'),
1151 'where' => 'civicrm_event.loc_block_id',
1152 'table_name' => 'civicrm_event',
1153 'entity' => 'Event',
1154 'bao' => 'CRM_Event_BAO_Event',
1155 'localizable' => 0,
1156 'FKClassName' => 'CRM_Core_DAO_LocBlock',
1157 'html' => [
1158 'label' => ts("Location Block"),
1159 ],
1160 'add' => '2.0',
1161 ],
1162 'default_role_id' => [
1163 'name' => 'default_role_id',
1164 'type' => CRM_Utils_Type::T_INT,
1165 'title' => ts('Default Role'),
1166 'description' => ts('Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.'),
1167 'import' => TRUE,
1168 'where' => 'civicrm_event.default_role_id',
1169 'export' => TRUE,
1170 'default' => '1',
1171 'table_name' => 'civicrm_event',
1172 'entity' => 'Event',
1173 'bao' => 'CRM_Event_BAO_Event',
1174 'localizable' => 0,
1175 'html' => [
1176 'type' => 'Select',
1177 ],
1178 'pseudoconstant' => [
1179 'optionGroupName' => 'participant_role',
1180 'optionEditPath' => 'civicrm/admin/options/participant_role',
1181 ],
1182 'add' => '2.0',
1183 ],
1184 'intro_text' => [
1185 'name' => 'intro_text',
1186 'type' => CRM_Utils_Type::T_TEXT,
1187 'title' => ts('Introductory Message'),
1188 'description' => ts('Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'),
1189 'rows' => 6,
1190 'cols' => 50,
1191 'where' => 'civicrm_event.intro_text',
1192 'table_name' => 'civicrm_event',
1193 'entity' => 'Event',
1194 'bao' => 'CRM_Event_BAO_Event',
1195 'localizable' => 1,
1196 'html' => [
1197 'type' => 'RichTextEditor',
1198 ],
1199 'add' => '1.7',
1200 ],
1201 'footer_text' => [
1202 'name' => 'footer_text',
1203 'type' => CRM_Utils_Type::T_TEXT,
1204 'title' => ts('Footer Message'),
1205 'description' => ts('Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'),
1206 'rows' => 6,
1207 'cols' => 50,
1208 'where' => 'civicrm_event.footer_text',
1209 'table_name' => 'civicrm_event',
1210 'entity' => 'Event',
1211 'bao' => 'CRM_Event_BAO_Event',
1212 'localizable' => 1,
1213 'html' => [
1214 'type' => 'RichTextEditor',
1215 ],
1216 'add' => '1.7',
1217 ],
1218 'confirm_title' => [
1219 'name' => 'confirm_title',
1220 'type' => CRM_Utils_Type::T_STRING,
1221 'title' => ts('Confirmation Title'),
1222 'description' => ts('Title for Confirmation page.'),
1223 'maxlength' => 255,
1224 'size' => CRM_Utils_Type::HUGE,
1225 'where' => 'civicrm_event.confirm_title',
1226 'default' => NULL,
1227 'table_name' => 'civicrm_event',
1228 'entity' => 'Event',
1229 'bao' => 'CRM_Event_BAO_Event',
1230 'localizable' => 1,
1231 'html' => [
1232 'type' => 'Text',
1233 ],
1234 'add' => '1.7',
1235 ],
1236 'confirm_text' => [
1237 'name' => 'confirm_text',
1238 'type' => CRM_Utils_Type::T_TEXT,
1239 'title' => ts('Confirm Text'),
1240 'description' => ts('Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'),
1241 'rows' => 6,
1242 'cols' => 50,
1243 'where' => 'civicrm_event.confirm_text',
1244 'table_name' => 'civicrm_event',
1245 'entity' => 'Event',
1246 'bao' => 'CRM_Event_BAO_Event',
1247 'localizable' => 1,
1248 'html' => [
1249 'type' => 'RichTextEditor',
1250 ],
1251 'add' => '1.7',
1252 ],
1253 'confirm_footer_text' => [
1254 'name' => 'confirm_footer_text',
1255 'type' => CRM_Utils_Type::T_TEXT,
1256 'title' => ts('Footer Text'),
1257 'description' => ts('Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'),
1258 'rows' => 6,
1259 'cols' => 50,
1260 'where' => 'civicrm_event.confirm_footer_text',
1261 'table_name' => 'civicrm_event',
1262 'entity' => 'Event',
1263 'bao' => 'CRM_Event_BAO_Event',
1264 'localizable' => 1,
1265 'html' => [
1266 'type' => 'RichTextEditor',
1267 ],
1268 'add' => '1.7',
1269 ],
1270 'is_email_confirm' => [
1271 'name' => 'is_email_confirm',
1272 'type' => CRM_Utils_Type::T_BOOLEAN,
1273 'title' => ts('Is confirm email'),
1274 'description' => ts('If true, confirmation is automatically emailed to contact on successful registration.'),
1275 'required' => TRUE,
1276 'where' => 'civicrm_event.is_email_confirm',
1277 'default' => '0',
1278 'table_name' => 'civicrm_event',
1279 'entity' => 'Event',
1280 'bao' => 'CRM_Event_BAO_Event',
1281 'localizable' => 0,
1282 'html' => [
1283 'type' => 'CheckBox',
1284 ],
1285 'add' => '1.7',
1286 ],
1287 'confirm_email_text' => [
1288 'name' => 'confirm_email_text',
1289 'type' => CRM_Utils_Type::T_TEXT,
1290 'title' => ts('Confirmation Email Text'),
1291 'description' => ts('text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now'),
1292 'rows' => 4,
1293 'cols' => 50,
1294 'where' => 'civicrm_event.confirm_email_text',
1295 'table_name' => 'civicrm_event',
1296 'entity' => 'Event',
1297 'bao' => 'CRM_Event_BAO_Event',
1298 'localizable' => 1,
1299 'html' => [
1300 'type' => 'TextArea',
1301 ],
1302 'add' => '1.7',
1303 ],
1304 'confirm_from_name' => [
1305 'name' => 'confirm_from_name',
1306 'type' => CRM_Utils_Type::T_STRING,
1307 'title' => ts('Confirm From Name'),
1308 'description' => ts('FROM email name used for confirmation emails.'),
1309 'maxlength' => 255,
1310 'size' => CRM_Utils_Type::HUGE,
1311 'where' => 'civicrm_event.confirm_from_name',
1312 'table_name' => 'civicrm_event',
1313 'entity' => 'Event',
1314 'bao' => 'CRM_Event_BAO_Event',
1315 'localizable' => 1,
1316 'html' => [
1317 'type' => 'Text',
1318 ],
1319 'add' => '1.7',
1320 ],
1321 'confirm_from_email' => [
1322 'name' => 'confirm_from_email',
1323 'type' => CRM_Utils_Type::T_STRING,
1324 'title' => ts('Confirm From Email'),
1325 'description' => ts('FROM email address used for confirmation emails.'),
1326 'maxlength' => 255,
1327 'size' => CRM_Utils_Type::HUGE,
1328 'where' => 'civicrm_event.confirm_from_email',
1329 'table_name' => 'civicrm_event',
1330 'entity' => 'Event',
1331 'bao' => 'CRM_Event_BAO_Event',
1332 'localizable' => 0,
1333 'html' => [
1334 'type' => 'Text',
1335 ],
1336 'add' => '1.7',
1337 ],
1338 'cc_confirm' => [
1339 'name' => 'cc_confirm',
1340 'type' => CRM_Utils_Type::T_STRING,
1341 'title' => ts('Cc Confirm'),
1342 'description' => ts('comma-separated list of email addresses to cc each time a confirmation is sent'),
1343 'maxlength' => 255,
1344 'size' => CRM_Utils_Type::HUGE,
1345 'where' => 'civicrm_event.cc_confirm',
1346 'table_name' => 'civicrm_event',
1347 'entity' => 'Event',
1348 'bao' => 'CRM_Event_BAO_Event',
1349 'localizable' => 0,
1350 'html' => [
1351 'type' => 'Text',
1352 'label' => ts("CC Confirm"),
1353 ],
1354 'add' => '1.7',
1355 ],
1356 'bcc_confirm' => [
1357 'name' => 'bcc_confirm',
1358 'type' => CRM_Utils_Type::T_STRING,
1359 'title' => ts('Bcc Confirm'),
1360 'description' => ts('comma-separated list of email addresses to bcc each time a confirmation is sent'),
1361 'maxlength' => 255,
1362 'size' => CRM_Utils_Type::HUGE,
1363 'where' => 'civicrm_event.bcc_confirm',
1364 'table_name' => 'civicrm_event',
1365 'entity' => 'Event',
1366 'bao' => 'CRM_Event_BAO_Event',
1367 'localizable' => 0,
1368 'html' => [
1369 'type' => 'Text',
1370 'label' => ts("BCC Confirm"),
1371 ],
1372 'add' => '1.7',
1373 ],
1374 'default_fee_id' => [
1375 'name' => 'default_fee_id',
1376 'type' => CRM_Utils_Type::T_INT,
1377 'title' => ts('Default Fee ID'),
1378 'description' => ts('FK to civicrm_option_value.'),
1379 'where' => 'civicrm_event.default_fee_id',
1380 'table_name' => 'civicrm_event',
1381 'entity' => 'Event',
1382 'bao' => 'CRM_Event_BAO_Event',
1383 'localizable' => 0,
1384 'add' => '1.7',
1385 ],
1386 'default_discount_fee_id' => [
1387 'name' => 'default_discount_fee_id',
1388 'type' => CRM_Utils_Type::T_INT,
1389 'title' => ts('Default Discount Fee ID'),
1390 'description' => ts('FK to civicrm_option_value.'),
1391 'where' => 'civicrm_event.default_discount_fee_id',
1392 'table_name' => 'civicrm_event',
1393 'entity' => 'Event',
1394 'bao' => 'CRM_Event_BAO_Event',
1395 'localizable' => 0,
1396 'add' => '1.7',
1397 ],
1398 'thankyou_title' => [
1399 'name' => 'thankyou_title',
1400 'type' => CRM_Utils_Type::T_STRING,
1401 'title' => ts('ThankYou Title'),
1402 'description' => ts('Title for ThankYou page.'),
1403 'maxlength' => 255,
1404 'size' => CRM_Utils_Type::HUGE,
1405 'where' => 'civicrm_event.thankyou_title',
1406 'default' => NULL,
1407 'table_name' => 'civicrm_event',
1408 'entity' => 'Event',
1409 'bao' => 'CRM_Event_BAO_Event',
1410 'localizable' => 1,
1411 'html' => [
1412 'type' => 'Text',
1413 ],
1414 'add' => '1.7',
1415 ],
1416 'thankyou_text' => [
1417 'name' => 'thankyou_text',
1418 'type' => CRM_Utils_Type::T_TEXT,
1419 'title' => ts('ThankYou Text'),
1420 'description' => ts('ThankYou Text.'),
1421 'rows' => 6,
1422 'cols' => 50,
1423 'where' => 'civicrm_event.thankyou_text',
1424 'table_name' => 'civicrm_event',
1425 'entity' => 'Event',
1426 'bao' => 'CRM_Event_BAO_Event',
1427 'localizable' => 1,
1428 'html' => [
1429 'type' => 'RichTextEditor',
1430 ],
1431 'add' => '1.7',
1432 ],
1433 'thankyou_footer_text' => [
1434 'name' => 'thankyou_footer_text',
1435 'type' => CRM_Utils_Type::T_TEXT,
1436 'title' => ts('Footer Text'),
1437 'description' => ts('Footer message.'),
1438 'rows' => 6,
1439 'cols' => 50,
1440 'where' => 'civicrm_event.thankyou_footer_text',
1441 'table_name' => 'civicrm_event',
1442 'entity' => 'Event',
1443 'bao' => 'CRM_Event_BAO_Event',
1444 'localizable' => 1,
1445 'html' => [
1446 'type' => 'RichTextEditor',
1447 ],
1448 'add' => '1.7',
1449 ],
1450 'is_pay_later' => [
1451 'name' => 'is_pay_later',
1452 'type' => CRM_Utils_Type::T_BOOLEAN,
1453 'title' => ts('Pay Later Allowed'),
1454 'description' => ts('if true - allows the user to send payment directly to the org later'),
1455 'required' => TRUE,
1456 'where' => 'civicrm_event.is_pay_later',
1457 'default' => '0',
1458 'table_name' => 'civicrm_event',
1459 'entity' => 'Event',
1460 'bao' => 'CRM_Event_BAO_Event',
1461 'localizable' => 0,
1462 'html' => [
1463 'type' => 'CheckBox',
1464 ],
1465 'add' => '2.0',
1466 ],
1467 'pay_later_text' => [
1468 'name' => 'pay_later_text',
1469 'type' => CRM_Utils_Type::T_TEXT,
1470 'title' => ts('Pay Later Text'),
1471 'description' => ts('The text displayed to the user in the main form'),
1472 'where' => 'civicrm_event.pay_later_text',
1473 'table_name' => 'civicrm_event',
1474 'entity' => 'Event',
1475 'bao' => 'CRM_Event_BAO_Event',
1476 'localizable' => 1,
1477 'html' => [
1478 'type' => 'RichTextEditor',
1479 ],
1480 'add' => '2.0',
1481 ],
1482 'pay_later_receipt' => [
1483 'name' => 'pay_later_receipt',
1484 'type' => CRM_Utils_Type::T_TEXT,
1485 'title' => ts('Pay Later Receipt Text'),
1486 'description' => ts('The receipt sent to the user instead of the normal receipt text'),
1487 'where' => 'civicrm_event.pay_later_receipt',
1488 'table_name' => 'civicrm_event',
1489 'entity' => 'Event',
1490 'bao' => 'CRM_Event_BAO_Event',
1491 'localizable' => 1,
1492 'html' => [
1493 'type' => 'Text',
1494 ],
1495 'add' => '2.0',
1496 ],
1497 'is_partial_payment' => [
1498 'name' => 'is_partial_payment',
1499 'type' => CRM_Utils_Type::T_BOOLEAN,
1500 'title' => ts('Partial Payments Enabled'),
1501 'description' => ts('is partial payment enabled for this event'),
1502 'required' => TRUE,
1503 'where' => 'civicrm_event.is_partial_payment',
1504 'default' => '0',
1505 'table_name' => 'civicrm_event',
1506 'entity' => 'Event',
1507 'bao' => 'CRM_Event_BAO_Event',
1508 'localizable' => 0,
1509 'html' => [
1510 'type' => 'CheckBox',
1511 ],
1512 'add' => '4.3',
1513 ],
1514 'initial_amount_label' => [
1515 'name' => 'initial_amount_label',
1516 'type' => CRM_Utils_Type::T_STRING,
1517 'title' => ts('Initial Amount Label'),
1518 'description' => ts('Initial amount label for partial payment'),
1519 'maxlength' => 255,
1520 'size' => CRM_Utils_Type::HUGE,
1521 'where' => 'civicrm_event.initial_amount_label',
1522 'table_name' => 'civicrm_event',
1523 'entity' => 'Event',
1524 'bao' => 'CRM_Event_BAO_Event',
1525 'localizable' => 1,
1526 'html' => [
1527 'type' => 'Text',
1528 ],
1529 'add' => '4.3',
1530 ],
1531 'initial_amount_help_text' => [
1532 'name' => 'initial_amount_help_text',
1533 'type' => CRM_Utils_Type::T_TEXT,
1534 'title' => ts('Initial Amount Help Text'),
1535 'description' => ts('Initial amount help text for partial payment'),
1536 'where' => 'civicrm_event.initial_amount_help_text',
1537 'table_name' => 'civicrm_event',
1538 'entity' => 'Event',
1539 'bao' => 'CRM_Event_BAO_Event',
1540 'localizable' => 1,
1541 'html' => [
1542 'type' => 'Text',
1543 ],
1544 'add' => '4.3',
1545 ],
1546 'min_initial_amount' => [
1547 'name' => 'min_initial_amount',
1548 'type' => CRM_Utils_Type::T_MONEY,
1549 'title' => ts('Minimum Initial Amount'),
1550 'description' => ts('Minimum initial amount for partial payment'),
1551 'precision' => [
1552 20,
1553 2,
1554 ],
1555 'where' => 'civicrm_event.min_initial_amount',
1556 'table_name' => 'civicrm_event',
1557 'entity' => 'Event',
1558 'bao' => 'CRM_Event_BAO_Event',
1559 'localizable' => 0,
1560 'html' => [
1561 'type' => 'Text',
1562 ],
1563 'add' => '4.3',
1564 ],
1565 'is_multiple_registrations' => [
1566 'name' => 'is_multiple_registrations',
1567 'type' => CRM_Utils_Type::T_BOOLEAN,
1568 'title' => ts('Allow Multiple Registrations'),
1569 'description' => ts('if true - allows the user to register multiple participants for event'),
1570 'required' => TRUE,
1571 'where' => 'civicrm_event.is_multiple_registrations',
1572 'default' => '0',
1573 'table_name' => 'civicrm_event',
1574 'entity' => 'Event',
1575 'bao' => 'CRM_Event_BAO_Event',
1576 'localizable' => 0,
1577 'html' => [
1578 'type' => 'CheckBox',
1579 ],
1580 'add' => '2.1',
1581 ],
1582 'max_additional_participants' => [
1583 'name' => 'max_additional_participants',
1584 'type' => CRM_Utils_Type::T_INT,
1585 'title' => ts('Maximum number of additional participants per registration'),
1586 'description' => ts('Maximum number of additional participants that can be registered on a single booking'),
1587 'where' => 'civicrm_event.max_additional_participants',
1588 'default' => '0',
1589 'table_name' => 'civicrm_event',
1590 'entity' => 'Event',
1591 'bao' => 'CRM_Event_BAO_Event',
1592 'localizable' => 0,
1593 'add' => '4.7',
1594 ],
1595 'allow_same_participant_emails' => [
1596 'name' => 'allow_same_participant_emails',
1597 'type' => CRM_Utils_Type::T_BOOLEAN,
1598 'title' => ts('Does Event allow multiple registrations from same email address?'),
1599 'description' => ts('if true - allows the user to register multiple registrations from same email address.'),
1600 'required' => TRUE,
1601 'where' => 'civicrm_event.allow_same_participant_emails',
1602 'default' => '0',
1603 'table_name' => 'civicrm_event',
1604 'entity' => 'Event',
1605 'bao' => 'CRM_Event_BAO_Event',
1606 'localizable' => 0,
1607 'html' => [
1608 'type' => 'CheckBox',
1609 ],
1610 'add' => '2.2',
1611 ],
1612 'has_waitlist' => [
1613 'name' => 'has_waitlist',
1614 'type' => CRM_Utils_Type::T_BOOLEAN,
1615 'title' => ts('Waitlist Enabled'),
1616 'description' => ts('Whether the event has waitlist support.'),
1617 'required' => TRUE,
1618 'where' => 'civicrm_event.has_waitlist',
1619 'default' => '0',
1620 'table_name' => 'civicrm_event',
1621 'entity' => 'Event',
1622 'bao' => 'CRM_Event_BAO_Event',
1623 'localizable' => 0,
1624 'html' => [
1625 'type' => 'CheckBox',
1626 ],
1627 'add' => '3.0',
1628 ],
1629 'requires_approval' => [
1630 'name' => 'requires_approval',
1631 'type' => CRM_Utils_Type::T_BOOLEAN,
1632 'title' => ts('Requires Approval'),
1633 'description' => ts('Whether participants require approval before they can finish registering.'),
1634 'required' => TRUE,
1635 'where' => 'civicrm_event.requires_approval',
1636 'default' => '0',
1637 'table_name' => 'civicrm_event',
1638 'entity' => 'Event',
1639 'bao' => 'CRM_Event_BAO_Event',
1640 'localizable' => 0,
1641 'html' => [
1642 'type' => 'CheckBox',
1643 'label' => ts("Requires Approval"),
1644 ],
1645 'add' => '3.0',
1646 ],
1647 'expiration_time' => [
1648 'name' => 'expiration_time',
1649 'type' => CRM_Utils_Type::T_INT,
1650 'title' => ts('Expiration Time'),
1651 'description' => ts('Expire pending but unconfirmed registrations after this many hours.'),
1652 'where' => 'civicrm_event.expiration_time',
1653 'table_name' => 'civicrm_event',
1654 'entity' => 'Event',
1655 'bao' => 'CRM_Event_BAO_Event',
1656 'localizable' => 0,
1657 'html' => [
1658 'type' => 'Text',
1659 'label' => ts("Expiration Time"),
1660 ],
1661 'add' => '3.0',
1662 ],
1663 'allow_selfcancelxfer' => [
1664 'name' => 'allow_selfcancelxfer',
1665 'type' => CRM_Utils_Type::T_BOOLEAN,
1666 'title' => ts('Allow Self-service Cancellation or Transfer'),
1667 'description' => ts('Allow self service cancellation or transfer for event?'),
1668 'required' => TRUE,
1669 'where' => 'civicrm_event.allow_selfcancelxfer',
1670 'default' => '0',
1671 'table_name' => 'civicrm_event',
1672 'entity' => 'Event',
1673 'bao' => 'CRM_Event_BAO_Event',
1674 'localizable' => 0,
1675 'html' => [
1676 'type' => 'CheckBox',
1677 ],
1678 'add' => '4.7',
1679 ],
1680 'selfcancelxfer_time' => [
1681 'name' => 'selfcancelxfer_time',
1682 'type' => CRM_Utils_Type::T_INT,
1683 'title' => ts('Self-service Cancellation or Transfer Time'),
1684 'description' => ts('Number of hours prior to event start date to allow self-service cancellation or transfer.'),
1685 'where' => 'civicrm_event.selfcancelxfer_time',
1686 'default' => '0',
1687 'table_name' => 'civicrm_event',
1688 'entity' => 'Event',
1689 'bao' => 'CRM_Event_BAO_Event',
1690 'localizable' => 0,
1691 'html' => [
1692 'type' => 'Text',
1693 ],
1694 'add' => '4.7',
1695 ],
1696 'waitlist_text' => [
1697 'name' => 'waitlist_text',
1698 'type' => CRM_Utils_Type::T_TEXT,
1699 'title' => ts('Waitlist Text'),
1700 'description' => ts('Text to display when the event is full, but participants can signup for a waitlist.'),
1701 'rows' => 4,
1702 'cols' => 60,
1703 'where' => 'civicrm_event.waitlist_text',
1704 'table_name' => 'civicrm_event',
1705 'entity' => 'Event',
1706 'bao' => 'CRM_Event_BAO_Event',
1707 'localizable' => 1,
1708 'html' => [
1709 'type' => 'TextArea',
1710 'label' => ts("Waitlist Text"),
1711 ],
1712 'add' => '3.0',
1713 ],
1714 'approval_req_text' => [
1715 'name' => 'approval_req_text',
1716 'type' => CRM_Utils_Type::T_TEXT,
1717 'title' => ts('Approval Req Text'),
1718 'description' => ts('Text to display when the approval is required to complete registration for an event.'),
1719 'rows' => 4,
1720 'cols' => 60,
1721 'where' => 'civicrm_event.approval_req_text',
1722 'table_name' => 'civicrm_event',
1723 'entity' => 'Event',
1724 'bao' => 'CRM_Event_BAO_Event',
1725 'localizable' => 1,
1726 'html' => [
1727 'type' => 'TextArea',
1728 'label' => ts("Approval Required Text"),
1729 ],
1730 'add' => '3.0',
1731 ],
1732 'is_template' => [
1733 'name' => 'is_template',
1734 'type' => CRM_Utils_Type::T_BOOLEAN,
1735 'title' => ts('Is an Event Template'),
1736 'description' => ts('whether the event has template'),
1737 'required' => TRUE,
1738 'where' => 'civicrm_event.is_template',
1739 'default' => '0',
1740 'table_name' => 'civicrm_event',
1741 'entity' => 'Event',
1742 'bao' => 'CRM_Event_BAO_Event',
1743 'localizable' => 0,
1744 'html' => [
1745 'type' => 'CheckBox',
1746 ],
1747 'add' => '3.0',
1748 ],
1749 'template_title' => [
1750 'name' => 'template_title',
1751 'type' => CRM_Utils_Type::T_STRING,
1752 'title' => ts('Event Template Title'),
1753 'description' => ts('Event Template Title'),
1754 'maxlength' => 255,
1755 'size' => CRM_Utils_Type::HUGE,
1756 'import' => TRUE,
1757 'where' => 'civicrm_event.template_title',
1758 'headerPattern' => '/(template.)?title$/i',
1759 'export' => TRUE,
1760 'table_name' => 'civicrm_event',
1761 'entity' => 'Event',
1762 'bao' => 'CRM_Event_BAO_Event',
1763 'localizable' => 1,
1764 'html' => [
1765 'type' => 'Text',
1766 ],
1767 'add' => '3.0',
1768 ],
1769 'created_id' => [
1770 'name' => 'created_id',
1771 'type' => CRM_Utils_Type::T_INT,
1772 'title' => ts('Created By Contact ID'),
1773 'description' => ts('FK to civicrm_contact, who created this event'),
1774 'where' => 'civicrm_event.created_id',
1775 'table_name' => 'civicrm_event',
1776 'entity' => 'Event',
1777 'bao' => 'CRM_Event_BAO_Event',
1778 'localizable' => 0,
1779 'FKClassName' => 'CRM_Contact_DAO_Contact',
1780 'html' => [
1781 'label' => ts("Created By"),
1782 ],
1783 'add' => '3.0',
1784 ],
1785 'created_date' => [
1786 'name' => 'created_date',
1787 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1788 'title' => ts('Event Created Date'),
1789 'description' => ts('Date and time that event was created.'),
1790 'where' => 'civicrm_event.created_date',
1791 'table_name' => 'civicrm_event',
1792 'entity' => 'Event',
1793 'bao' => 'CRM_Event_BAO_Event',
1794 'localizable' => 0,
1795 'add' => '3.0',
1796 ],
1797 'currency' => [
1798 'name' => 'currency',
1799 'type' => CRM_Utils_Type::T_STRING,
1800 'title' => ts('Currency'),
1801 'description' => ts('3 character string, value from config setting or input via user.'),
1802 'maxlength' => 3,
1803 'size' => CRM_Utils_Type::FOUR,
1804 'import' => TRUE,
1805 'where' => 'civicrm_event.currency',
1806 'headerPattern' => '/cur(rency)?/i',
1807 'dataPattern' => '/^[A-Z]{3}$/i',
1808 'export' => TRUE,
1809 'table_name' => 'civicrm_event',
1810 'entity' => 'Event',
1811 'bao' => 'CRM_Event_BAO_Event',
1812 'localizable' => 0,
1813 'html' => [
1814 'type' => 'Select',
1815 'label' => ts("Currency"),
1816 ],
1817 'pseudoconstant' => [
1818 'table' => 'civicrm_currency',
1819 'keyColumn' => 'name',
1820 'labelColumn' => 'full_name',
1821 'nameColumn' => 'name',
1822 'abbrColumn' => 'symbol',
1823 ],
1824 'add' => '3.3',
1825 ],
1826 'campaign_id' => [
1827 'name' => 'campaign_id',
1828 'type' => CRM_Utils_Type::T_INT,
1829 'title' => ts('Campaign ID'),
1830 'description' => ts('The campaign for which this event has been created.'),
1831 'where' => 'civicrm_event.campaign_id',
1832 'table_name' => 'civicrm_event',
1833 'entity' => 'Event',
1834 'bao' => 'CRM_Event_BAO_Event',
1835 'localizable' => 0,
1836 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
1837 'component' => 'CiviCampaign',
1838 'html' => [
1839 'type' => 'EntityRef',
1840 'label' => ts("Campaign"),
1841 ],
1842 'pseudoconstant' => [
1843 'table' => 'civicrm_campaign',
1844 'keyColumn' => 'id',
1845 'labelColumn' => 'title',
1846 'prefetch' => 'FALSE',
1847 ],
1848 'add' => '3.4',
1849 ],
1850 'is_share' => [
1851 'name' => 'is_share',
1852 'type' => CRM_Utils_Type::T_BOOLEAN,
1853 'title' => ts('Is shared through social media'),
1854 'description' => ts('Can people share the event through social media?'),
1855 'required' => TRUE,
1856 'where' => 'civicrm_event.is_share',
1857 'default' => '1',
1858 'table_name' => 'civicrm_event',
1859 'entity' => 'Event',
1860 'bao' => 'CRM_Event_BAO_Event',
1861 'localizable' => 0,
1862 'html' => [
1863 'type' => 'CheckBox',
1864 ],
1865 'add' => '4.1',
1866 ],
1867 'is_confirm_enabled' => [
1868 'name' => 'is_confirm_enabled',
1869 'type' => CRM_Utils_Type::T_BOOLEAN,
1870 'title' => ts('Is the booking confirmation screen enabled?'),
1871 'description' => ts('If false, the event booking confirmation screen gets skipped'),
1872 'required' => TRUE,
1873 'where' => 'civicrm_event.is_confirm_enabled',
1874 'default' => '1',
1875 'table_name' => 'civicrm_event',
1876 'entity' => 'Event',
1877 'bao' => 'CRM_Event_BAO_Event',
1878 'localizable' => 0,
1879 'html' => [
1880 'type' => 'CheckBox',
1881 ],
1882 'add' => '4.5',
1883 ],
1884 'parent_event_id' => [
1885 'name' => 'parent_event_id',
1886 'type' => CRM_Utils_Type::T_INT,
1887 'title' => ts('Parent Event ID'),
1888 'description' => ts('Implicit FK to civicrm_event: parent event'),
1889 'where' => 'civicrm_event.parent_event_id',
1890 'default' => NULL,
1891 'table_name' => 'civicrm_event',
1892 'entity' => 'Event',
1893 'bao' => 'CRM_Event_BAO_Event',
1894 'localizable' => 0,
1895 'html' => [
1896 'type' => 'EntityRef',
1897 ],
1898 'add' => '4.1',
1899 ],
1900 'slot_label_id' => [
1901 'name' => 'slot_label_id',
1902 'type' => CRM_Utils_Type::T_INT,
1903 'title' => ts('Subevent Slot Label ID'),
1904 'description' => ts('Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot.'),
1905 'where' => 'civicrm_event.slot_label_id',
1906 'default' => NULL,
1907 'table_name' => 'civicrm_event',
1908 'entity' => 'Event',
1909 'bao' => 'CRM_Event_BAO_Event',
1910 'localizable' => 0,
1911 'html' => [
1912 'type' => 'Select',
1913 ],
1914 'add' => '4.1',
1915 ],
1916 'dedupe_rule_group_id' => [
1917 'name' => 'dedupe_rule_group_id',
1918 'type' => CRM_Utils_Type::T_INT,
1919 'title' => ts('Dedupe Rule ID'),
1920 'description' => ts('Rule to use when matching registrations for this event'),
1921 'where' => 'civicrm_event.dedupe_rule_group_id',
1922 'default' => NULL,
1923 'table_name' => 'civicrm_event',
1924 'entity' => 'Event',
1925 'bao' => 'CRM_Event_BAO_Event',
1926 'localizable' => 0,
1927 'FKClassName' => 'CRM_Dedupe_DAO_DedupeRuleGroup',
1928 'html' => [
1929 'type' => 'Select',
1930 'label' => ts("Dedupe Rule"),
1931 ],
1932 'pseudoconstant' => [
1933 'table' => 'civicrm_dedupe_rule_group',
1934 'keyColumn' => 'id',
1935 'labelColumn' => 'title',
1936 'nameColumn' => 'name',
1937 ],
1938 'add' => '4.5',
1939 ],
1940 'is_billing_required' => [
1941 'name' => 'is_billing_required',
1942 'type' => CRM_Utils_Type::T_BOOLEAN,
1943 'title' => ts('Is billing block required'),
1944 'description' => ts('if true than billing block is required this event'),
1945 'required' => TRUE,
1946 'where' => 'civicrm_event.is_billing_required',
1947 'default' => '0',
1948 'table_name' => 'civicrm_event',
1949 'entity' => 'Event',
1950 'bao' => 'CRM_Event_BAO_Event',
1951 'localizable' => 0,
1952 'html' => [
1953 'type' => 'CheckBox',
1954 ],
1955 'add' => '4.6',
1956 ],
1957 'event_tz' => [
1958 'name' => 'event_tz',
1959 'type' => CRM_Utils_Type::T_TEXT,
1960 'title' => ts('Event Time Zone'),
1961 'description' => ts('Event\'s native time zone'),
1962 'import' => TRUE,
1963 'where' => 'civicrm_event.event_tz',
1964 'export' => TRUE,
1965 'default' => NULL,
1966 'table_name' => 'civicrm_event',
1967 'entity' => 'Event',
1968 'bao' => 'CRM_Event_BAO_Event',
1969 'localizable' => 0,
1970 'html' => [
1971 'type' => 'Select',
1972 ],
1973 'pseudoconstant' => [
1974 'callback' => 'CRM_Core_SelectValues::timezone',
1975 ],
1976 'add' => '5.47',
1977 ],
1978 ];
1979 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1980 }
1981 return Civi::$statics[__CLASS__]['fields'];
1982 }
1983
1984 /**
1985 * Return a mapping from field-name to the corresponding key (as used in fields()).
1986 *
1987 * @return array
1988 * Array(string $name => string $uniqueName).
1989 */
1990 public static function &fieldKeys() {
1991 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1992 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1993 }
1994 return Civi::$statics[__CLASS__]['fieldKeys'];
1995 }
1996
1997 /**
1998 * Returns the names of this table
1999 *
2000 * @return string
2001 */
2002 public static function getTableName() {
2003 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
2004 }
2005
2006 /**
2007 * Returns if this table needs to be logged
2008 *
2009 * @return bool
2010 */
2011 public function getLog() {
2012 return self::$_log;
2013 }
2014
2015 /**
2016 * Returns the list of fields that can be imported
2017 *
2018 * @param bool $prefix
2019 *
2020 * @return array
2021 */
2022 public static function &import($prefix = FALSE) {
2023 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'event', $prefix, []);
2024 return $r;
2025 }
2026
2027 /**
2028 * Returns the list of fields that can be exported
2029 *
2030 * @param bool $prefix
2031 *
2032 * @return array
2033 */
2034 public static function &export($prefix = FALSE) {
2035 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'event', $prefix, []);
2036 return $r;
2037 }
2038
2039 /**
2040 * Returns the list of indices
2041 *
2042 * @param bool $localize
2043 *
2044 * @return array
2045 */
2046 public static function indices($localize = TRUE) {
2047 $indices = [
2048 'index_event_type_id' => [
2049 'name' => 'index_event_type_id',
2050 'field' => [
2051 0 => 'event_type_id',
2052 ],
2053 'localizable' => FALSE,
2054 'sig' => 'civicrm_event::0::event_type_id',
2055 ],
2056 'index_participant_listing_id' => [
2057 'name' => 'index_participant_listing_id',
2058 'field' => [
2059 0 => 'participant_listing_id',
2060 ],
2061 'localizable' => FALSE,
2062 'sig' => 'civicrm_event::0::participant_listing_id',
2063 ],
2064 'index_parent_event_id' => [
2065 'name' => 'index_parent_event_id',
2066 'field' => [
2067 0 => 'parent_event_id',
2068 ],
2069 'localizable' => FALSE,
2070 'sig' => 'civicrm_event::0::parent_event_id',
2071 ],
2072 ];
2073 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
2074 }
2075
2076 }