Merge pull request #24095 from civicrm/5.52
[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:ddad900cfc0f303d651fa7b935157992)
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|null
125 * (SQL type: datetime)
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|null
134 * (SQL type: datetime)
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|null
161 * (SQL type: datetime)
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|null
170 * (SQL type: datetime)
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 * Class constructor.
679 */
680 public function __construct() {
681 $this->__table = 'civicrm_event';
682 parent::__construct();
683 }
684
685 /**
686 * Returns localized title of this entity.
687 *
688 * @param bool $plural
689 * Whether to return the plural version of the title.
690 */
691 public static function getEntityTitle($plural = FALSE) {
692 return $plural ? ts('Events') : ts('Event');
693 }
694
695 /**
696 * Returns user-friendly description of this entity.
697 *
698 * @return string
699 */
700 public static function getEntityDescription() {
701 return ts('Scheduled in-person or online events which contacts can register for and attend.');
702 }
703
704 /**
705 * Returns foreign keys and entity references.
706 *
707 * @return array
708 * [CRM_Core_Reference_Interface]
709 */
710 public static function getReferenceColumns() {
711 if (!isset(Civi::$statics[__CLASS__]['links'])) {
712 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
713 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'loc_block_id', 'civicrm_loc_block', 'id');
714 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
715 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
716 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
717 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
718 }
719 return Civi::$statics[__CLASS__]['links'];
720 }
721
722 /**
723 * Returns all the column names of this table
724 *
725 * @return array
726 */
727 public static function &fields() {
728 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
729 Civi::$statics[__CLASS__]['fields'] = [
730 'id' => [
731 'name' => 'id',
732 'type' => CRM_Utils_Type::T_INT,
733 'title' => ts('Event ID'),
734 'description' => ts('Event'),
735 'required' => TRUE,
736 'where' => 'civicrm_event.id',
737 'table_name' => 'civicrm_event',
738 'entity' => 'Event',
739 'bao' => 'CRM_Event_BAO_Event',
740 'localizable' => 0,
741 'html' => [
742 'type' => 'Number',
743 ],
744 'readonly' => TRUE,
745 'add' => '1.7',
746 ],
747 'event_title' => [
748 'name' => 'title',
749 'type' => CRM_Utils_Type::T_STRING,
750 'title' => ts('Event Title'),
751 'description' => ts('Event Title (e.g. Fall Fundraiser Dinner)'),
752 'maxlength' => 255,
753 'size' => CRM_Utils_Type::HUGE,
754 'import' => TRUE,
755 'where' => 'civicrm_event.title',
756 'headerPattern' => '/(event.)?title$/i',
757 'export' => TRUE,
758 'table_name' => 'civicrm_event',
759 'entity' => 'Event',
760 'bao' => 'CRM_Event_BAO_Event',
761 'localizable' => 1,
762 'html' => [
763 'type' => 'Text',
764 ],
765 'add' => '1.7',
766 ],
767 'summary' => [
768 'name' => 'summary',
769 'type' => CRM_Utils_Type::T_TEXT,
770 'title' => ts('Event Summary'),
771 '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.'),
772 'rows' => 4,
773 'cols' => 60,
774 'where' => 'civicrm_event.summary',
775 'table_name' => 'civicrm_event',
776 'entity' => 'Event',
777 'bao' => 'CRM_Event_BAO_Event',
778 'localizable' => 1,
779 'html' => [
780 'type' => 'TextArea',
781 ],
782 'add' => '1.7',
783 ],
784 'event_description' => [
785 'name' => 'description',
786 'type' => CRM_Utils_Type::T_TEXT,
787 'title' => ts('Event Description'),
788 'description' => ts('Full description of event. Text and html allowed. Displayed on built-in Event Information screens.'),
789 'rows' => 8,
790 'cols' => 60,
791 'where' => 'civicrm_event.description',
792 'table_name' => 'civicrm_event',
793 'entity' => 'Event',
794 'bao' => 'CRM_Event_BAO_Event',
795 'localizable' => 1,
796 'html' => [
797 'type' => 'RichTextEditor',
798 ],
799 'add' => '1.7',
800 ],
801 'event_type_id' => [
802 'name' => 'event_type_id',
803 'type' => CRM_Utils_Type::T_INT,
804 'title' => ts('Event Type'),
805 'description' => ts('Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.'),
806 'where' => 'civicrm_event.event_type_id',
807 'default' => '0',
808 'table_name' => 'civicrm_event',
809 'entity' => 'Event',
810 'bao' => 'CRM_Event_BAO_Event',
811 'localizable' => 0,
812 'html' => [
813 'type' => 'Select',
814 ],
815 'pseudoconstant' => [
816 'optionGroupName' => 'event_type',
817 'optionEditPath' => 'civicrm/admin/options/event_type',
818 ],
819 'add' => '1.7',
820 ],
821 'participant_listing_id' => [
822 'name' => 'participant_listing_id',
823 'type' => CRM_Utils_Type::T_INT,
824 'title' => ts('Participant Listing'),
825 'description' => ts('Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.'),
826 'where' => 'civicrm_event.participant_listing_id',
827 'default' => NULL,
828 'table_name' => 'civicrm_event',
829 'entity' => 'Event',
830 'bao' => 'CRM_Event_BAO_Event',
831 'localizable' => 0,
832 'html' => [
833 'type' => 'Select',
834 ],
835 'pseudoconstant' => [
836 'optionGroupName' => 'participant_listing',
837 'optionEditPath' => 'civicrm/admin/options/participant_listing',
838 ],
839 'add' => '2.0',
840 ],
841 'is_public' => [
842 'name' => 'is_public',
843 'type' => CRM_Utils_Type::T_BOOLEAN,
844 'title' => ts('Is Event Public'),
845 'description' => ts('Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.'),
846 'required' => TRUE,
847 'where' => 'civicrm_event.is_public',
848 'default' => '1',
849 'table_name' => 'civicrm_event',
850 'entity' => 'Event',
851 'bao' => 'CRM_Event_BAO_Event',
852 'localizable' => 0,
853 'html' => [
854 'type' => 'CheckBox',
855 ],
856 'add' => '1.7',
857 ],
858 'event_start_date' => [
859 'name' => 'start_date',
860 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
861 'title' => ts('Event Start Date'),
862 'description' => ts('Date and time that event starts.'),
863 'import' => TRUE,
864 'where' => 'civicrm_event.start_date',
865 'headerPattern' => '/^start|(s(tart\s)?date)$/i',
866 'export' => TRUE,
867 'table_name' => 'civicrm_event',
868 'entity' => 'Event',
869 'bao' => 'CRM_Event_BAO_Event',
870 'localizable' => 0,
871 'html' => [
872 'type' => 'Select Date',
873 'formatType' => 'activityDateTime',
874 ],
875 'add' => '1.7',
876 ],
877 'event_end_date' => [
878 'name' => 'end_date',
879 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
880 'title' => ts('Event End Date'),
881 'description' => ts('Date and time that event ends. May be NULL if no defined end date/time'),
882 'import' => TRUE,
883 'where' => 'civicrm_event.end_date',
884 'headerPattern' => '/^end|(e(nd\s)?date)$/i',
885 'export' => TRUE,
886 'table_name' => 'civicrm_event',
887 'entity' => 'Event',
888 'bao' => 'CRM_Event_BAO_Event',
889 'localizable' => 0,
890 'html' => [
891 'type' => 'Select Date',
892 'formatType' => 'activityDateTime',
893 ],
894 'add' => '1.7',
895 ],
896 'is_online_registration' => [
897 'name' => 'is_online_registration',
898 'type' => CRM_Utils_Type::T_BOOLEAN,
899 'title' => ts('Is Online Registration'),
900 'description' => ts('If true, include registration link on Event Info page.'),
901 'required' => TRUE,
902 'where' => 'civicrm_event.is_online_registration',
903 'default' => '0',
904 'table_name' => 'civicrm_event',
905 'entity' => 'Event',
906 'bao' => 'CRM_Event_BAO_Event',
907 'localizable' => 0,
908 'html' => [
909 'type' => 'CheckBox',
910 ],
911 'add' => '1.7',
912 ],
913 'registration_link_text' => [
914 'name' => 'registration_link_text',
915 'type' => CRM_Utils_Type::T_STRING,
916 'title' => ts('Event Registration Link Text'),
917 'description' => ts('Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.'),
918 'maxlength' => 255,
919 'size' => CRM_Utils_Type::HUGE,
920 'where' => 'civicrm_event.registration_link_text',
921 'table_name' => 'civicrm_event',
922 'entity' => 'Event',
923 'bao' => 'CRM_Event_BAO_Event',
924 'localizable' => 1,
925 'html' => [
926 'type' => 'Text',
927 ],
928 'add' => '1.7',
929 ],
930 'registration_start_date' => [
931 'name' => 'registration_start_date',
932 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
933 'title' => ts('Registration Start Date'),
934 'description' => ts('Date and time that online registration starts.'),
935 'where' => 'civicrm_event.registration_start_date',
936 'table_name' => 'civicrm_event',
937 'entity' => 'Event',
938 'bao' => 'CRM_Event_BAO_Event',
939 'localizable' => 0,
940 'html' => [
941 'type' => 'Select Date',
942 'formatType' => 'activityDateTime',
943 'label' => ts("Registration Start Date"),
944 ],
945 'add' => '1.8',
946 ],
947 'registration_end_date' => [
948 'name' => 'registration_end_date',
949 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
950 'title' => ts('Registration End Date'),
951 'description' => ts('Date and time that online registration ends.'),
952 'where' => 'civicrm_event.registration_end_date',
953 'table_name' => 'civicrm_event',
954 'entity' => 'Event',
955 'bao' => 'CRM_Event_BAO_Event',
956 'localizable' => 0,
957 'html' => [
958 'type' => 'Select Date',
959 'formatType' => 'activityDateTime',
960 'label' => ts("Registration End Date"),
961 ],
962 'add' => '1.8',
963 ],
964 'max_participants' => [
965 'name' => 'max_participants',
966 'type' => CRM_Utils_Type::T_INT,
967 'title' => ts('Max Participants'),
968 '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.'),
969 'where' => 'civicrm_event.max_participants',
970 'default' => NULL,
971 'table_name' => 'civicrm_event',
972 'entity' => 'Event',
973 'bao' => 'CRM_Event_BAO_Event',
974 'localizable' => 0,
975 'html' => [
976 'type' => 'Text',
977 ],
978 'add' => '1.7',
979 ],
980 'event_full_text' => [
981 'name' => 'event_full_text',
982 'type' => CRM_Utils_Type::T_TEXT,
983 'title' => ts('Event Information'),
984 '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.'),
985 'rows' => 4,
986 'cols' => 60,
987 'where' => 'civicrm_event.event_full_text',
988 'table_name' => 'civicrm_event',
989 'entity' => 'Event',
990 'bao' => 'CRM_Event_BAO_Event',
991 'localizable' => 1,
992 'html' => [
993 'type' => 'TextArea',
994 ],
995 'add' => '1.7',
996 ],
997 'is_monetary' => [
998 'name' => 'is_monetary',
999 'type' => CRM_Utils_Type::T_BOOLEAN,
1000 'title' => ts('Is this a PAID event?'),
1001 'description' => ts('If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.'),
1002 'required' => TRUE,
1003 'where' => 'civicrm_event.is_monetary',
1004 'default' => '0',
1005 'table_name' => 'civicrm_event',
1006 'entity' => 'Event',
1007 'bao' => 'CRM_Event_BAO_Event',
1008 'localizable' => 0,
1009 'html' => [
1010 'type' => 'CheckBox',
1011 ],
1012 'add' => '1.7',
1013 ],
1014 'financial_type_id' => [
1015 'name' => 'financial_type_id',
1016 'type' => CRM_Utils_Type::T_INT,
1017 'title' => ts('Financial Type'),
1018 'description' => ts('Financial type assigned to paid event registrations for this event. Required if is_monetary is true.'),
1019 'where' => 'civicrm_event.financial_type_id',
1020 'default' => NULL,
1021 'table_name' => 'civicrm_event',
1022 'entity' => 'Event',
1023 'bao' => 'CRM_Event_BAO_Event',
1024 'localizable' => 0,
1025 'html' => [
1026 'type' => 'Select',
1027 ],
1028 'pseudoconstant' => [
1029 'table' => 'civicrm_financial_type',
1030 'keyColumn' => 'id',
1031 'labelColumn' => 'name',
1032 ],
1033 'add' => '4.3',
1034 ],
1035 'payment_processor' => [
1036 'name' => 'payment_processor',
1037 'type' => CRM_Utils_Type::T_STRING,
1038 'title' => ts('Payment Processor'),
1039 'description' => ts('Payment Processors configured for this Event (if is_monetary is true)'),
1040 'maxlength' => 128,
1041 'size' => CRM_Utils_Type::HUGE,
1042 'where' => 'civicrm_event.payment_processor',
1043 'table_name' => 'civicrm_event',
1044 'entity' => 'Event',
1045 'bao' => 'CRM_Event_BAO_Event',
1046 'localizable' => 0,
1047 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
1048 'html' => [
1049 'type' => 'Select',
1050 'label' => ts("Payment Processors"),
1051 ],
1052 'pseudoconstant' => [
1053 'table' => 'civicrm_payment_processor',
1054 'keyColumn' => 'id',
1055 'labelColumn' => 'name',
1056 ],
1057 'add' => '1.8',
1058 ],
1059 'is_map' => [
1060 'name' => 'is_map',
1061 'type' => CRM_Utils_Type::T_BOOLEAN,
1062 'title' => ts('Map Enabled'),
1063 'description' => ts('Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?'),
1064 'required' => TRUE,
1065 'where' => 'civicrm_event.is_map',
1066 'default' => '0',
1067 'table_name' => 'civicrm_event',
1068 'entity' => 'Event',
1069 'bao' => 'CRM_Event_BAO_Event',
1070 'localizable' => 0,
1071 'html' => [
1072 'type' => 'CheckBox',
1073 ],
1074 'add' => '1.7',
1075 ],
1076 'is_active' => [
1077 'name' => 'is_active',
1078 'type' => CRM_Utils_Type::T_BOOLEAN,
1079 'title' => ts('Is Active'),
1080 'description' => ts('Is this Event enabled or disabled/cancelled?'),
1081 'required' => TRUE,
1082 'where' => 'civicrm_event.is_active',
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 'fee_label' => [
1094 'name' => 'fee_label',
1095 'type' => CRM_Utils_Type::T_STRING,
1096 'title' => ts('Fee Label'),
1097 'maxlength' => 255,
1098 'size' => CRM_Utils_Type::HUGE,
1099 'import' => TRUE,
1100 'where' => 'civicrm_event.fee_label',
1101 'headerPattern' => '/^fee|(f(ee\s)?label)$/i',
1102 'export' => TRUE,
1103 'table_name' => 'civicrm_event',
1104 'entity' => 'Event',
1105 'bao' => 'CRM_Event_BAO_Event',
1106 'localizable' => 1,
1107 'html' => [
1108 'type' => 'Text',
1109 ],
1110 'add' => '1.8',
1111 ],
1112 'is_show_location' => [
1113 'name' => 'is_show_location',
1114 'type' => CRM_Utils_Type::T_BOOLEAN,
1115 'title' => ts('Show Location'),
1116 'description' => ts('If true, show event location.'),
1117 'required' => TRUE,
1118 'where' => 'civicrm_event.is_show_location',
1119 'default' => '1',
1120 'table_name' => 'civicrm_event',
1121 'entity' => 'Event',
1122 'bao' => 'CRM_Event_BAO_Event',
1123 'localizable' => 0,
1124 'html' => [
1125 'type' => 'CheckBox',
1126 ],
1127 'add' => '1.7',
1128 ],
1129 'loc_block_id' => [
1130 'name' => 'loc_block_id',
1131 'type' => CRM_Utils_Type::T_INT,
1132 'title' => ts('Location Block ID'),
1133 'description' => ts('FK to Location Block ID'),
1134 'where' => 'civicrm_event.loc_block_id',
1135 'table_name' => 'civicrm_event',
1136 'entity' => 'Event',
1137 'bao' => 'CRM_Event_BAO_Event',
1138 'localizable' => 0,
1139 'FKClassName' => 'CRM_Core_DAO_LocBlock',
1140 'html' => [
1141 'label' => ts("Location Block"),
1142 ],
1143 'add' => '2.0',
1144 ],
1145 'default_role_id' => [
1146 'name' => 'default_role_id',
1147 'type' => CRM_Utils_Type::T_INT,
1148 'title' => ts('Default Role'),
1149 'description' => ts('Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.'),
1150 'import' => TRUE,
1151 'where' => 'civicrm_event.default_role_id',
1152 'export' => TRUE,
1153 'default' => '1',
1154 'table_name' => 'civicrm_event',
1155 'entity' => 'Event',
1156 'bao' => 'CRM_Event_BAO_Event',
1157 'localizable' => 0,
1158 'html' => [
1159 'type' => 'Select',
1160 ],
1161 'pseudoconstant' => [
1162 'optionGroupName' => 'participant_role',
1163 'optionEditPath' => 'civicrm/admin/options/participant_role',
1164 ],
1165 'add' => '2.0',
1166 ],
1167 'intro_text' => [
1168 'name' => 'intro_text',
1169 'type' => CRM_Utils_Type::T_TEXT,
1170 'title' => ts('Introductory Message'),
1171 'description' => ts('Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'),
1172 'rows' => 6,
1173 'cols' => 50,
1174 'where' => 'civicrm_event.intro_text',
1175 'table_name' => 'civicrm_event',
1176 'entity' => 'Event',
1177 'bao' => 'CRM_Event_BAO_Event',
1178 'localizable' => 1,
1179 'html' => [
1180 'type' => 'RichTextEditor',
1181 ],
1182 'add' => '1.7',
1183 ],
1184 'footer_text' => [
1185 'name' => 'footer_text',
1186 'type' => CRM_Utils_Type::T_TEXT,
1187 'title' => ts('Footer Message'),
1188 'description' => ts('Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'),
1189 'rows' => 6,
1190 'cols' => 50,
1191 'where' => 'civicrm_event.footer_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 'confirm_title' => [
1202 'name' => 'confirm_title',
1203 'type' => CRM_Utils_Type::T_STRING,
1204 'title' => ts('Confirmation Title'),
1205 'description' => ts('Title for Confirmation page.'),
1206 'maxlength' => 255,
1207 'size' => CRM_Utils_Type::HUGE,
1208 'where' => 'civicrm_event.confirm_title',
1209 'default' => NULL,
1210 'table_name' => 'civicrm_event',
1211 'entity' => 'Event',
1212 'bao' => 'CRM_Event_BAO_Event',
1213 'localizable' => 1,
1214 'html' => [
1215 'type' => 'Text',
1216 ],
1217 'add' => '1.7',
1218 ],
1219 'confirm_text' => [
1220 'name' => 'confirm_text',
1221 'type' => CRM_Utils_Type::T_TEXT,
1222 'title' => ts('Confirm Text'),
1223 'description' => ts('Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.'),
1224 'rows' => 6,
1225 'cols' => 50,
1226 'where' => 'civicrm_event.confirm_text',
1227 'table_name' => 'civicrm_event',
1228 'entity' => 'Event',
1229 'bao' => 'CRM_Event_BAO_Event',
1230 'localizable' => 1,
1231 'html' => [
1232 'type' => 'RichTextEditor',
1233 ],
1234 'add' => '1.7',
1235 ],
1236 'confirm_footer_text' => [
1237 'name' => 'confirm_footer_text',
1238 'type' => CRM_Utils_Type::T_TEXT,
1239 'title' => ts('Footer Text'),
1240 'description' => ts('Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.'),
1241 'rows' => 6,
1242 'cols' => 50,
1243 'where' => 'civicrm_event.confirm_footer_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 'is_email_confirm' => [
1254 'name' => 'is_email_confirm',
1255 'type' => CRM_Utils_Type::T_BOOLEAN,
1256 'title' => ts('Is confirm email'),
1257 'description' => ts('If true, confirmation is automatically emailed to contact on successful registration.'),
1258 'required' => TRUE,
1259 'where' => 'civicrm_event.is_email_confirm',
1260 'default' => '0',
1261 'table_name' => 'civicrm_event',
1262 'entity' => 'Event',
1263 'bao' => 'CRM_Event_BAO_Event',
1264 'localizable' => 0,
1265 'html' => [
1266 'type' => 'CheckBox',
1267 ],
1268 'add' => '1.7',
1269 ],
1270 'confirm_email_text' => [
1271 'name' => 'confirm_email_text',
1272 'type' => CRM_Utils_Type::T_TEXT,
1273 'title' => ts('Confirmation Email Text'),
1274 'description' => ts('text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now'),
1275 'rows' => 4,
1276 'cols' => 50,
1277 'where' => 'civicrm_event.confirm_email_text',
1278 'table_name' => 'civicrm_event',
1279 'entity' => 'Event',
1280 'bao' => 'CRM_Event_BAO_Event',
1281 'localizable' => 1,
1282 'html' => [
1283 'type' => 'TextArea',
1284 ],
1285 'add' => '1.7',
1286 ],
1287 'confirm_from_name' => [
1288 'name' => 'confirm_from_name',
1289 'type' => CRM_Utils_Type::T_STRING,
1290 'title' => ts('Confirm From Name'),
1291 'description' => ts('FROM email name used for confirmation emails.'),
1292 'maxlength' => 255,
1293 'size' => CRM_Utils_Type::HUGE,
1294 'where' => 'civicrm_event.confirm_from_name',
1295 'table_name' => 'civicrm_event',
1296 'entity' => 'Event',
1297 'bao' => 'CRM_Event_BAO_Event',
1298 'localizable' => 1,
1299 'html' => [
1300 'type' => 'Text',
1301 ],
1302 'add' => '1.7',
1303 ],
1304 'confirm_from_email' => [
1305 'name' => 'confirm_from_email',
1306 'type' => CRM_Utils_Type::T_STRING,
1307 'title' => ts('Confirm From Email'),
1308 'description' => ts('FROM email address used for confirmation emails.'),
1309 'maxlength' => 255,
1310 'size' => CRM_Utils_Type::HUGE,
1311 'where' => 'civicrm_event.confirm_from_email',
1312 'table_name' => 'civicrm_event',
1313 'entity' => 'Event',
1314 'bao' => 'CRM_Event_BAO_Event',
1315 'localizable' => 0,
1316 'html' => [
1317 'type' => 'Text',
1318 ],
1319 'add' => '1.7',
1320 ],
1321 'cc_confirm' => [
1322 'name' => 'cc_confirm',
1323 'type' => CRM_Utils_Type::T_STRING,
1324 'title' => ts('Cc Confirm'),
1325 'description' => ts('comma-separated list of email addresses to cc each time a confirmation is sent'),
1326 'maxlength' => 255,
1327 'size' => CRM_Utils_Type::HUGE,
1328 'where' => 'civicrm_event.cc_confirm',
1329 'table_name' => 'civicrm_event',
1330 'entity' => 'Event',
1331 'bao' => 'CRM_Event_BAO_Event',
1332 'localizable' => 0,
1333 'html' => [
1334 'type' => 'Text',
1335 'label' => ts("CC Confirm"),
1336 ],
1337 'add' => '1.7',
1338 ],
1339 'bcc_confirm' => [
1340 'name' => 'bcc_confirm',
1341 'type' => CRM_Utils_Type::T_STRING,
1342 'title' => ts('Bcc Confirm'),
1343 'description' => ts('comma-separated list of email addresses to bcc each time a confirmation is sent'),
1344 'maxlength' => 255,
1345 'size' => CRM_Utils_Type::HUGE,
1346 'where' => 'civicrm_event.bcc_confirm',
1347 'table_name' => 'civicrm_event',
1348 'entity' => 'Event',
1349 'bao' => 'CRM_Event_BAO_Event',
1350 'localizable' => 0,
1351 'html' => [
1352 'type' => 'Text',
1353 'label' => ts("BCC Confirm"),
1354 ],
1355 'add' => '1.7',
1356 ],
1357 'default_fee_id' => [
1358 'name' => 'default_fee_id',
1359 'type' => CRM_Utils_Type::T_INT,
1360 'title' => ts('Default Fee ID'),
1361 'description' => ts('FK to civicrm_option_value.'),
1362 'where' => 'civicrm_event.default_fee_id',
1363 'table_name' => 'civicrm_event',
1364 'entity' => 'Event',
1365 'bao' => 'CRM_Event_BAO_Event',
1366 'localizable' => 0,
1367 'add' => '1.7',
1368 ],
1369 'default_discount_fee_id' => [
1370 'name' => 'default_discount_fee_id',
1371 'type' => CRM_Utils_Type::T_INT,
1372 'title' => ts('Default Discount Fee ID'),
1373 'description' => ts('FK to civicrm_option_value.'),
1374 'where' => 'civicrm_event.default_discount_fee_id',
1375 'table_name' => 'civicrm_event',
1376 'entity' => 'Event',
1377 'bao' => 'CRM_Event_BAO_Event',
1378 'localizable' => 0,
1379 'add' => '1.7',
1380 ],
1381 'thankyou_title' => [
1382 'name' => 'thankyou_title',
1383 'type' => CRM_Utils_Type::T_STRING,
1384 'title' => ts('ThankYou Title'),
1385 'description' => ts('Title for ThankYou page.'),
1386 'maxlength' => 255,
1387 'size' => CRM_Utils_Type::HUGE,
1388 'where' => 'civicrm_event.thankyou_title',
1389 'default' => NULL,
1390 'table_name' => 'civicrm_event',
1391 'entity' => 'Event',
1392 'bao' => 'CRM_Event_BAO_Event',
1393 'localizable' => 1,
1394 'html' => [
1395 'type' => 'Text',
1396 ],
1397 'add' => '1.7',
1398 ],
1399 'thankyou_text' => [
1400 'name' => 'thankyou_text',
1401 'type' => CRM_Utils_Type::T_TEXT,
1402 'title' => ts('ThankYou Text'),
1403 'description' => ts('ThankYou Text.'),
1404 'rows' => 6,
1405 'cols' => 50,
1406 'where' => 'civicrm_event.thankyou_text',
1407 'table_name' => 'civicrm_event',
1408 'entity' => 'Event',
1409 'bao' => 'CRM_Event_BAO_Event',
1410 'localizable' => 1,
1411 'html' => [
1412 'type' => 'RichTextEditor',
1413 ],
1414 'add' => '1.7',
1415 ],
1416 'thankyou_footer_text' => [
1417 'name' => 'thankyou_footer_text',
1418 'type' => CRM_Utils_Type::T_TEXT,
1419 'title' => ts('Footer Text'),
1420 'description' => ts('Footer message.'),
1421 'rows' => 6,
1422 'cols' => 50,
1423 'where' => 'civicrm_event.thankyou_footer_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 'is_pay_later' => [
1434 'name' => 'is_pay_later',
1435 'type' => CRM_Utils_Type::T_BOOLEAN,
1436 'title' => ts('Pay Later Allowed'),
1437 'description' => ts('if true - allows the user to send payment directly to the org later'),
1438 'required' => TRUE,
1439 'where' => 'civicrm_event.is_pay_later',
1440 'default' => '0',
1441 'table_name' => 'civicrm_event',
1442 'entity' => 'Event',
1443 'bao' => 'CRM_Event_BAO_Event',
1444 'localizable' => 0,
1445 'html' => [
1446 'type' => 'CheckBox',
1447 ],
1448 'add' => '2.0',
1449 ],
1450 'pay_later_text' => [
1451 'name' => 'pay_later_text',
1452 'type' => CRM_Utils_Type::T_TEXT,
1453 'title' => ts('Pay Later Text'),
1454 'description' => ts('The text displayed to the user in the main form'),
1455 'where' => 'civicrm_event.pay_later_text',
1456 'table_name' => 'civicrm_event',
1457 'entity' => 'Event',
1458 'bao' => 'CRM_Event_BAO_Event',
1459 'localizable' => 1,
1460 'html' => [
1461 'type' => 'RichTextEditor',
1462 ],
1463 'add' => '2.0',
1464 ],
1465 'pay_later_receipt' => [
1466 'name' => 'pay_later_receipt',
1467 'type' => CRM_Utils_Type::T_TEXT,
1468 'title' => ts('Pay Later Receipt Text'),
1469 'description' => ts('The receipt sent to the user instead of the normal receipt text'),
1470 'where' => 'civicrm_event.pay_later_receipt',
1471 'table_name' => 'civicrm_event',
1472 'entity' => 'Event',
1473 'bao' => 'CRM_Event_BAO_Event',
1474 'localizable' => 1,
1475 'html' => [
1476 'type' => 'Text',
1477 ],
1478 'add' => '2.0',
1479 ],
1480 'is_partial_payment' => [
1481 'name' => 'is_partial_payment',
1482 'type' => CRM_Utils_Type::T_BOOLEAN,
1483 'title' => ts('Partial Payments Enabled'),
1484 'description' => ts('is partial payment enabled for this event'),
1485 'required' => TRUE,
1486 'where' => 'civicrm_event.is_partial_payment',
1487 'default' => '0',
1488 'table_name' => 'civicrm_event',
1489 'entity' => 'Event',
1490 'bao' => 'CRM_Event_BAO_Event',
1491 'localizable' => 0,
1492 'html' => [
1493 'type' => 'CheckBox',
1494 ],
1495 'add' => '4.3',
1496 ],
1497 'initial_amount_label' => [
1498 'name' => 'initial_amount_label',
1499 'type' => CRM_Utils_Type::T_STRING,
1500 'title' => ts('Initial Amount Label'),
1501 'description' => ts('Initial amount label for partial payment'),
1502 'maxlength' => 255,
1503 'size' => CRM_Utils_Type::HUGE,
1504 'where' => 'civicrm_event.initial_amount_label',
1505 'table_name' => 'civicrm_event',
1506 'entity' => 'Event',
1507 'bao' => 'CRM_Event_BAO_Event',
1508 'localizable' => 1,
1509 'html' => [
1510 'type' => 'Text',
1511 ],
1512 'add' => '4.3',
1513 ],
1514 'initial_amount_help_text' => [
1515 'name' => 'initial_amount_help_text',
1516 'type' => CRM_Utils_Type::T_TEXT,
1517 'title' => ts('Initial Amount Help Text'),
1518 'description' => ts('Initial amount help text for partial payment'),
1519 'where' => 'civicrm_event.initial_amount_help_text',
1520 'table_name' => 'civicrm_event',
1521 'entity' => 'Event',
1522 'bao' => 'CRM_Event_BAO_Event',
1523 'localizable' => 1,
1524 'html' => [
1525 'type' => 'Text',
1526 ],
1527 'add' => '4.3',
1528 ],
1529 'min_initial_amount' => [
1530 'name' => 'min_initial_amount',
1531 'type' => CRM_Utils_Type::T_MONEY,
1532 'title' => ts('Minimum Initial Amount'),
1533 'description' => ts('Minimum initial amount for partial payment'),
1534 'precision' => [
1535 20,
1536 2,
1537 ],
1538 'where' => 'civicrm_event.min_initial_amount',
1539 'table_name' => 'civicrm_event',
1540 'entity' => 'Event',
1541 'bao' => 'CRM_Event_BAO_Event',
1542 'localizable' => 0,
1543 'html' => [
1544 'type' => 'Text',
1545 ],
1546 'add' => '4.3',
1547 ],
1548 'is_multiple_registrations' => [
1549 'name' => 'is_multiple_registrations',
1550 'type' => CRM_Utils_Type::T_BOOLEAN,
1551 'title' => ts('Allow Multiple Registrations'),
1552 'description' => ts('if true - allows the user to register multiple participants for event'),
1553 'required' => TRUE,
1554 'where' => 'civicrm_event.is_multiple_registrations',
1555 'default' => '0',
1556 'table_name' => 'civicrm_event',
1557 'entity' => 'Event',
1558 'bao' => 'CRM_Event_BAO_Event',
1559 'localizable' => 0,
1560 'html' => [
1561 'type' => 'CheckBox',
1562 ],
1563 'add' => '2.1',
1564 ],
1565 'max_additional_participants' => [
1566 'name' => 'max_additional_participants',
1567 'type' => CRM_Utils_Type::T_INT,
1568 'title' => ts('Maximum number of additional participants per registration'),
1569 'description' => ts('Maximum number of additional participants that can be registered on a single booking'),
1570 'where' => 'civicrm_event.max_additional_participants',
1571 'default' => '0',
1572 'table_name' => 'civicrm_event',
1573 'entity' => 'Event',
1574 'bao' => 'CRM_Event_BAO_Event',
1575 'localizable' => 0,
1576 'add' => '4.7',
1577 ],
1578 'allow_same_participant_emails' => [
1579 'name' => 'allow_same_participant_emails',
1580 'type' => CRM_Utils_Type::T_BOOLEAN,
1581 'title' => ts('Does Event allow multiple registrations from same email address?'),
1582 'description' => ts('if true - allows the user to register multiple registrations from same email address.'),
1583 'required' => TRUE,
1584 'where' => 'civicrm_event.allow_same_participant_emails',
1585 'default' => '0',
1586 'table_name' => 'civicrm_event',
1587 'entity' => 'Event',
1588 'bao' => 'CRM_Event_BAO_Event',
1589 'localizable' => 0,
1590 'html' => [
1591 'type' => 'CheckBox',
1592 ],
1593 'add' => '2.2',
1594 ],
1595 'has_waitlist' => [
1596 'name' => 'has_waitlist',
1597 'type' => CRM_Utils_Type::T_BOOLEAN,
1598 'title' => ts('Waitlist Enabled'),
1599 'description' => ts('Whether the event has waitlist support.'),
1600 'required' => TRUE,
1601 'where' => 'civicrm_event.has_waitlist',
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' => '3.0',
1611 ],
1612 'requires_approval' => [
1613 'name' => 'requires_approval',
1614 'type' => CRM_Utils_Type::T_BOOLEAN,
1615 'title' => ts('Requires Approval'),
1616 'description' => ts('Whether participants require approval before they can finish registering.'),
1617 'required' => TRUE,
1618 'where' => 'civicrm_event.requires_approval',
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 'label' => ts("Requires Approval"),
1627 ],
1628 'add' => '3.0',
1629 ],
1630 'expiration_time' => [
1631 'name' => 'expiration_time',
1632 'type' => CRM_Utils_Type::T_INT,
1633 'title' => ts('Expiration Time'),
1634 'description' => ts('Expire pending but unconfirmed registrations after this many hours.'),
1635 'where' => 'civicrm_event.expiration_time',
1636 'table_name' => 'civicrm_event',
1637 'entity' => 'Event',
1638 'bao' => 'CRM_Event_BAO_Event',
1639 'localizable' => 0,
1640 'html' => [
1641 'type' => 'Text',
1642 'label' => ts("Expiration Time"),
1643 ],
1644 'add' => '3.0',
1645 ],
1646 'allow_selfcancelxfer' => [
1647 'name' => 'allow_selfcancelxfer',
1648 'type' => CRM_Utils_Type::T_BOOLEAN,
1649 'title' => ts('Allow Self-service Cancellation or Transfer'),
1650 'description' => ts('Allow self service cancellation or transfer for event?'),
1651 'required' => TRUE,
1652 'where' => 'civicrm_event.allow_selfcancelxfer',
1653 'default' => '0',
1654 'table_name' => 'civicrm_event',
1655 'entity' => 'Event',
1656 'bao' => 'CRM_Event_BAO_Event',
1657 'localizable' => 0,
1658 'html' => [
1659 'type' => 'CheckBox',
1660 ],
1661 'add' => '4.7',
1662 ],
1663 'selfcancelxfer_time' => [
1664 'name' => 'selfcancelxfer_time',
1665 'type' => CRM_Utils_Type::T_INT,
1666 'title' => ts('Self-service Cancellation or Transfer Time'),
1667 'description' => ts('Number of hours prior to event start date to allow self-service cancellation or transfer.'),
1668 'where' => 'civicrm_event.selfcancelxfer_time',
1669 'default' => '0',
1670 'table_name' => 'civicrm_event',
1671 'entity' => 'Event',
1672 'bao' => 'CRM_Event_BAO_Event',
1673 'localizable' => 0,
1674 'html' => [
1675 'type' => 'Text',
1676 ],
1677 'add' => '4.7',
1678 ],
1679 'waitlist_text' => [
1680 'name' => 'waitlist_text',
1681 'type' => CRM_Utils_Type::T_TEXT,
1682 'title' => ts('Waitlist Text'),
1683 'description' => ts('Text to display when the event is full, but participants can signup for a waitlist.'),
1684 'rows' => 4,
1685 'cols' => 60,
1686 'where' => 'civicrm_event.waitlist_text',
1687 'table_name' => 'civicrm_event',
1688 'entity' => 'Event',
1689 'bao' => 'CRM_Event_BAO_Event',
1690 'localizable' => 1,
1691 'html' => [
1692 'type' => 'TextArea',
1693 'label' => ts("Waitlist Text"),
1694 ],
1695 'add' => '3.0',
1696 ],
1697 'approval_req_text' => [
1698 'name' => 'approval_req_text',
1699 'type' => CRM_Utils_Type::T_TEXT,
1700 'title' => ts('Approval Req Text'),
1701 'description' => ts('Text to display when the approval is required to complete registration for an event.'),
1702 'rows' => 4,
1703 'cols' => 60,
1704 'where' => 'civicrm_event.approval_req_text',
1705 'table_name' => 'civicrm_event',
1706 'entity' => 'Event',
1707 'bao' => 'CRM_Event_BAO_Event',
1708 'localizable' => 1,
1709 'html' => [
1710 'type' => 'TextArea',
1711 'label' => ts("Approval Required Text"),
1712 ],
1713 'add' => '3.0',
1714 ],
1715 'is_template' => [
1716 'name' => 'is_template',
1717 'type' => CRM_Utils_Type::T_BOOLEAN,
1718 'title' => ts('Is an Event Template'),
1719 'description' => ts('whether the event has template'),
1720 'required' => TRUE,
1721 'where' => 'civicrm_event.is_template',
1722 'default' => '0',
1723 'table_name' => 'civicrm_event',
1724 'entity' => 'Event',
1725 'bao' => 'CRM_Event_BAO_Event',
1726 'localizable' => 0,
1727 'html' => [
1728 'type' => 'CheckBox',
1729 ],
1730 'add' => '3.0',
1731 ],
1732 'template_title' => [
1733 'name' => 'template_title',
1734 'type' => CRM_Utils_Type::T_STRING,
1735 'title' => ts('Event Template Title'),
1736 'description' => ts('Event Template Title'),
1737 'maxlength' => 255,
1738 'size' => CRM_Utils_Type::HUGE,
1739 'import' => TRUE,
1740 'where' => 'civicrm_event.template_title',
1741 'headerPattern' => '/(template.)?title$/i',
1742 'export' => TRUE,
1743 'table_name' => 'civicrm_event',
1744 'entity' => 'Event',
1745 'bao' => 'CRM_Event_BAO_Event',
1746 'localizable' => 1,
1747 'html' => [
1748 'type' => 'Text',
1749 ],
1750 'add' => '3.0',
1751 ],
1752 'created_id' => [
1753 'name' => 'created_id',
1754 'type' => CRM_Utils_Type::T_INT,
1755 'title' => ts('Created By Contact ID'),
1756 'description' => ts('FK to civicrm_contact, who created this event'),
1757 'where' => 'civicrm_event.created_id',
1758 'table_name' => 'civicrm_event',
1759 'entity' => 'Event',
1760 'bao' => 'CRM_Event_BAO_Event',
1761 'localizable' => 0,
1762 'FKClassName' => 'CRM_Contact_DAO_Contact',
1763 'html' => [
1764 'label' => ts("Created By"),
1765 ],
1766 'add' => '3.0',
1767 ],
1768 'created_date' => [
1769 'name' => 'created_date',
1770 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1771 'title' => ts('Event Created Date'),
1772 'description' => ts('Date and time that event was created.'),
1773 'where' => 'civicrm_event.created_date',
1774 'table_name' => 'civicrm_event',
1775 'entity' => 'Event',
1776 'bao' => 'CRM_Event_BAO_Event',
1777 'localizable' => 0,
1778 'add' => '3.0',
1779 ],
1780 'currency' => [
1781 'name' => 'currency',
1782 'type' => CRM_Utils_Type::T_STRING,
1783 'title' => ts('Currency'),
1784 'description' => ts('3 character string, value from config setting or input via user.'),
1785 'maxlength' => 3,
1786 'size' => CRM_Utils_Type::FOUR,
1787 'import' => TRUE,
1788 'where' => 'civicrm_event.currency',
1789 'headerPattern' => '/cur(rency)?/i',
1790 'dataPattern' => '/^[A-Z]{3}$/i',
1791 'export' => TRUE,
1792 'table_name' => 'civicrm_event',
1793 'entity' => 'Event',
1794 'bao' => 'CRM_Event_BAO_Event',
1795 'localizable' => 0,
1796 'html' => [
1797 'type' => 'Select',
1798 'label' => ts("Currency"),
1799 ],
1800 'pseudoconstant' => [
1801 'table' => 'civicrm_currency',
1802 'keyColumn' => 'name',
1803 'labelColumn' => 'full_name',
1804 'nameColumn' => 'name',
1805 'abbrColumn' => 'symbol',
1806 ],
1807 'add' => '3.3',
1808 ],
1809 'campaign_id' => [
1810 'name' => 'campaign_id',
1811 'type' => CRM_Utils_Type::T_INT,
1812 'title' => ts('Campaign ID'),
1813 'description' => ts('The campaign for which this event has been created.'),
1814 'where' => 'civicrm_event.campaign_id',
1815 'table_name' => 'civicrm_event',
1816 'entity' => 'Event',
1817 'bao' => 'CRM_Event_BAO_Event',
1818 'localizable' => 0,
1819 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
1820 'component' => 'CiviCampaign',
1821 'html' => [
1822 'type' => 'EntityRef',
1823 'label' => ts("Campaign"),
1824 ],
1825 'pseudoconstant' => [
1826 'table' => 'civicrm_campaign',
1827 'keyColumn' => 'id',
1828 'labelColumn' => 'title',
1829 'prefetch' => 'FALSE',
1830 ],
1831 'add' => '3.4',
1832 ],
1833 'is_share' => [
1834 'name' => 'is_share',
1835 'type' => CRM_Utils_Type::T_BOOLEAN,
1836 'title' => ts('Is shared through social media'),
1837 'description' => ts('Can people share the event through social media?'),
1838 'required' => TRUE,
1839 'where' => 'civicrm_event.is_share',
1840 'default' => '1',
1841 'table_name' => 'civicrm_event',
1842 'entity' => 'Event',
1843 'bao' => 'CRM_Event_BAO_Event',
1844 'localizable' => 0,
1845 'html' => [
1846 'type' => 'CheckBox',
1847 ],
1848 'add' => '4.1',
1849 ],
1850 'is_confirm_enabled' => [
1851 'name' => 'is_confirm_enabled',
1852 'type' => CRM_Utils_Type::T_BOOLEAN,
1853 'title' => ts('Is the booking confirmation screen enabled?'),
1854 'description' => ts('If false, the event booking confirmation screen gets skipped'),
1855 'required' => TRUE,
1856 'where' => 'civicrm_event.is_confirm_enabled',
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.5',
1866 ],
1867 'parent_event_id' => [
1868 'name' => 'parent_event_id',
1869 'type' => CRM_Utils_Type::T_INT,
1870 'title' => ts('Parent Event ID'),
1871 'description' => ts('Implicit FK to civicrm_event: parent event'),
1872 'where' => 'civicrm_event.parent_event_id',
1873 'default' => NULL,
1874 'table_name' => 'civicrm_event',
1875 'entity' => 'Event',
1876 'bao' => 'CRM_Event_BAO_Event',
1877 'localizable' => 0,
1878 'html' => [
1879 'type' => 'EntityRef',
1880 ],
1881 'add' => '4.1',
1882 ],
1883 'slot_label_id' => [
1884 'name' => 'slot_label_id',
1885 'type' => CRM_Utils_Type::T_INT,
1886 'title' => ts('Subevent Slot Label ID'),
1887 'description' => ts('Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot.'),
1888 'where' => 'civicrm_event.slot_label_id',
1889 'default' => NULL,
1890 'table_name' => 'civicrm_event',
1891 'entity' => 'Event',
1892 'bao' => 'CRM_Event_BAO_Event',
1893 'localizable' => 0,
1894 'html' => [
1895 'type' => 'Select',
1896 ],
1897 'add' => '4.1',
1898 ],
1899 'dedupe_rule_group_id' => [
1900 'name' => 'dedupe_rule_group_id',
1901 'type' => CRM_Utils_Type::T_INT,
1902 'title' => ts('Dedupe Rule ID'),
1903 'description' => ts('Rule to use when matching registrations for this event'),
1904 'where' => 'civicrm_event.dedupe_rule_group_id',
1905 'default' => NULL,
1906 'table_name' => 'civicrm_event',
1907 'entity' => 'Event',
1908 'bao' => 'CRM_Event_BAO_Event',
1909 'localizable' => 0,
1910 'FKClassName' => 'CRM_Dedupe_DAO_DedupeRuleGroup',
1911 'html' => [
1912 'type' => 'Select',
1913 'label' => ts("Dedupe Rule"),
1914 ],
1915 'pseudoconstant' => [
1916 'table' => 'civicrm_dedupe_rule_group',
1917 'keyColumn' => 'id',
1918 'labelColumn' => 'title',
1919 'nameColumn' => 'name',
1920 ],
1921 'add' => '4.5',
1922 ],
1923 'is_billing_required' => [
1924 'name' => 'is_billing_required',
1925 'type' => CRM_Utils_Type::T_BOOLEAN,
1926 'title' => ts('Is billing block required'),
1927 'description' => ts('if true than billing block is required this event'),
1928 'required' => TRUE,
1929 'where' => 'civicrm_event.is_billing_required',
1930 'default' => '0',
1931 'table_name' => 'civicrm_event',
1932 'entity' => 'Event',
1933 'bao' => 'CRM_Event_BAO_Event',
1934 'localizable' => 0,
1935 'html' => [
1936 'type' => 'CheckBox',
1937 ],
1938 'add' => '4.6',
1939 ],
1940 ];
1941 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1942 }
1943 return Civi::$statics[__CLASS__]['fields'];
1944 }
1945
1946 /**
1947 * Return a mapping from field-name to the corresponding key (as used in fields()).
1948 *
1949 * @return array
1950 * Array(string $name => string $uniqueName).
1951 */
1952 public static function &fieldKeys() {
1953 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1954 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1955 }
1956 return Civi::$statics[__CLASS__]['fieldKeys'];
1957 }
1958
1959 /**
1960 * Returns the names of this table
1961 *
1962 * @return string
1963 */
1964 public static function getTableName() {
1965 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
1966 }
1967
1968 /**
1969 * Returns if this table needs to be logged
1970 *
1971 * @return bool
1972 */
1973 public function getLog() {
1974 return self::$_log;
1975 }
1976
1977 /**
1978 * Returns the list of fields that can be imported
1979 *
1980 * @param bool $prefix
1981 *
1982 * @return array
1983 */
1984 public static function &import($prefix = FALSE) {
1985 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'event', $prefix, []);
1986 return $r;
1987 }
1988
1989 /**
1990 * Returns the list of fields that can be exported
1991 *
1992 * @param bool $prefix
1993 *
1994 * @return array
1995 */
1996 public static function &export($prefix = FALSE) {
1997 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'event', $prefix, []);
1998 return $r;
1999 }
2000
2001 /**
2002 * Returns the list of indices
2003 *
2004 * @param bool $localize
2005 *
2006 * @return array
2007 */
2008 public static function indices($localize = TRUE) {
2009 $indices = [
2010 'index_event_type_id' => [
2011 'name' => 'index_event_type_id',
2012 'field' => [
2013 0 => 'event_type_id',
2014 ],
2015 'localizable' => FALSE,
2016 'sig' => 'civicrm_event::0::event_type_id',
2017 ],
2018 'index_participant_listing_id' => [
2019 'name' => 'index_participant_listing_id',
2020 'field' => [
2021 0 => 'participant_listing_id',
2022 ],
2023 'localizable' => FALSE,
2024 'sig' => 'civicrm_event::0::participant_listing_id',
2025 ],
2026 'index_parent_event_id' => [
2027 'name' => 'index_parent_event_id',
2028 'field' => [
2029 0 => 'parent_event_id',
2030 ],
2031 'localizable' => FALSE,
2032 'sig' => 'civicrm_event::0::parent_event_id',
2033 ],
2034 ];
2035 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
2036 }
2037
2038 }