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