3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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-2013
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 'Date' => ts('Select Date'),
203 'File' => ts('File'),
204 'StateProvince' => ts('Select State/Province'),
205 'Country' => ts('Select Country'),
206 'RichTextEditor' => ts('Rich Text Editor'),
207 'Autocomplete-Select' => ts('Autocomplete-Select'),
208 'Multi-Select' => ts('Multi-Select'),
209 'AdvMulti-Select' => ts('AdvMulti-Select'),
210 'Link' => ts('Link'),
211 'ContactReference' => ts('Autocomplete Select'),
214 return $customHtmlType;
218 * various pre defined extensions for dynamic properties and groups
222 static function &customGroupExtends() {
223 static $customGroupExtends = NULL;
224 if (!$customGroupExtends) {
225 $customGroupExtends = array(
226 'Activity' => ts('Activities'),
227 'Relationship' => ts('Relationships'),
228 'Contribution' => ts('Contributions'),
229 'Group' => ts('Groups'),
230 'Membership' => ts('Memberships'),
231 'Event' => ts('Events'),
232 'Participant' => ts('Participants'),
233 'ParticipantRole' => ts('Participants (Role)'),
234 'ParticipantEventName' => ts('Participants (Event Name)'),
235 'ParticipantEventType' => ts('Participants (Event Type)'),
236 'Pledge' => ts('Pledges'),
237 'Grant' => ts('Grants'),
238 'Address' => ts('Addresses'),
239 'Campaign' => ts('Campaigns'),
241 $contactTypes = self
::contactType();
242 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
243 $extendObjs = CRM_Core_OptionGroup
::values('cg_extend_objects');
244 $customGroupExtends = array_merge($contactTypes, $customGroupExtends, $extendObjs);
246 return $customGroupExtends;
250 * styles for displaying the custom data group
254 static function &customGroupStyle() {
255 static $customGroupStyle = NULL;
256 if (!$customGroupStyle) {
257 $customGroupStyle = array(
259 'Inline' => ts('Inline'),
260 'Tab with table' => ts('Tab with table'),
263 return $customGroupStyle;
267 * for displaying the uf group types
271 static function &ufGroupTypes() {
272 static $ufGroupType = NULL;
274 $ufGroupType = array(
275 'Profile' => ts('Standalone Form or Directory'),
276 'Search Profile' => ts('Search Views'),
278 $config = CRM_Core_Config
::singleton();
279 if ($config->userSystem
->supports_form_extensions
) {
280 $ufGroupType +
= array(
281 'User Registration' => ts('Drupal User Registration'),
282 'User Account' => ts('View/Edit Drupal User Account'),
290 * the status of a contact within a group
294 static function &groupContactStatus() {
295 static $groupContactStatus = NULL;
296 if (!$groupContactStatus) {
297 $groupContactStatus = array(
298 'Added' => ts('Added'),
299 'Removed' => ts('Removed'),
300 'Pending' => ts('Pending'),
303 return $groupContactStatus;
307 * list of Group Types
310 static function &groupType() {
311 static $groupType = NULL;
314 'query' => ts('Dynamic'),
315 'static' => ts('Static'),
322 * compose the parameters for a date select object
324 * @param $type the type of date
325 * @param $format date format ( QF format)
327 * @return array the date array
330 static function &date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL) {
333 'addEmptyOption' => TRUE,
334 'emptyOptionText' => ts('- select -'),
335 'emptyOptionValue' => '',
339 $date['format'] = $format;
343 $dao = new CRM_Core_DAO_PreferencesDate();
345 if (!$dao->find(TRUE)) {
346 CRM_Core_Error
::fatal();
350 if ($type == 'creditCard') {
351 $minOffset = $dao->start
;
352 $maxOffset = $dao->end
;
353 $date['format'] = $dao->date_format
;
354 $date['addEmptyOption'] = TRUE;
355 $date['emptyOptionText'] = ts('- select -');
356 $date['emptyOptionValue'] = '';
359 if (empty($date['format'])) {
360 $date['format'] = 'M d';
365 $date['minYear'] = $year - $minOffset;
366 $date['maxYear'] = $year +
$maxOffset;
371 * values for UF form visibility options
375 static function ufVisibility($isGroup = FALSE) {
382 static $_visibility = array();
385 if (!isset($_visibility[$key])) {
386 $_visibility[$key] = array(
387 'User and User Admin Only' => ts('User and User Admin Only'),
388 'Public Pages' => ts('Public Pages'),
389 'Public Pages and Listings' => ts('Public Pages and Listings'),
392 unset($_visibility[$key]['Public Pages and Listings']);
395 return $_visibility[$key];
399 * values for group form visibility options
403 static function groupVisibility() {
404 static $_groupVisibility = NULL;
405 if (!$_groupVisibility) {
406 $_groupVisibility = self
::ufVisibility(true);
408 return $_groupVisibility;
412 * different type of Mailing Components
417 static function &mailingComponents() {
418 static $components = NULL;
421 $components = array('Header' => ts('Header'),
422 'Footer' => ts('Footer'),
423 'Reply' => ts('Reply Auto-responder'),
424 'OptOut' => ts('Opt-out Message'),
425 'Subscribe' => ts('Subscription Confirmation Request'),
426 'Welcome' => ts('Welcome Message'),
427 'Unsubscribe' => ts('Unsubscribe Message'),
428 'Resubscribe' => ts('Resubscribe Message'),
435 * Function to get hours
440 function getHours() {
441 for ($i = 0; $i <= 6; $i++
) {
448 * Function to get minutes
453 function getMinutes() {
454 for ($i = 0; $i < 60; $i = $i +
15) {
461 * Function to get the Map Provider
463 * @return array $map array of map providers
466 static function mapProvider() {
469 return CRM_Utils_System
::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
475 * Function to get the Geocoding Providers from available plugins
477 * @return array $geo array of geocoder providers
480 static function geoProvider() {
483 return CRM_Utils_System
::getPluginList('CRM/Utils/Geocode');
489 * Function to get the Address Standardization Providers from available
492 * @return array $addr array of address standardization providers
495 static function addressProvider() {
498 return CRM_Utils_System
::getPluginList('CRM/Utils/Address',
507 * different type of Mailing Tokens
512 static function &mailingTokens() {
513 static $tokens = NULL;
516 $tokens = array('{action.unsubscribe}' => ts('Unsubscribe via email'),
517 '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'),
518 '{action.resubscribe}' => ts('Resubscribe via email'),
519 '{action.resubscribeUrl}' => ts('Resubscribe via web page'),
520 '{action.optOut}' => ts('Opt out via email'),
521 '{action.optOutUrl}' => ts('Opt out via web page'),
522 '{action.forward}' => ts('Forward this email (link)'),
523 '{action.reply}' => ts('Reply to this email (link)'),
524 '{action.subscribeUrl}' => ts('Subscribe via web page'),
525 '{domain.name}' => ts('Domain name'),
526 '{domain.address}' => ts('Domain (organization) address'),
527 '{domain.phone}' => ts('Domain (organization) phone'),
528 '{domain.email}' => ts('Domain (organization) email'),
529 '{mailing.name}' => ts('Mailing name'),
530 '{mailing.group}' => ts('Mailing group'),
531 '{mailing.viewUrl}' => ts('Mailing permalink'),
538 * different type of Activity Tokens
543 static function &activityTokens() {
544 static $tokens = NULL;
548 '{activity.activity_id}' => ts('Activity ID'),
549 '{activity.subject}' => ts('Activity Subject'),
550 '{activity.details}' => ts('Activity Details'),
551 '{activity.activity_date_time}' => ts('Activity Date Time'),
558 * different type of Membership Tokens
563 static function &membershipTokens() {
564 static $tokens = NULL;
568 '{membership.id}' => ts('Membership ID'),
569 '{membership.status}' => ts('Membership Status'),
570 '{membership.type}' => ts('Membership Type'),
571 '{membership.start_date}' => ts('Membership Start Date'),
572 '{membership.join_date}' => ts('Membership Join Date'),
573 '{membership.end_date}' => ts('Membership End Date'),
574 '{membership.fee}' => ts('Membership Fee'),
581 * different type of Event Tokens
586 static function &eventTokens() {
587 static $tokens = NULL;
591 '{event.event_id}' => ts('Event ID'),
592 '{event.title}' => ts('Event Title'),
593 '{event.start_date}' => ts('Event Start Date'),
594 '{event.end_date}' => ts('Event End Date'),
595 '{event.event_type}' => ts('Event Type'),
596 '{event.summary}' => ts('Event Summary'),
597 '{event.description}' => ts('Event Description'),
598 '{event.contact_email}' => ts('Event Contact Email'),
599 '{event.contact_phone}' => ts('Event Contact Phone'),
600 '{event.location}' => ts('Event Location'),
601 '{event.description}' => ts('Event Description'),
602 '{event.location}' => ts('Event Location'),
603 '{event.fee_amount}' => ts('Event Fees'),
604 '{event.info_url}' => ts('Event Info URL'),
605 '{event.registration_url}' => ts('Event Registration URL'),
606 '{event.balance}' => ts('Event Balance')
613 * different type of Event Tokens
618 static function &contributionTokens() {
619 static $tokens = NULL;
623 '{contribution.contribution_id}' => ts('Contribution ID'),
624 '{contribution.total_amount}' => ts('Total Amount'),
625 '{contribution.fee_amount}' => ts('Fee Amount'),
626 '{contribution.net_amount}' => ts('Net Amount'),
627 '{contribution.non_deductible_amount}' => ts('Non Deductible Amount'),
628 '{contribution.receive_date}' => ts('Contribution Receive Date'),
629 '{contribution.payment_instrument}' => ts('Payment Instrument'),
630 '{contribution.trxn_id}' => ts('Transaction ID'),
631 '{contribution.invoice_id}' => ts('Invoice ID'),
632 '{contribution.currency}' => ts('Currency'),
633 '{contribution.cancel_date}' => ts('Contribution Cancel Date'),
634 '{contribution.cancel_reason}' => ts('Contribution Cancel Reason'),
635 '{contribution.receipt_date}' => ts('Receipt Date'),
636 '{contribution.thankyou_date}' => ts('Thank You Date'),
637 '{contribution.contribution_source}' => ts('Contribution Source'),
638 '{contribution.amount_level}' => ts('Amount Level'),
639 //'{contribution.contribution_recur_id}' => ts('Contribution Recurring ID'),
640 //'{contribution.honor_contact_id}' => ts('Honor Contact ID'),
641 '{contribution.contribution_status_id}' => ts('Contribution Status'),
642 //'{contribution.honor_type_id}' => ts('Honor Type ID'),
643 //'{contribution.address_id}' => ts('Address ID'),
644 '{contribution.check_number}' => ts('Check Number'),
645 '{contribution.campaign}' => ts('Contribution Campaign'),
652 * different type of Contact Tokens
657 static function &contactTokens() {
658 static $tokens = NULL;
660 $additionalFields = array('checksum' => array('title' => ts('Checksum')),
661 'contact_id' => array('title' => ts('Internal Contact ID')),
663 $exportFields = array_merge(CRM_Contact_BAO_Contact
::exportableFields(), $additionalFields);
665 $values = array_merge(array_keys($exportFields));
668 //FIXME:skipping some tokens for time being.
670 'is_bulkmail', 'group', 'tag', 'contact_sub_type', 'note',
671 'is_deceased', 'deceased_date', 'legal_identifier', 'contact_sub_type', 'user_unique_id',
674 $customFields = CRM_Core_BAO_CustomField
::getFields('Individual');
675 $customFieldsAddress = CRM_Core_BAO_CustomField
::getFields('Address');
676 $customFields = $customFields +
$customFieldsAddress;
677 $legacyTokenNames = array_flip(CRM_Utils_Token
::legacyContactTokens());
679 foreach ($values as $val) {
680 if (in_array($val, $skipTokens)) {
683 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
684 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
685 $tokens["{contact.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
688 // Support legacy token names
689 $tokenName = CRM_Utils_Array
::value($val, $legacyTokenNames, $val);
690 $tokens["{contact.$tokenName}"] = $exportFields[$val]['title'];
694 // might as well get all the hook tokens to
695 $hookTokens = array();
696 CRM_Utils_Hook
::tokens($hookTokens);
697 foreach ($hookTokens as $category => $tokenValues) {
698 foreach ($tokenValues as $key => $value) {
699 if (is_numeric($key)) {
702 if (!preg_match('/^\{[^\}]+\}$/', $key)) {
703 $key = '{' . $key . '}';
705 if (preg_match('/^\{([^\}]+)\}$/', $value, $matches)) {
706 $value = $matches[1];
708 $tokens[$key] = $value;
717 * different type of Participant Tokens
722 static function &participantTokens() {
723 static $tokens = NULL;
725 $exportFields = CRM_Event_BAO_Participant
::exportableFields();
727 $values = array_merge(array_keys($exportFields));
730 // skipping some tokens for time being.
732 'event_id', 'participant_is_pay_later', 'participant_is_test', 'participant_contact_id',
733 'participant_fee_currency', 'participant_campaign_id', 'participant_status', 'participant_discount_name',
736 $customFields = CRM_Core_BAO_CustomField
::getFields('Participant');
738 foreach ($values as $key => $val) {
739 if (in_array($val, $skipTokens)) {
742 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
743 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
744 $tokens["{participant.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
747 $tokens["{participant.$val}"] = $exportFields[$val]['title'];
755 * get qf mappig for all date parts.
758 static function &qfDatePartsMapping() {
759 static $qfDatePartsMapping = NULL;
760 if (!$qfDatePartsMapping) {
761 $qfDatePartsMapping = array(
780 return $qfDatePartsMapping;
784 * CiviCRM supported date input formats
786 static function getDatePluginInputFormats() {
787 $dateInputFormats = array(
788 "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'),
789 "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'),
790 "yy-mm-dd" => ts('yyyy-mm-dd (2009-12-31)'),
791 "dd-mm-yy" => ts('dd-mm-yyyy (31-12-2009)'),
792 'dd.mm.yy' => ts('dd.mm.yyyy (31.12.2009)'),
793 "M d, yy" => ts('M d, yyyy (Dec 31, 2009)'),
794 'd M yy' => ts('d M yyyy (31 Dec 2009)'),
795 "MM d, yy" => ts('MM d, yyyy (December 31, 2009)'),
796 'd MM yy' => ts('d MM yyyy (31 December 2009)'),
797 "DD, d MM yy" => ts('DD, d MM yyyy (Thursday, 31 December 2009)'),
798 "mm/dd" => ts('mm/dd (12/31)'),
799 "dd-mm" => ts('dd-mm (31-12)'),
800 "yy-mm" => ts('yyyy-mm (2009-12)'),
801 'M yy' => ts('M yyyy (Dec 2009)'),
802 "yy" => ts('yyyy (2009)'),
806 Year greater than 2000 get wrong result for following format
807 echo date( 'Y-m-d', strtotime( '7 Nov, 2001') );
808 echo date( 'Y-m-d', strtotime( '7 November, 2001') );
810 expected :: 2001-11-07
813 echo date( 'Y-m-d', strtotime( 'Nov 7, 2001') );
814 echo date( 'Y-m-d', strtotime( 'November 7, 2001') );
819 return $dateInputFormats;
823 * Map date plugin and actual format that is used by PHP
825 static function datePluginToPHPFormats() {
826 $dateInputFormats = array(
827 "mm/dd/yy" => 'm/d/Y',
828 "dd/mm/yy" => 'd/m/Y',
829 "yy-mm-dd" => 'Y-m-d',
830 "dd-mm-yy" => 'd-m-Y',
831 "dd.mm.yy" => 'd.m.Y',
832 "M d, yy" => 'M j, Y',
834 "MM d, yy" => 'F j, Y',
835 "d MM yy" => 'j F Y',
836 "DD, d MM yy" => 'l, j F Y',
843 return $dateInputFormats;
849 static function getTimeFormats() {
850 $timeFormats = array('1' => ts('12 Hours'),
851 '2' => ts('24 Hours'),
857 * Function to get numeric options
862 public static function getNumericOptions($start = 0, $end = 10) {
863 for ($i = $start; $i <= $end; $i++
) {
864 $numericOptions[$i] = $i;
866 return $numericOptions;
873 static function getBarcodeTypes() {
874 static $barcodeTypes = NULL;
875 if (!$barcodeTypes) {
876 $barcodeTypes = array(
877 'barcode' => ts('Linear (1D)'),
878 'qrcode' => ts('QR code'),
881 return $barcodeTypes;
887 static function getDedupeRuleTypes() {
888 static $dedupeRuleTypes = NULL;
889 if (!$dedupeRuleTypes) {
890 $dedupeRuleTypes = array(
891 'Unsupervised' => ts('Unsupervised'),
892 'Supervised' => ts('Supervised'),
893 'General' => ts('General'),
896 return $dedupeRuleTypes;
900 * campaign group types
902 static function getCampaignGroupTypes() {
903 static $campaignGroupTypes = NULL;
904 if (!$campaignGroupTypes) {
905 $campaignGroupTypes = array(
906 'Include' => ts('Include'),
907 'Exclude' => ts('Exclude'),
910 return $campaignGroupTypes;
914 * subscription history method
916 static function getSubscriptionHistoryMethods() {
917 static $subscriptionHistoryMethods = NULL;
918 if (!$subscriptionHistoryMethods) {
919 $subscriptionHistoryMethods = array(
920 'Admin' => ts('Admin'),
921 'Email' => ts('Email'),
927 return $subscriptionHistoryMethods;
933 static function getPremiumUnits() {
934 static $premiumUnits = NULL;
935 if (!$premiumUnits) {
936 $premiumUnits = array(
938 'week' => ts('Week'),
939 'month' => ts('Month'),
940 'year' => ts('Year'),
944 return $premiumUnits;
950 static function getExtensionTypes() {
951 static $extensionTypes = NULL;
952 if (!$extensionTypes) {
953 $extensionTypes = array(
954 'payment' => ts('Payment'),
955 'search' => ts('Search'),
956 'report' => ts('Report'),
957 'module' => ts('Module'),
962 return $extensionTypes;
968 static function getJobFrequency() {
969 static $jobFrequency = NULL;
970 if (!$jobFrequency) {
971 $jobFrequency = array(
972 'Daily' => ts('Daily'),
973 'Hourly' => ts('Hourly'),
974 'Always' => ts('Every time cron job is run'),
978 return $jobFrequency;
982 * Search builder operators
984 static function getSearchBuilderOperators() {
985 static $searchBuilderOperators = NULL;
986 if (!$searchBuilderOperators) {
987 $searchBuilderOperators = array(
995 'LIKE' => ts('Like'),
996 'RLIKE' => ts('Regex'),
997 'IS EMPTY' => ts('Is Empty'),
998 'IS NOT EMPTY' => ts('Not Empty'),
999 'IS NULL' => ts('Is Null'),
1000 'IS NOT NULL' => ts('Not Null'),
1004 return $searchBuilderOperators;
1008 * profile group types
1012 static function getProfileGroupType() {
1013 static $profileGroupType = NULL;
1014 if (!$profileGroupType) {
1015 $profileGroupType = array(
1016 'Activity' => ts('Activities'),
1017 'Contribution' => ts('Contributions'),
1018 'Membership' => ts('Memberships'),
1019 'Participant' => ts('Participants'),
1021 $contactTypes = self
::contactType();
1022 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
1023 $profileGroupType = array_merge($contactTypes, $profileGroupType );
1025 return $profileGroupType;
1030 * word replacement match type
1032 static function getWordReplacementMatchType() {
1033 static $wordReplacementMatchType = NULL;
1034 if (!$wordReplacementMatchType) {
1035 $wordReplacementMatchType = array(
1036 'exactMatch' => ts('Exact Match'),
1037 'wildcardMatch' => ts('Wildcard Match'),
1041 return $jobFrequency;
1045 * mailing group types
1047 static function getMailingGroupTypes() {
1048 static $mailingGroupTypes = NULL;
1049 if (!$mailingGroupTypes) {
1050 $mailingGroupTypes = array(
1051 'Include' => ts('Include'),
1052 'Exclude' => ts('Exclude'),
1053 'Base' => ts('Base'),
1056 return $mailingGroupTypes;
1060 * Mailing Job Status
1062 static function getMailingJobStatus() {
1063 static $mailingJobStatus = NULL;
1064 if (!$mailingJobStatus) {
1065 $mailingJobStatus = array(
1066 'Scheduled' => ts('Scheduled'),
1067 'Running' => ts('Running'),
1068 'Complete' => ts('Complete'),
1069 'Paused' => ts('Paused'),
1070 'Canceled' => ts('Canceled'),
1074 return $mailingJobStatus;
1078 * Frequency unit for schedule reminders
1080 static function getScheduleReminderFrequencyUnits() {
1081 static $scheduleReminderFrequencyUnits = NULL;
1082 if (!$scheduleReminderFrequencyUnits) {
1083 $scheduleReminderFrequencyUnits = array(
1084 'hour' => ts('hour')) + CRM_Core_OptionGroup
::values('recur_frequency_units');
1087 return $scheduleReminderFrequencyUnits;