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