Merge pull request #8881 from liedekef/master
[civicrm-core.git] / CRM / Event / DAO / Event.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Event/Event.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:852ff9c0ec07c4eff96a484e1b44f781)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Event_DAO_Event extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_event';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * Event
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Event Title (e.g. Fall Fundraiser Dinner)
59 *
60 * @var string
61 */
62 public $title;
63 /**
64 * 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.
65 *
66 * @var text
67 */
68 public $summary;
69 /**
70 * Full description of event. Text and html allowed. Displayed on built-in Event Information screens.
71 *
72 * @var text
73 */
74 public $description;
75 /**
76 * Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.
77 *
78 * @var int unsigned
79 */
80 public $event_type_id;
81 /**
82 * Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.
83 *
84 * @var int unsigned
85 */
86 public $participant_listing_id;
87 /**
88 * Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.
89 *
90 * @var boolean
91 */
92 public $is_public;
93 /**
94 * Date and time that event starts.
95 *
96 * @var datetime
97 */
98 public $start_date;
99 /**
100 * Date and time that event ends. May be NULL if no defined end date/time
101 *
102 * @var datetime
103 */
104 public $end_date;
105 /**
106 * If true, include registration link on Event Info page.
107 *
108 * @var boolean
109 */
110 public $is_online_registration;
111 /**
112 * Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.
113 *
114 * @var string
115 */
116 public $registration_link_text;
117 /**
118 * Date and time that online registration starts.
119 *
120 * @var datetime
121 */
122 public $registration_start_date;
123 /**
124 * Date and time that online registration ends.
125 *
126 * @var datetime
127 */
128 public $registration_end_date;
129 /**
130 * 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.
131 *
132 * @var int unsigned
133 */
134 public $max_participants;
135 /**
136 * 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.
137 *
138 * @var text
139 */
140 public $event_full_text;
141 /**
142 * If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.
143 *
144 * @var boolean
145 */
146 public $is_monetary;
147 /**
148 * Financial type assigned to paid event registrations for this event. Required if is_monetary is true.
149 *
150 * @var int unsigned
151 */
152 public $financial_type_id;
153 /**
154 * Payment Processors configured for this Event (if is_monetary is true)
155 *
156 * @var string
157 */
158 public $payment_processor;
159 /**
160 * Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?
161 *
162 * @var boolean
163 */
164 public $is_map;
165 /**
166 * Is this Event enabled or disabled/cancelled?
167 *
168 * @var boolean
169 */
170 public $is_active;
171 /**
172 *
173 * @var string
174 */
175 public $fee_label;
176 /**
177 * If true, show event location.
178 *
179 * @var boolean
180 */
181 public $is_show_location;
182 /**
183 * FK to Location Block ID
184 *
185 * @var int unsigned
186 */
187 public $loc_block_id;
188 /**
189 * Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.
190 *
191 * @var int unsigned
192 */
193 public $default_role_id;
194 /**
195 * Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.
196 *
197 * @var text
198 */
199 public $intro_text;
200 /**
201 * Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.
202 *
203 * @var text
204 */
205 public $footer_text;
206 /**
207 * Title for Confirmation page.
208 *
209 * @var string
210 */
211 public $confirm_title;
212 /**
213 * Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.
214 *
215 * @var text
216 */
217 public $confirm_text;
218 /**
219 * Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.
220 *
221 * @var text
222 */
223 public $confirm_footer_text;
224 /**
225 * If true, confirmation is automatically emailed to contact on successful registration.
226 *
227 * @var boolean
228 */
229 public $is_email_confirm;
230 /**
231 * text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now
232 *
233 * @var text
234 */
235 public $confirm_email_text;
236 /**
237 * FROM email name used for confirmation emails.
238 *
239 * @var string
240 */
241 public $confirm_from_name;
242 /**
243 * FROM email address used for confirmation emails.
244 *
245 * @var string
246 */
247 public $confirm_from_email;
248 /**
249 * comma-separated list of email addresses to cc each time a confirmation is sent
250 *
251 * @var string
252 */
253 public $cc_confirm;
254 /**
255 * comma-separated list of email addresses to bcc each time a confirmation is sent
256 *
257 * @var string
258 */
259 public $bcc_confirm;
260 /**
261 * FK to civicrm_option_value.
262 *
263 * @var int unsigned
264 */
265 public $default_fee_id;
266 /**
267 * FK to civicrm_option_value.
268 *
269 * @var int unsigned
270 */
271 public $default_discount_fee_id;
272 /**
273 * Title for ThankYou page.
274 *
275 * @var string
276 */
277 public $thankyou_title;
278 /**
279 * ThankYou Text.
280 *
281 * @var text
282 */
283 public $thankyou_text;
284 /**
285 * Footer message.
286 *
287 * @var text
288 */
289 public $thankyou_footer_text;
290 /**
291 * if true - allows the user to send payment directly to the org later
292 *
293 * @var boolean
294 */
295 public $is_pay_later;
296 /**
297 * The text displayed to the user in the main form
298 *
299 * @var text
300 */
301 public $pay_later_text;
302 /**
303 * The receipt sent to the user instead of the normal receipt text
304 *
305 * @var text
306 */
307 public $pay_later_receipt;
308 /**
309 * is partial payment enabled for this event
310 *
311 * @var boolean
312 */
313 public $is_partial_payment;
314 /**
315 * Initial amount label for partial payment
316 *
317 * @var string
318 */
319 public $initial_amount_label;
320 /**
321 * Initial amount help text for partial payment
322 *
323 * @var text
324 */
325 public $initial_amount_help_text;
326 /**
327 * Minimum initial amount for partial payment
328 *
329 * @var float
330 */
331 public $min_initial_amount;
332 /**
333 * if true - allows the user to register multiple participants for event
334 *
335 * @var boolean
336 */
337 public $is_multiple_registrations;
338 /**
339 * Maximum number of additional participants that can be registered on a single booking
340 *
341 * @var int unsigned
342 */
343 public $max_additional_participants;
344 /**
345 * if true - allows the user to register multiple registrations from same email address.
346 *
347 * @var boolean
348 */
349 public $allow_same_participant_emails;
350 /**
351 * Whether the event has waitlist support.
352 *
353 * @var boolean
354 */
355 public $has_waitlist;
356 /**
357 * Whether participants require approval before they can finish registering.
358 *
359 * @var boolean
360 */
361 public $requires_approval;
362 /**
363 * Expire pending but unconfirmed registrations after this many hours.
364 *
365 * @var int unsigned
366 */
367 public $expiration_time;
368 /**
369 * Allow self service cancellation or transfer for event?
370 *
371 * @var boolean
372 */
373 public $allow_selfcancelxfer;
374 /**
375 * Number of hours prior to event start date to allow self-service cancellation or transfer.
376 *
377 * @var int unsigned
378 */
379 public $selfcancelxfer_time;
380 /**
381 * Text to display when the event is full, but participants can signup for a waitlist.
382 *
383 * @var text
384 */
385 public $waitlist_text;
386 /**
387 * Text to display when the approval is required to complete registration for an event.
388 *
389 * @var text
390 */
391 public $approval_req_text;
392 /**
393 * whether the event has template
394 *
395 * @var boolean
396 */
397 public $is_template;
398 /**
399 * Event Template Title
400 *
401 * @var string
402 */
403 public $template_title;
404 /**
405 * FK to civicrm_contact, who created this event
406 *
407 * @var int unsigned
408 */
409 public $created_id;
410 /**
411 * Date and time that event was created.
412 *
413 * @var datetime
414 */
415 public $created_date;
416 /**
417 * 3 character string, value from config setting or input via user.
418 *
419 * @var string
420 */
421 public $currency;
422 /**
423 * The campaign for which this event has been created.
424 *
425 * @var int unsigned
426 */
427 public $campaign_id;
428 /**
429 * Can people share the event through social media?
430 *
431 * @var boolean
432 */
433 public $is_share;
434 /**
435 * If false, the event booking confirmation screen gets skipped
436 *
437 * @var boolean
438 */
439 public $is_confirm_enabled;
440 /**
441 * Implicit FK to civicrm_event: parent event
442 *
443 * @var int unsigned
444 */
445 public $parent_event_id;
446 /**
447 * Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot.
448 *
449 * @var int unsigned
450 */
451 public $slot_label_id;
452 /**
453 * Rule to use when matching registrations for this event
454 *
455 * @var int unsigned
456 */
457 public $dedupe_rule_group_id;
458 /**
459 * if true than billing block is required this event
460 *
461 * @var boolean
462 */
463 public $is_billing_required;
464 /**
465 * class constructor
466 *
467 * @return civicrm_event
468 */
469 function __construct() {
470 $this->__table = 'civicrm_event';
471 parent::__construct();
472 }
473 /**
474 * Returns foreign keys and entity references
475 *
476 * @return array
477 * [CRM_Core_Reference_Interface]
478 */
479 static function getReferenceColumns() {
480 if (!isset(Civi::$statics[__CLASS__]['links'])) {
481 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
482 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'loc_block_id', 'civicrm_loc_block', 'id');
483 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
484 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
485 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
486 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
487 }
488 return Civi::$statics[__CLASS__]['links'];
489 }
490 /**
491 * Returns all the column names of this table
492 *
493 * @return array
494 */
495 static function &fields() {
496 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
497 Civi::$statics[__CLASS__]['fields'] = array(
498 'id' => array(
499 'name' => 'id',
500 'type' => CRM_Utils_Type::T_INT,
501 'title' => ts('Event ID') ,
502 'description' => 'Event',
503 'required' => true,
504 ) ,
505 'event_title' => array(
506 'name' => 'title',
507 'type' => CRM_Utils_Type::T_STRING,
508 'title' => ts('Event Title') ,
509 'description' => 'Event Title (e.g. Fall Fundraiser Dinner)',
510 'maxlength' => 255,
511 'size' => CRM_Utils_Type::HUGE,
512 'import' => true,
513 'where' => 'civicrm_event.title',
514 'headerPattern' => '/(event.)?title$/i',
515 'dataPattern' => '',
516 'export' => true,
517 'html' => array(
518 'type' => 'Text',
519 ) ,
520 ) ,
521 'summary' => array(
522 'name' => 'summary',
523 'type' => CRM_Utils_Type::T_TEXT,
524 'title' => ts('Event Summary') ,
525 'description' => '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.',
526 'rows' => 4,
527 'cols' => 60,
528 'html' => array(
529 'type' => 'TextArea',
530 ) ,
531 ) ,
532 'event_description' => array(
533 'name' => 'description',
534 'type' => CRM_Utils_Type::T_TEXT,
535 'title' => ts('Event Description') ,
536 'description' => 'Full description of event. Text and html allowed. Displayed on built-in Event Information screens.',
537 'rows' => 8,
538 'cols' => 60,
539 'html' => array(
540 'type' => 'TextArea',
541 ) ,
542 ) ,
543 'event_type_id' => array(
544 'name' => 'event_type_id',
545 'type' => CRM_Utils_Type::T_INT,
546 'title' => ts('Event Type') ,
547 'description' => 'Event Type ID.Implicit FK to civicrm_option_value where option_group = event_type.',
548 'html' => array(
549 'type' => 'Select',
550 ) ,
551 'pseudoconstant' => array(
552 'optionGroupName' => 'event_type',
553 'optionEditPath' => 'civicrm/admin/options/event_type',
554 )
555 ) ,
556 'participant_listing_id' => array(
557 'name' => 'participant_listing_id',
558 'type' => CRM_Utils_Type::T_INT,
559 'title' => ts('Participant Listing') ,
560 'description' => 'Should we expose the participant list? Implicit FK to civicrm_option_value where option_group = participant_listing.',
561 'html' => array(
562 'type' => 'Select',
563 ) ,
564 'pseudoconstant' => array(
565 'optionGroupName' => 'participant_listing',
566 'optionEditPath' => 'civicrm/admin/options/participant_listing',
567 )
568 ) ,
569 'is_public' => array(
570 'name' => 'is_public',
571 'type' => CRM_Utils_Type::T_BOOLEAN,
572 'title' => ts('Is Event Public') ,
573 'description' => 'Public events will be included in the iCal feeds. Access to private event information may be limited using ACLs.',
574 'default' => '1',
575 'html' => array(
576 'type' => 'CheckBox',
577 ) ,
578 ) ,
579 'event_start_date' => array(
580 'name' => 'start_date',
581 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
582 'title' => ts('Event Start Date') ,
583 'description' => 'Date and time that event starts.',
584 'import' => true,
585 'where' => 'civicrm_event.start_date',
586 'headerPattern' => '/^start|(s(tart\s)?date)$/i',
587 'dataPattern' => '',
588 'export' => true,
589 'html' => array(
590 'type' => 'Select Date',
591 ) ,
592 ) ,
593 'event_end_date' => array(
594 'name' => 'end_date',
595 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
596 'title' => ts('Event End Date') ,
597 'description' => 'Date and time that event ends. May be NULL if no defined end date/time',
598 'import' => true,
599 'where' => 'civicrm_event.end_date',
600 'headerPattern' => '/^end|(e(nd\s)?date)$/i',
601 'dataPattern' => '',
602 'export' => true,
603 'html' => array(
604 'type' => 'Select Date',
605 ) ,
606 ) ,
607 'is_online_registration' => array(
608 'name' => 'is_online_registration',
609 'type' => CRM_Utils_Type::T_BOOLEAN,
610 'title' => ts('Is Online Registration') ,
611 'description' => 'If true, include registration link on Event Info page.',
612 'html' => array(
613 'type' => 'CheckBox',
614 ) ,
615 ) ,
616 'registration_link_text' => array(
617 'name' => 'registration_link_text',
618 'type' => CRM_Utils_Type::T_STRING,
619 'title' => ts('Event Registration Link Text') ,
620 'description' => 'Text for link to Event Registration form which is displayed on Event Information screen when is_online_registration is true.',
621 'maxlength' => 255,
622 'size' => CRM_Utils_Type::HUGE,
623 'html' => array(
624 'type' => 'Text',
625 ) ,
626 ) ,
627 'registration_start_date' => array(
628 'name' => 'registration_start_date',
629 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
630 'title' => ts('Registration Start Date') ,
631 'description' => 'Date and time that online registration starts.',
632 'html' => array(
633 'type' => 'Select Date',
634 ) ,
635 ) ,
636 'registration_end_date' => array(
637 'name' => 'registration_end_date',
638 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
639 'title' => ts('Registration End Date') ,
640 'description' => 'Date and time that online registration ends.',
641 'html' => array(
642 'type' => 'Select Date',
643 ) ,
644 ) ,
645 'max_participants' => array(
646 'name' => 'max_participants',
647 'type' => CRM_Utils_Type::T_INT,
648 'title' => ts('Max Participants') ,
649 'description' => '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.',
650 'default' => 'NULL',
651 'html' => array(
652 'type' => 'Text',
653 ) ,
654 ) ,
655 'event_full_text' => array(
656 'name' => 'event_full_text',
657 'type' => CRM_Utils_Type::T_TEXT,
658 'title' => ts('Event Information') ,
659 'description' => '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.',
660 'rows' => 4,
661 'cols' => 60,
662 'html' => array(
663 'type' => 'TextArea',
664 ) ,
665 ) ,
666 'is_monetary' => array(
667 'name' => 'is_monetary',
668 'type' => CRM_Utils_Type::T_BOOLEAN,
669 'title' => ts('Is this a PAID event?') ,
670 'description' => 'If true, one or more fee amounts must be set and a Payment Processor must be configured for Online Event Registration.',
671 'html' => array(
672 'type' => 'CheckBox',
673 ) ,
674 ) ,
675 'financial_type_id' => array(
676 'name' => 'financial_type_id',
677 'type' => CRM_Utils_Type::T_INT,
678 'title' => ts('Financial Type') ,
679 'description' => 'Financial type assigned to paid event registrations for this event. Required if is_monetary is true.',
680 'default' => 'NULL',
681 'html' => array(
682 'type' => 'Select',
683 ) ,
684 'pseudoconstant' => array(
685 'table' => 'civicrm_financial_type',
686 'keyColumn' => 'id',
687 'labelColumn' => 'name',
688 )
689 ) ,
690 'payment_processor' => array(
691 'name' => 'payment_processor',
692 'type' => CRM_Utils_Type::T_STRING,
693 'title' => ts('Payment Processor') ,
694 'description' => 'Payment Processors configured for this Event (if is_monetary is true)',
695 'maxlength' => 128,
696 'size' => CRM_Utils_Type::HUGE,
697 'html' => array(
698 'type' => 'Select',
699 ) ,
700 'pseudoconstant' => array(
701 'table' => 'civicrm_payment_processor',
702 'keyColumn' => 'id',
703 'labelColumn' => 'name',
704 )
705 ) ,
706 'is_map' => array(
707 'name' => 'is_map',
708 'type' => CRM_Utils_Type::T_BOOLEAN,
709 'title' => ts('Map Enabled') ,
710 'description' => 'Include a map block on the Event Information page when geocode info is available and a mapping provider has been specified?',
711 'html' => array(
712 'type' => 'CheckBox',
713 ) ,
714 ) ,
715 'is_active' => array(
716 'name' => 'is_active',
717 'type' => CRM_Utils_Type::T_BOOLEAN,
718 'title' => ts('Is Active') ,
719 'description' => 'Is this Event enabled or disabled/cancelled?',
720 'html' => array(
721 'type' => 'CheckBox',
722 ) ,
723 ) ,
724 'fee_label' => array(
725 'name' => 'fee_label',
726 'type' => CRM_Utils_Type::T_STRING,
727 'title' => ts('Fee Label') ,
728 'maxlength' => 255,
729 'size' => CRM_Utils_Type::HUGE,
730 'import' => true,
731 'where' => 'civicrm_event.fee_label',
732 'headerPattern' => '/^fee|(f(ee\s)?label)$/i',
733 'dataPattern' => '',
734 'export' => true,
735 'html' => array(
736 'type' => 'Text',
737 ) ,
738 ) ,
739 'is_show_location' => array(
740 'name' => 'is_show_location',
741 'type' => CRM_Utils_Type::T_BOOLEAN,
742 'title' => ts('show location') ,
743 'description' => 'If true, show event location.',
744 'default' => '1',
745 'html' => array(
746 'type' => 'CheckBox',
747 ) ,
748 ) ,
749 'loc_block_id' => array(
750 'name' => 'loc_block_id',
751 'type' => CRM_Utils_Type::T_INT,
752 'title' => ts('Location Block ID') ,
753 'description' => 'FK to Location Block ID',
754 'FKClassName' => 'CRM_Core_DAO_LocBlock',
755 ) ,
756 'default_role_id' => array(
757 'name' => 'default_role_id',
758 'type' => CRM_Utils_Type::T_INT,
759 'title' => ts('Default Role') ,
760 'description' => 'Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.',
761 'import' => true,
762 'where' => 'civicrm_event.default_role_id',
763 'headerPattern' => '',
764 'dataPattern' => '',
765 'export' => true,
766 'default' => '1',
767 'html' => array(
768 'type' => 'Select',
769 ) ,
770 'pseudoconstant' => array(
771 'optionGroupName' => 'participant_role',
772 'optionEditPath' => 'civicrm/admin/options/participant_role',
773 )
774 ) ,
775 'intro_text' => array(
776 'name' => 'intro_text',
777 'type' => CRM_Utils_Type::T_TEXT,
778 'title' => ts('Introductory Message') ,
779 'description' => 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
780 'rows' => 6,
781 'cols' => 50,
782 'html' => array(
783 'type' => 'TextArea',
784 ) ,
785 ) ,
786 'footer_text' => array(
787 'name' => 'footer_text',
788 'type' => CRM_Utils_Type::T_TEXT,
789 'title' => ts('Footer Message') ,
790 'description' => 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
791 'rows' => 6,
792 'cols' => 50,
793 'html' => array(
794 'type' => 'TextArea',
795 ) ,
796 ) ,
797 'confirm_title' => array(
798 'name' => 'confirm_title',
799 'type' => CRM_Utils_Type::T_STRING,
800 'title' => ts('Confirmation Title') ,
801 'description' => 'Title for Confirmation page.',
802 'maxlength' => 255,
803 'size' => CRM_Utils_Type::HUGE,
804 'default' => 'NULL',
805 'html' => array(
806 'type' => 'Text',
807 ) ,
808 ) ,
809 'confirm_text' => array(
810 'name' => 'confirm_text',
811 'type' => CRM_Utils_Type::T_TEXT,
812 'title' => ts('Confirm Text') ,
813 'description' => 'Introductory message for Event Registration page. Text and html allowed. Displayed at the top of Event Registration form.',
814 'rows' => 6,
815 'cols' => 50,
816 'html' => array(
817 'type' => 'TextArea',
818 ) ,
819 ) ,
820 'confirm_footer_text' => array(
821 'name' => 'confirm_footer_text',
822 'type' => CRM_Utils_Type::T_TEXT,
823 'title' => ts('Footer Text') ,
824 'description' => 'Footer message for Event Registration page. Text and html allowed. Displayed at the bottom of Event Registration form.',
825 'rows' => 6,
826 'cols' => 50,
827 'html' => array(
828 'type' => 'TextArea',
829 ) ,
830 ) ,
831 'is_email_confirm' => array(
832 'name' => 'is_email_confirm',
833 'type' => CRM_Utils_Type::T_BOOLEAN,
834 'title' => ts('Is confirm email') ,
835 'description' => 'If true, confirmation is automatically emailed to contact on successful registration.',
836 'html' => array(
837 'type' => 'CheckBox',
838 ) ,
839 ) ,
840 'confirm_email_text' => array(
841 'name' => 'confirm_email_text',
842 'type' => CRM_Utils_Type::T_TEXT,
843 'title' => ts('Confirmation Email Text') ,
844 'description' => 'text to include above standard event info on confirmation email. emails are text-only, so do not allow html for now',
845 'rows' => 4,
846 'cols' => 50,
847 'html' => array(
848 'type' => 'TextArea',
849 ) ,
850 ) ,
851 'confirm_from_name' => array(
852 'name' => 'confirm_from_name',
853 'type' => CRM_Utils_Type::T_STRING,
854 'title' => ts('Confirm From Name') ,
855 'description' => 'FROM email name used for confirmation emails.',
856 'maxlength' => 255,
857 'size' => CRM_Utils_Type::HUGE,
858 'html' => array(
859 'type' => 'Text',
860 ) ,
861 ) ,
862 'confirm_from_email' => array(
863 'name' => 'confirm_from_email',
864 'type' => CRM_Utils_Type::T_STRING,
865 'title' => ts('Confirm From Email') ,
866 'description' => 'FROM email address used for confirmation emails.',
867 'maxlength' => 255,
868 'size' => CRM_Utils_Type::HUGE,
869 'html' => array(
870 'type' => 'Text',
871 ) ,
872 ) ,
873 'cc_confirm' => array(
874 'name' => 'cc_confirm',
875 'type' => CRM_Utils_Type::T_STRING,
876 'title' => ts('Cc Confirm') ,
877 'description' => 'comma-separated list of email addresses to cc each time a confirmation is sent',
878 'maxlength' => 255,
879 'size' => CRM_Utils_Type::HUGE,
880 'html' => array(
881 'type' => 'Text',
882 ) ,
883 ) ,
884 'bcc_confirm' => array(
885 'name' => 'bcc_confirm',
886 'type' => CRM_Utils_Type::T_STRING,
887 'title' => ts('Bcc Confirm') ,
888 'description' => 'comma-separated list of email addresses to bcc each time a confirmation is sent',
889 'maxlength' => 255,
890 'size' => CRM_Utils_Type::HUGE,
891 'html' => array(
892 'type' => 'Text',
893 ) ,
894 ) ,
895 'default_fee_id' => array(
896 'name' => 'default_fee_id',
897 'type' => CRM_Utils_Type::T_INT,
898 'title' => ts('Default Fee ID') ,
899 'description' => 'FK to civicrm_option_value.',
900 ) ,
901 'default_discount_fee_id' => array(
902 'name' => 'default_discount_fee_id',
903 'type' => CRM_Utils_Type::T_INT,
904 'title' => ts('Default Discount Fee ID') ,
905 'description' => 'FK to civicrm_option_value.',
906 ) ,
907 'thankyou_title' => array(
908 'name' => 'thankyou_title',
909 'type' => CRM_Utils_Type::T_STRING,
910 'title' => ts('ThankYou Title') ,
911 'description' => 'Title for ThankYou page.',
912 'maxlength' => 255,
913 'size' => CRM_Utils_Type::HUGE,
914 'default' => 'NULL',
915 'html' => array(
916 'type' => 'Text',
917 ) ,
918 ) ,
919 'thankyou_text' => array(
920 'name' => 'thankyou_text',
921 'type' => CRM_Utils_Type::T_TEXT,
922 'title' => ts('ThankYou Text') ,
923 'description' => 'ThankYou Text.',
924 'rows' => 6,
925 'cols' => 50,
926 'html' => array(
927 'type' => 'TextArea',
928 ) ,
929 ) ,
930 'thankyou_footer_text' => array(
931 'name' => 'thankyou_footer_text',
932 'type' => CRM_Utils_Type::T_TEXT,
933 'title' => ts('Footer Text') ,
934 'description' => 'Footer message.',
935 'rows' => 6,
936 'cols' => 50,
937 'html' => array(
938 'type' => 'TextArea',
939 ) ,
940 ) ,
941 'is_pay_later' => array(
942 'name' => 'is_pay_later',
943 'type' => CRM_Utils_Type::T_BOOLEAN,
944 'title' => ts('Pay Later Allowed') ,
945 'description' => 'if true - allows the user to send payment directly to the org later',
946 'html' => array(
947 'type' => 'CheckBox',
948 ) ,
949 ) ,
950 'pay_later_text' => array(
951 'name' => 'pay_later_text',
952 'type' => CRM_Utils_Type::T_TEXT,
953 'title' => ts('Pay Later Text') ,
954 'description' => 'The text displayed to the user in the main form',
955 'html' => array(
956 'type' => 'Text',
957 ) ,
958 ) ,
959 'pay_later_receipt' => array(
960 'name' => 'pay_later_receipt',
961 'type' => CRM_Utils_Type::T_TEXT,
962 'title' => ts('Pay Later Receipt Text') ,
963 'description' => 'The receipt sent to the user instead of the normal receipt text',
964 'html' => array(
965 'type' => 'Text',
966 ) ,
967 ) ,
968 'is_partial_payment' => array(
969 'name' => 'is_partial_payment',
970 'type' => CRM_Utils_Type::T_BOOLEAN,
971 'title' => ts('Partial Payments Enabled') ,
972 'description' => 'is partial payment enabled for this event',
973 'html' => array(
974 'type' => 'CheckBox',
975 ) ,
976 ) ,
977 'initial_amount_label' => array(
978 'name' => 'initial_amount_label',
979 'type' => CRM_Utils_Type::T_STRING,
980 'title' => ts('Initial Amount Label') ,
981 'description' => 'Initial amount label for partial payment',
982 'maxlength' => 255,
983 'size' => CRM_Utils_Type::HUGE,
984 'html' => array(
985 'type' => 'Text',
986 ) ,
987 ) ,
988 'initial_amount_help_text' => array(
989 'name' => 'initial_amount_help_text',
990 'type' => CRM_Utils_Type::T_TEXT,
991 'title' => ts('Initial Amount Help Text') ,
992 'description' => 'Initial amount help text for partial payment',
993 'html' => array(
994 'type' => 'Text',
995 ) ,
996 ) ,
997 'min_initial_amount' => array(
998 'name' => 'min_initial_amount',
999 'type' => CRM_Utils_Type::T_MONEY,
1000 'title' => ts('Minimum Initial Amount') ,
1001 'description' => 'Minimum initial amount for partial payment',
1002 'precision' => array(
1003 20,
1004 2
1005 ) ,
1006 'html' => array(
1007 'type' => 'Text',
1008 ) ,
1009 ) ,
1010 'is_multiple_registrations' => array(
1011 'name' => 'is_multiple_registrations',
1012 'type' => CRM_Utils_Type::T_BOOLEAN,
1013 'title' => ts('Allow Multiple Registrations') ,
1014 'description' => 'if true - allows the user to register multiple participants for event',
1015 'html' => array(
1016 'type' => 'CheckBox',
1017 ) ,
1018 ) ,
1019 'max_additional_participants' => array(
1020 'name' => 'max_additional_participants',
1021 'type' => CRM_Utils_Type::T_INT,
1022 'title' => ts('Maximum number of additional participants per registration') ,
1023 'description' => 'Maximum number of additional participants that can be registered on a single booking',
1024 ) ,
1025 'allow_same_participant_emails' => array(
1026 'name' => 'allow_same_participant_emails',
1027 'type' => CRM_Utils_Type::T_BOOLEAN,
1028 'title' => ts('Does Event allow multiple registrations from same email address?') ,
1029 'description' => 'if true - allows the user to register multiple registrations from same email address.',
1030 'html' => array(
1031 'type' => 'CheckBox',
1032 ) ,
1033 ) ,
1034 'has_waitlist' => array(
1035 'name' => 'has_waitlist',
1036 'type' => CRM_Utils_Type::T_BOOLEAN,
1037 'title' => ts('Waitlist Enabled') ,
1038 'description' => 'Whether the event has waitlist support.',
1039 'html' => array(
1040 'type' => 'CheckBox',
1041 ) ,
1042 ) ,
1043 'requires_approval' => array(
1044 'name' => 'requires_approval',
1045 'type' => CRM_Utils_Type::T_BOOLEAN,
1046 'title' => ts('Requires Approval') ,
1047 'description' => 'Whether participants require approval before they can finish registering.',
1048 'html' => array(
1049 'type' => 'CheckBox',
1050 ) ,
1051 ) ,
1052 'expiration_time' => array(
1053 'name' => 'expiration_time',
1054 'type' => CRM_Utils_Type::T_INT,
1055 'title' => ts('Expiration Time') ,
1056 'description' => 'Expire pending but unconfirmed registrations after this many hours.',
1057 'html' => array(
1058 'type' => 'Text',
1059 ) ,
1060 ) ,
1061 'allow_selfcancelxfer' => array(
1062 'name' => 'allow_selfcancelxfer',
1063 'type' => CRM_Utils_Type::T_BOOLEAN,
1064 'title' => ts('Allow Self-service Cancellation or Transfer') ,
1065 'description' => 'Allow self service cancellation or transfer for event?',
1066 'html' => array(
1067 'type' => 'CheckBox',
1068 ) ,
1069 ) ,
1070 'selfcancelxfer_time' => array(
1071 'name' => 'selfcancelxfer_time',
1072 'type' => CRM_Utils_Type::T_INT,
1073 'title' => ts('Self-service Cancellation or Transfer Time') ,
1074 'description' => 'Number of hours prior to event start date to allow self-service cancellation or transfer.',
1075 'html' => array(
1076 'type' => 'Text',
1077 ) ,
1078 ) ,
1079 'waitlist_text' => array(
1080 'name' => 'waitlist_text',
1081 'type' => CRM_Utils_Type::T_TEXT,
1082 'title' => ts('Waitlist Text') ,
1083 'description' => 'Text to display when the event is full, but participants can signup for a waitlist.',
1084 'rows' => 4,
1085 'cols' => 60,
1086 'html' => array(
1087 'type' => 'TextArea',
1088 ) ,
1089 ) ,
1090 'approval_req_text' => array(
1091 'name' => 'approval_req_text',
1092 'type' => CRM_Utils_Type::T_TEXT,
1093 'title' => ts('Approval Req Text') ,
1094 'description' => 'Text to display when the approval is required to complete registration for an event.',
1095 'rows' => 4,
1096 'cols' => 60,
1097 'html' => array(
1098 'type' => 'TextArea',
1099 ) ,
1100 ) ,
1101 'is_template' => array(
1102 'name' => 'is_template',
1103 'type' => CRM_Utils_Type::T_BOOLEAN,
1104 'title' => ts('Is an Event Template') ,
1105 'description' => 'whether the event has template',
1106 'required' => true,
1107 'html' => array(
1108 'type' => 'CheckBox',
1109 ) ,
1110 ) ,
1111 'template_title' => array(
1112 'name' => 'template_title',
1113 'type' => CRM_Utils_Type::T_STRING,
1114 'title' => ts('Event Template Title') ,
1115 'description' => 'Event Template Title',
1116 'maxlength' => 255,
1117 'size' => CRM_Utils_Type::HUGE,
1118 'import' => true,
1119 'where' => 'civicrm_event.template_title',
1120 'headerPattern' => '/(template.)?title$/i',
1121 'dataPattern' => '',
1122 'export' => true,
1123 'html' => array(
1124 'type' => 'Text',
1125 ) ,
1126 ) ,
1127 'created_id' => array(
1128 'name' => 'created_id',
1129 'type' => CRM_Utils_Type::T_INT,
1130 'title' => ts('Created By Contact ID') ,
1131 'description' => 'FK to civicrm_contact, who created this event',
1132 'FKClassName' => 'CRM_Contact_DAO_Contact',
1133 ) ,
1134 'created_date' => array(
1135 'name' => 'created_date',
1136 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
1137 'title' => ts('Event Created Date') ,
1138 'description' => 'Date and time that event was created.',
1139 ) ,
1140 'currency' => array(
1141 'name' => 'currency',
1142 'type' => CRM_Utils_Type::T_STRING,
1143 'title' => ts('Currency') ,
1144 'description' => '3 character string, value from config setting or input via user.',
1145 'maxlength' => 3,
1146 'size' => CRM_Utils_Type::FOUR,
1147 'import' => true,
1148 'where' => 'civicrm_event.currency',
1149 'headerPattern' => '/cur(rency)?/i',
1150 'dataPattern' => '/^[A-Z]{3}$/i',
1151 'export' => true,
1152 'html' => array(
1153 'type' => 'Select',
1154 ) ,
1155 'pseudoconstant' => array(
1156 'table' => 'civicrm_currency',
1157 'keyColumn' => 'name',
1158 'labelColumn' => 'full_name',
1159 'nameColumn' => 'name',
1160 )
1161 ) ,
1162 'campaign_id' => array(
1163 'name' => 'campaign_id',
1164 'type' => CRM_Utils_Type::T_INT,
1165 'title' => ts('Campaign') ,
1166 'description' => 'The campaign for which this event has been created.',
1167 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
1168 'html' => array(
1169 'type' => 'EntityRef',
1170 ) ,
1171 'pseudoconstant' => array(
1172 'table' => 'civicrm_campaign',
1173 'keyColumn' => 'id',
1174 'labelColumn' => 'title',
1175 )
1176 ) ,
1177 'is_share' => array(
1178 'name' => 'is_share',
1179 'type' => CRM_Utils_Type::T_BOOLEAN,
1180 'title' => ts('Is shared through social media') ,
1181 'description' => 'Can people share the event through social media?',
1182 'default' => '1',
1183 'html' => array(
1184 'type' => 'CheckBox',
1185 ) ,
1186 ) ,
1187 'is_confirm_enabled' => array(
1188 'name' => 'is_confirm_enabled',
1189 'type' => CRM_Utils_Type::T_BOOLEAN,
1190 'title' => ts('Is the booking confirmation screen enabled?') ,
1191 'description' => 'If false, the event booking confirmation screen gets skipped',
1192 'default' => '1',
1193 'html' => array(
1194 'type' => 'CheckBox',
1195 ) ,
1196 ) ,
1197 'parent_event_id' => array(
1198 'name' => 'parent_event_id',
1199 'type' => CRM_Utils_Type::T_INT,
1200 'title' => ts('Parent Event ID') ,
1201 'description' => 'Implicit FK to civicrm_event: parent event',
1202 'default' => 'NULL',
1203 'html' => array(
1204 'type' => 'EntityRef',
1205 ) ,
1206 ) ,
1207 'slot_label_id' => array(
1208 'name' => 'slot_label_id',
1209 'type' => CRM_Utils_Type::T_INT,
1210 'title' => ts('Subevent Slot Label ID') ,
1211 'description' => 'Subevent slot label. Implicit FK to civicrm_option_value where option_group = conference_slot.',
1212 'default' => 'NULL',
1213 'html' => array(
1214 'type' => 'Select',
1215 ) ,
1216 ) ,
1217 'dedupe_rule_group_id' => array(
1218 'name' => 'dedupe_rule_group_id',
1219 'type' => CRM_Utils_Type::T_INT,
1220 'title' => ts('Dedupe Rule') ,
1221 'description' => 'Rule to use when matching registrations for this event',
1222 'default' => 'NULL',
1223 'FKClassName' => 'CRM_Dedupe_DAO_RuleGroup',
1224 'html' => array(
1225 'type' => 'Select',
1226 ) ,
1227 'pseudoconstant' => array(
1228 'table' => 'civicrm_dedupe_rule_group',
1229 'keyColumn' => 'id',
1230 'labelColumn' => 'title',
1231 'nameColumn' => 'name',
1232 )
1233 ) ,
1234 'is_billing_required' => array(
1235 'name' => 'is_billing_required',
1236 'type' => CRM_Utils_Type::T_BOOLEAN,
1237 'title' => ts('Is billing block required') ,
1238 'description' => 'if true than billing block is required this event',
1239 'html' => array(
1240 'type' => 'CheckBox',
1241 ) ,
1242 ) ,
1243 );
1244 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1245 }
1246 return Civi::$statics[__CLASS__]['fields'];
1247 }
1248 /**
1249 * Return a mapping from field-name to the corresponding key (as used in fields()).
1250 *
1251 * @return array
1252 * Array(string $name => string $uniqueName).
1253 */
1254 static function &fieldKeys() {
1255 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1256 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1257 }
1258 return Civi::$statics[__CLASS__]['fieldKeys'];
1259 }
1260 /**
1261 * Returns the names of this table
1262 *
1263 * @return string
1264 */
1265 static function getTableName() {
1266 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
1267 }
1268 /**
1269 * Returns if this table needs to be logged
1270 *
1271 * @return boolean
1272 */
1273 function getLog() {
1274 return self::$_log;
1275 }
1276 /**
1277 * Returns the list of fields that can be imported
1278 *
1279 * @param bool $prefix
1280 *
1281 * @return array
1282 */
1283 static function &import($prefix = false) {
1284 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'event', $prefix, array());
1285 return $r;
1286 }
1287 /**
1288 * Returns the list of fields that can be exported
1289 *
1290 * @param bool $prefix
1291 *
1292 * @return array
1293 */
1294 static function &export($prefix = false) {
1295 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'event', $prefix, array());
1296 return $r;
1297 }
1298 }