3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * One place to store frequently used values in Select Elements. Note that
30 * some of the below elements will be dynamic, so we'll probably have a
31 * smart caching scheme on a per domain basis
34 * @copyright CiviCRM LLC (c) 2004-2014
38 class CRM_Core_SelectValues
{
40 /**CRM/Core/SelectValues.php
41 * different types of phones
44 static function &phoneType() {
45 static $phoneType = NULL;
48 '' => ts('- select -'),
49 'Phone' => ts('Phone'),
50 'Mobile' => ts('Mobile'),
52 'Pager' => ts('Pager'),
59 * preferred mail format
62 static function &pmf() {
78 static function &privacy() {
79 static $privacy = NULL;
82 'do_not_phone' => ts('Do not phone'),
83 'do_not_email' => ts('Do not email'),
84 'do_not_mail' => ts('Do not mail'),
85 'do_not_sms' => ts('Do not sms'),
86 'do_not_trade' => ts('Do not trade'),
87 'is_opt_out' => ts('No bulk emails (User Opt Out)'),
94 * various pre defined contact super types
97 static function &contactType() {
98 static $contactType = NULL;
100 $contactType = CRM_Contact_BAO_ContactType
::basicTypePairs();
106 * various pre defined unit list
109 static function &unitList($unitType = NULL) {
110 static $unitList = NULL;
113 '' => ts('- select -'),
115 'month' => ts('month'),
116 'year' => ts('year'),
118 if ($unitType == 'duration') {
120 'lifetime' => ts('lifetime'),
122 $unitList = array_merge($unitList, $unitAdd);
129 * membership type unit
132 static function membershipTypeUnitList( ) {
133 static $membershipTypeUnitList = NULL;
134 if (!$membershipTypeUnitList) {
135 $membershipTypeUnitList = self
::unitList('duration');
137 return $membershipTypeUnitList;
141 * various pre defined period types
144 static function &periodType() {
145 static $periodType = NULL;
148 '' => ts('- select -'),
149 'rolling' => ts('Rolling'),
150 'fixed' => ts('Fixed'),
157 * various pre defined member visibility options
160 static function &memberVisibility() {
161 static $visible = NULL;
164 'Public' => ts('Public'),
165 'Admin' => ts('Admin'),
172 * various pre defined event dates
175 static function &eventDate() {
176 static $eventDate = NULL;
179 '' => ts('- select -'),
180 'start_date' => ts('start date'),
181 'end_date' => ts('end date'),
182 'join_date' => ts('member since'),
189 * Custom form field types
192 static function &customHtmlType() {
193 static $customHtmlType = NULL;
194 if (!$customHtmlType) {
195 $customHtmlType = array(
196 '' => ts('- select -'),
197 'Text' => ts('Single-line input field (text or numeric)'),
198 'TextArea' => ts('Multi-line text box (textarea)'),
199 'Select' => ts('Drop-down (select list)'),
200 'Radio' => ts('Radio buttons'),
201 'CheckBox' => ts('Checkbox(es)'),
202 'Select Date' => ts('Select Date'),
203 'File' => ts('File'),
204 'Select State/Province' => ts('Select State/Province'),
205 'Multi-Select State/Province' => ts('Multi-Select State/Province'),
206 'Select Country' => ts('Select Country'),
207 'Multi-Select Country' => ts('Multi-Select Country'),
208 'RichTextEditor' => ts('Rich Text Editor'),
209 'Autocomplete-Select' => ts('Autocomplete-Select'),
210 'Multi-Select' => ts('Multi-Select'),
211 'AdvMulti-Select' => ts('AdvMulti-Select'),
212 'Link' => ts('Link'),
213 'ContactReference' => ts('Autocomplete Select'),
216 return $customHtmlType;
220 * various pre defined extensions for dynamic properties and groups
224 static function &customGroupExtends() {
225 static $customGroupExtends = NULL;
226 if (!$customGroupExtends) {
227 $customGroupExtends = array(
228 'Activity' => ts('Activities'),
229 'Relationship' => ts('Relationships'),
230 'Contribution' => ts('Contributions'),
231 'Group' => ts('Groups'),
232 'Membership' => ts('Memberships'),
233 'Event' => ts('Events'),
234 'Participant' => ts('Participants'),
235 'ParticipantRole' => ts('Participants (Role)'),
236 'ParticipantEventName' => ts('Participants (Event Name)'),
237 'ParticipantEventType' => ts('Participants (Event Type)'),
238 'Pledge' => ts('Pledges'),
239 'Grant' => ts('Grants'),
240 'Address' => ts('Addresses'),
241 'Campaign' => ts('Campaigns'),
243 $contactTypes = self
::contactType();
244 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
245 $extendObjs = CRM_Core_OptionGroup
::values('cg_extend_objects');
246 $customGroupExtends = array_merge($contactTypes, $customGroupExtends, $extendObjs);
248 return $customGroupExtends;
252 * styles for displaying the custom data group
256 static function &customGroupStyle() {
257 static $customGroupStyle = NULL;
258 if (!$customGroupStyle) {
259 $customGroupStyle = array(
261 'Inline' => ts('Inline'),
262 'Tab with table' => ts('Tab with table'),
265 return $customGroupStyle;
269 * for displaying the uf group types
273 static function &ufGroupTypes() {
274 static $ufGroupType = NULL;
276 $ufGroupType = array(
277 'Profile' => ts('Standalone Form or Directory'),
278 'Search Profile' => ts('Search Views'),
280 $config = CRM_Core_Config
::singleton();
281 if ($config->userSystem
->supports_form_extensions
) {
282 $ufGroupType +
= array(
283 'User Registration' => ts('Drupal User Registration'),
284 'User Account' => ts('View/Edit Drupal User Account'),
292 * the status of a contact within a group
296 static function &groupContactStatus() {
297 static $groupContactStatus = NULL;
298 if (!$groupContactStatus) {
299 $groupContactStatus = array(
300 'Added' => ts('Added'),
301 'Removed' => ts('Removed'),
302 'Pending' => ts('Pending'),
305 return $groupContactStatus;
309 * list of Group Types
312 static function &groupType() {
313 static $groupType = NULL;
316 'query' => ts('Dynamic'),
317 'static' => ts('Static'),
324 * compose the parameters for a date select object
326 * @param string|NULL $type the type of date
327 * @param string|NULL $format date format ( QF format)
329 * @return array the date array
332 static function &date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL) {
335 'addEmptyOption' => TRUE,
336 'emptyOptionText' => ts('- select -'),
337 'emptyOptionValue' => '',
341 $date['format'] = $format;
345 $dao = new CRM_Core_DAO_PreferencesDate();
347 if (!$dao->find(TRUE)) {
348 CRM_Core_Error
::fatal();
352 if ($type == 'creditCard') {
353 $minOffset = $dao->start
;
354 $maxOffset = $dao->end
;
355 $date['format'] = $dao->date_format
;
356 $date['addEmptyOption'] = TRUE;
357 $date['emptyOptionText'] = ts('- select -');
358 $date['emptyOptionValue'] = '';
361 if (empty($date['format'])) {
362 $date['format'] = 'M d';
367 $date['minYear'] = $year - $minOffset;
368 $date['maxYear'] = $year +
$maxOffset;
373 * values for UF form visibility options
377 static function ufVisibility() {
378 static $_visibility = array();
380 $_visibility = array(
381 'User and User Admin Only' => ts('User and User Admin Only'),
382 'Public Pages' => ts('Public Pages'),
383 'Public Pages and Listings' => ts('Public Pages and Listings'),
390 * values for group form visibility options
394 static function groupVisibility() {
395 static $_groupVisibility = NULL;
396 if (!$_groupVisibility) {
397 $_groupVisibility = array(
398 'User and User Admin Only' => ts('User and User Admin Only'),
399 'Public Pages' => ts('Public Pages'),
402 return $_groupVisibility;
406 * different type of Mailing Components
411 static function &mailingComponents() {
412 static $components = NULL;
415 $components = array('Header' => ts('Header'),
416 'Footer' => ts('Footer'),
417 'Reply' => ts('Reply Auto-responder'),
418 'OptOut' => ts('Opt-out Message'),
419 'Subscribe' => ts('Subscription Confirmation Request'),
420 'Welcome' => ts('Welcome Message'),
421 'Unsubscribe' => ts('Unsubscribe Message'),
422 'Resubscribe' => ts('Resubscribe Message'),
429 * Function to get hours
434 function getHours() {
436 for ($i = 0; $i <= 6; $i++
) {
443 * Function to get minutes
448 function getMinutes() {
450 for ($i = 0; $i < 60; $i = $i +
15) {
457 * Function to get the Map Provider
459 * @return array $map array of map providers
462 static function mapProvider() {
465 return CRM_Utils_System
::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
471 * Function to get the Geocoding Providers from available plugins
473 * @return array $geo array of geocoder providers
476 static function geoProvider() {
479 return CRM_Utils_System
::getPluginList('CRM/Utils/Geocode');
485 * Function to get the Address Standardization Providers from available
488 * @return array $addr array of address standardization providers
491 static function addressProvider() {
494 return CRM_Utils_System
::getPluginList('CRM/Utils/Address',
503 * different type of Mailing Tokens
508 static function &mailingTokens() {
509 static $tokens = NULL;
512 $tokens = array('{action.unsubscribe}' => ts('Unsubscribe via email'),
513 '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'),
514 '{action.resubscribe}' => ts('Resubscribe via email'),
515 '{action.resubscribeUrl}' => ts('Resubscribe via web page'),
516 '{action.optOut}' => ts('Opt out via email'),
517 '{action.optOutUrl}' => ts('Opt out via web page'),
518 '{action.forward}' => ts('Forward this email (link)'),
519 '{action.reply}' => ts('Reply to this email (link)'),
520 '{action.subscribeUrl}' => ts('Subscribe via web page'),
521 '{domain.name}' => ts('Domain name'),
522 '{domain.address}' => ts('Domain (organization) address'),
523 '{domain.phone}' => ts('Domain (organization) phone'),
524 '{domain.email}' => ts('Domain (organization) email'),
525 '{mailing.name}' => ts('Mailing name'),
526 '{mailing.group}' => ts('Mailing group'),
527 '{mailing.viewUrl}' => ts('Mailing permalink'),
534 * different type of Activity Tokens
539 static function &activityTokens() {
540 static $tokens = NULL;
544 '{activity.activity_id}' => ts('Activity ID'),
545 '{activity.subject}' => ts('Activity Subject'),
546 '{activity.details}' => ts('Activity Details'),
547 '{activity.activity_date_time}' => ts('Activity Date Time'),
554 * different type of Membership Tokens
559 static function &membershipTokens() {
560 static $tokens = NULL;
564 '{membership.id}' => ts('Membership ID'),
565 '{membership.status}' => ts('Membership Status'),
566 '{membership.type}' => ts('Membership Type'),
567 '{membership.start_date}' => ts('Membership Start Date'),
568 '{membership.join_date}' => ts('Membership Join Date'),
569 '{membership.end_date}' => ts('Membership End Date'),
570 '{membership.fee}' => ts('Membership Fee'),
577 * different type of Event Tokens
582 static function &eventTokens() {
583 static $tokens = NULL;
587 '{event.event_id}' => ts('Event ID'),
588 '{event.title}' => ts('Event Title'),
589 '{event.start_date}' => ts('Event Start Date'),
590 '{event.end_date}' => ts('Event End Date'),
591 '{event.event_type}' => ts('Event Type'),
592 '{event.summary}' => ts('Event Summary'),
593 '{event.contact_email}' => ts('Event Contact Email'),
594 '{event.contact_phone}' => ts('Event Contact Phone'),
595 '{event.description}' => ts('Event Description'),
596 '{event.location}' => ts('Event Location'),
597 '{event.fee_amount}' => ts('Event Fees'),
598 '{event.info_url}' => ts('Event Info URL'),
599 '{event.registration_url}' => ts('Event Registration URL'),
600 '{event.balance}' => ts('Event Balance')
607 * different type of Event Tokens
612 static function &contributionTokens() {
613 static $tokens = NULL;
617 '{contribution.contribution_id}' => ts('Contribution ID'),
618 '{contribution.total_amount}' => ts('Total Amount'),
619 '{contribution.fee_amount}' => ts('Fee Amount'),
620 '{contribution.net_amount}' => ts('Net Amount'),
621 '{contribution.non_deductible_amount}' => ts('Non Deductible Amount'),
622 '{contribution.receive_date}' => ts('Contribution Receive Date'),
623 '{contribution.payment_instrument}' => ts('Payment Instrument'),
624 '{contribution.trxn_id}' => ts('Transaction ID'),
625 '{contribution.invoice_id}' => ts('Invoice ID'),
626 '{contribution.currency}' => ts('Currency'),
627 '{contribution.cancel_date}' => ts('Contribution Cancel Date'),
628 '{contribution.cancel_reason}' => ts('Contribution Cancel Reason'),
629 '{contribution.receipt_date}' => ts('Receipt Date'),
630 '{contribution.thankyou_date}' => ts('Thank You Date'),
631 '{contribution.contribution_source}' => ts('Contribution Source'),
632 '{contribution.amount_level}' => ts('Amount Level'),
633 //'{contribution.contribution_recur_id}' => ts('Contribution Recurring ID'),
634 //'{contribution.honor_contact_id}' => ts('Honor Contact ID'),
635 '{contribution.contribution_status_id}' => ts('Contribution Status'),
636 //'{contribution.honor_type_id}' => ts('Honor Type ID'),
637 //'{contribution.address_id}' => ts('Address ID'),
638 '{contribution.check_number}' => ts('Check Number'),
639 '{contribution.campaign}' => ts('Contribution Campaign'),
646 * different type of Contact Tokens
651 static function &contactTokens() {
652 static $tokens = NULL;
654 $additionalFields = array('checksum' => array('title' => ts('Checksum')),
655 'contact_id' => array('title' => ts('Internal Contact ID')),
657 $exportFields = array_merge(CRM_Contact_BAO_Contact
::exportableFields(), $additionalFields);
659 $values = array_merge(array_keys($exportFields));
662 //FIXME:skipping some tokens for time being.
664 'is_bulkmail', 'group', 'tag', 'contact_sub_type', 'note',
665 'is_deceased', 'deceased_date', 'legal_identifier', 'contact_sub_type', 'user_unique_id',
668 $customFields = CRM_Core_BAO_CustomField
::getFields('Individual');
669 $customFieldsAddress = CRM_Core_BAO_CustomField
::getFields('Address');
670 $customFields = $customFields +
$customFieldsAddress;
671 $legacyTokenNames = array_flip(CRM_Utils_Token
::legacyContactTokens());
673 foreach ($values as $val) {
674 if (in_array($val, $skipTokens)) {
677 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
678 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
679 $tokens["{contact.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
682 // Support legacy token names
683 $tokenName = CRM_Utils_Array
::value($val, $legacyTokenNames, $val);
684 $tokens["{contact.$tokenName}"] = $exportFields[$val]['title'];
688 // might as well get all the hook tokens to
689 $hookTokens = array();
690 CRM_Utils_Hook
::tokens($hookTokens);
691 foreach ($hookTokens as $category => $tokenValues) {
692 foreach ($tokenValues as $key => $value) {
693 if (is_numeric($key)) {
696 if (!preg_match('/^\{[^\}]+\}$/', $key)) {
697 $key = '{' . $key . '}';
699 if (preg_match('/^\{([^\}]+)\}$/', $value, $matches)) {
700 $value = $matches[1];
702 $tokens[$key] = $value;
711 * different type of Participant Tokens
716 static function &participantTokens() {
717 static $tokens = NULL;
719 $exportFields = CRM_Event_BAO_Participant
::exportableFields();
721 $values = array_merge(array_keys($exportFields));
724 // skipping some tokens for time being.
726 'event_id', 'participant_is_pay_later', 'participant_is_test', 'participant_contact_id',
727 'participant_fee_currency', 'participant_campaign_id', 'participant_status', 'participant_discount_name',
730 $customFields = CRM_Core_BAO_CustomField
::getFields('Participant');
732 foreach ($values as $key => $val) {
733 if (in_array($val, $skipTokens)) {
736 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
737 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
738 $tokens["{participant.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
741 $tokens["{participant.$val}"] = $exportFields[$val]['title'];
749 * get qf mappig for all date parts.
752 static function &qfDatePartsMapping() {
753 static $qfDatePartsMapping = NULL;
754 if (!$qfDatePartsMapping) {
755 $qfDatePartsMapping = array(
774 return $qfDatePartsMapping;
778 * CiviCRM supported date input formats
780 static function getDatePluginInputFormats() {
781 $dateInputFormats = array(
782 "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'),
783 "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'),
784 "yy-mm-dd" => ts('yyyy-mm-dd (2009-12-31)'),
785 "dd-mm-yy" => ts('dd-mm-yyyy (31-12-2009)'),
786 'dd.mm.yy' => ts('dd.mm.yyyy (31.12.2009)'),
787 "M d, yy" => ts('M d, yyyy (Dec 31, 2009)'),
788 'd M yy' => ts('d M yyyy (31 Dec 2009)'),
789 "MM d, yy" => ts('MM d, yyyy (December 31, 2009)'),
790 'd MM yy' => ts('d MM yyyy (31 December 2009)'),
791 "DD, d MM yy" => ts('DD, d MM yyyy (Thursday, 31 December 2009)'),
792 "mm/dd" => ts('mm/dd (12/31)'),
793 "dd-mm" => ts('dd-mm (31-12)'),
794 "yy-mm" => ts('yyyy-mm (2009-12)'),
795 'M yy' => ts('M yyyy (Dec 2009)'),
796 "yy" => ts('yyyy (2009)'),
800 Year greater than 2000 get wrong result for following format
801 echo date( 'Y-m-d', strtotime( '7 Nov, 2001') );
802 echo date( 'Y-m-d', strtotime( '7 November, 2001') );
804 expected :: 2001-11-07
807 echo date( 'Y-m-d', strtotime( 'Nov 7, 2001') );
808 echo date( 'Y-m-d', strtotime( 'November 7, 2001') );
813 return $dateInputFormats;
817 * Map date plugin and actual format that is used by PHP
819 static function datePluginToPHPFormats() {
820 $dateInputFormats = array(
821 "mm/dd/yy" => 'm/d/Y',
822 "dd/mm/yy" => 'd/m/Y',
823 "yy-mm-dd" => 'Y-m-d',
824 "dd-mm-yy" => 'd-m-Y',
825 "dd.mm.yy" => 'd.m.Y',
826 "M d, yy" => 'M j, Y',
828 "MM d, yy" => 'F j, Y',
829 "d MM yy" => 'j F Y',
830 "DD, d MM yy" => 'l, j F Y',
837 return $dateInputFormats;
843 static function getTimeFormats() {
844 $timeFormats = array('1' => ts('12 Hours'),
845 '2' => ts('24 Hours'),
851 * Function to get numeric options
856 public static function getNumericOptions($start = 0, $end = 10) {
857 $numericOptions = array();
858 for ($i = $start; $i <= $end; $i++
) {
859 $numericOptions[$i] = $i;
861 return $numericOptions;
868 static function getBarcodeTypes() {
869 static $barcodeTypes = NULL;
870 if (!$barcodeTypes) {
871 $barcodeTypes = array(
872 'barcode' => ts('Linear (1D)'),
873 'qrcode' => ts('QR code'),
876 return $barcodeTypes;
882 static function getDedupeRuleTypes() {
883 static $dedupeRuleTypes = NULL;
884 if (!$dedupeRuleTypes) {
885 $dedupeRuleTypes = array(
886 'Unsupervised' => ts('Unsupervised'),
887 'Supervised' => ts('Supervised'),
888 'General' => ts('General'),
891 return $dedupeRuleTypes;
895 * campaign group types
897 static function getCampaignGroupTypes() {
898 static $campaignGroupTypes = NULL;
899 if (!$campaignGroupTypes) {
900 $campaignGroupTypes = array(
901 'Include' => ts('Include'),
902 'Exclude' => ts('Exclude'),
905 return $campaignGroupTypes;
909 * subscription history method
911 static function getSubscriptionHistoryMethods() {
912 static $subscriptionHistoryMethods = NULL;
913 if (!$subscriptionHistoryMethods) {
914 $subscriptionHistoryMethods = array(
915 'Admin' => ts('Admin'),
916 'Email' => ts('Email'),
922 return $subscriptionHistoryMethods;
928 static function getPremiumUnits() {
929 static $premiumUnits = NULL;
930 if (!$premiumUnits) {
931 $premiumUnits = array(
933 'week' => ts('Week'),
934 'month' => ts('Month'),
935 'year' => ts('Year'),
939 return $premiumUnits;
945 static function getExtensionTypes() {
946 static $extensionTypes = NULL;
947 if (!$extensionTypes) {
948 $extensionTypes = array(
949 'payment' => ts('Payment'),
950 'search' => ts('Search'),
951 'report' => ts('Report'),
952 'module' => ts('Module'),
957 return $extensionTypes;
963 static function getJobFrequency() {
964 static $jobFrequency = NULL;
965 if (!$jobFrequency) {
966 $jobFrequency = array(
967 'Daily' => ts('Daily'),
968 'Hourly' => ts('Hourly'),
969 'Always' => ts('Every time cron job is run'),
973 return $jobFrequency;
977 * Search builder operators
979 static function getSearchBuilderOperators() {
980 static $searchBuilderOperators = NULL;
981 if (!$searchBuilderOperators) {
982 $searchBuilderOperators = array(
990 'LIKE' => ts('Like'),
991 'RLIKE' => ts('Regex'),
992 'IS EMPTY' => ts('Is Empty'),
993 'IS NOT EMPTY' => ts('Not Empty'),
994 'IS NULL' => ts('Is Null'),
995 'IS NOT NULL' => ts('Not Null'),
999 return $searchBuilderOperators;
1003 * profile group types
1007 static function getProfileGroupType() {
1008 static $profileGroupType = NULL;
1009 if (!$profileGroupType) {
1010 $profileGroupType = array(
1011 'Activity' => ts('Activities'),
1012 'Contribution' => ts('Contributions'),
1013 'Membership' => ts('Memberships'),
1014 'Participant' => ts('Participants'),
1016 $contactTypes = self
::contactType();
1017 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
1018 $profileGroupType = array_merge($contactTypes, $profileGroupType );
1020 return $profileGroupType;
1025 * word replacement match type
1027 static function getWordReplacementMatchType() {
1028 static $wordReplacementMatchType = NULL;
1029 if (!$wordReplacementMatchType) {
1030 $wordReplacementMatchType = array(
1031 'exactMatch' => ts('Exact Match'),
1032 'wildcardMatch' => ts('Wildcard Match'),
1036 return $wordReplacementMatchType;
1040 * mailing group types
1042 static function getMailingGroupTypes() {
1043 static $mailingGroupTypes = NULL;
1044 if (!$mailingGroupTypes) {
1045 $mailingGroupTypes = array(
1046 'Include' => ts('Include'),
1047 'Exclude' => ts('Exclude'),
1048 'Base' => ts('Base'),
1051 return $mailingGroupTypes;
1055 * Mailing Job Status
1057 static function getMailingJobStatus() {
1058 static $mailingJobStatus = NULL;
1059 if (!$mailingJobStatus) {
1060 $mailingJobStatus = array(
1061 'Scheduled' => ts('Scheduled'),
1062 'Running' => ts('Running'),
1063 'Complete' => ts('Complete'),
1064 'Paused' => ts('Paused'),
1065 'Canceled' => ts('Canceled'),
1069 return $mailingJobStatus;
1073 * Frequency unit for schedule reminders
1075 static function getScheduleReminderFrequencyUnits() {
1076 static $scheduleReminderFrequencyUnits = NULL;
1077 if (!$scheduleReminderFrequencyUnits) {
1078 $scheduleReminderFrequencyUnits = array(
1079 'hour' => ts('hour')) + CRM_Core_OptionGroup
::values('recur_frequency_units');
1082 return $scheduleReminderFrequencyUnits;