3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
38 class CRM_Core_SelectValues
{
45 public static function boolean() {
53 * Preferred mail format.
57 public static function pmf() {
70 public static function privacy() {
72 'do_not_phone' => ts('Do not phone'),
73 'do_not_email' => ts('Do not email'),
74 'do_not_mail' => ts('Do not mail'),
75 'do_not_sms' => ts('Do not sms'),
76 'do_not_trade' => ts('Do not trade'),
77 'is_opt_out' => ts('No bulk emails (User Opt Out)'),
82 * Various pre defined contact super types.
86 public static function contactType() {
87 static $contactType = NULL;
89 $contactType = CRM_Contact_BAO_ContactType
::basicTypePairs();
95 * Various pre defined unit list.
97 * @param string $unitType
100 public static function unitList($unitType = NULL) {
103 'month' => ts('month'),
104 'year' => ts('year'),
106 if ($unitType == 'duration') {
107 $unitList['lifetime'] = ts('lifetime');
113 * Membership type unit.
117 public static function membershipTypeUnitList() {
118 return self
::unitList('duration');
122 * Various pre defined period types.
126 public static function periodType() {
128 'rolling' => ts('Rolling'),
129 'fixed' => ts('Fixed'),
134 * Various pre defined email selection methods.
138 public static function emailSelectMethods() {
140 'automatic' => ts("Automatic"),
141 'location-only' => ts("Only send to email addresses assigned to the specified location"),
142 'location-prefer' => ts("Prefer email addresses assigned to the specified location"),
143 'location-exclude' => ts("Exclude email addresses assigned to the specified location"),
148 * Various pre defined member visibility options.
152 public static function memberVisibility() {
154 'Public' => ts('Public'),
155 'Admin' => ts('Admin'),
160 * Member auto-renew options
164 public static function memberAutoRenew() {
166 ts('No auto-renew option'),
167 ts('Give option, but not required'),
168 ts('Auto-renew required'),
173 * Various pre defined event dates.
177 public static function eventDate() {
179 'start_date' => ts('start date'),
180 'end_date' => ts('end date'),
181 'join_date' => ts('member since'),
186 * Custom form field types.
190 public static function customHtmlType() {
192 'Text' => ts('Single-line input field (text or numeric)'),
193 'TextArea' => ts('Multi-line text box (textarea)'),
194 'Select' => ts('Drop-down (select list)'),
195 'Radio' => ts('Radio buttons'),
196 'CheckBox' => ts('Checkbox(es)'),
197 'Select Date' => ts('Select Date'),
198 'File' => ts('File'),
199 'Select State/Province' => ts('Select State/Province'),
200 'Multi-Select State/Province' => ts('Multi-Select State/Province'),
201 'Select Country' => ts('Select Country'),
202 'Multi-Select Country' => ts('Multi-Select Country'),
203 'RichTextEditor' => ts('Rich Text Editor'),
204 'Autocomplete-Select' => ts('Autocomplete-Select'),
205 'Multi-Select' => ts('Multi-Select'),
206 'AdvMulti-Select' => ts('AdvMulti-Select'),
207 'Link' => ts('Link'),
208 'ContactReference' => ts('Autocomplete-Select'),
213 * Various pre defined extensions for dynamic properties and groups.
218 public static function customGroupExtends() {
219 $customGroupExtends = array(
220 'Activity' => ts('Activities'),
221 'Relationship' => ts('Relationships'),
222 'Contribution' => ts('Contributions'),
223 'ContributionRecur' => ts('Recurring Contributions'),
224 'Group' => ts('Groups'),
225 'Membership' => ts('Memberships'),
226 'Event' => ts('Events'),
227 'Participant' => ts('Participants'),
228 'ParticipantRole' => ts('Participants (Role)'),
229 'ParticipantEventName' => ts('Participants (Event Name)'),
230 'ParticipantEventType' => ts('Participants (Event Type)'),
231 'Pledge' => ts('Pledges'),
232 'Grant' => ts('Grants'),
233 'Address' => ts('Addresses'),
234 'Campaign' => ts('Campaigns'),
236 $contactTypes = self
::contactType();
237 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
238 $extendObjs = CRM_Core_OptionGroup
::values('cg_extend_objects');
239 $customGroupExtends = array_merge($contactTypes, $customGroupExtends, $extendObjs);
240 return $customGroupExtends;
244 * Styles for displaying the custom data group.
248 public static function customGroupStyle() {
251 'Inline' => ts('Inline'),
252 'Tab with table' => ts('Tab with table'),
257 * For displaying the uf group types.
261 public static function ufGroupTypes() {
262 $ufGroupType = array(
263 'Profile' => ts('Standalone Form or Directory'),
264 'Search Profile' => ts('Search Views'),
267 if (CRM_Core_Config
::singleton()->userSystem
->supports_form_extensions
) {
268 $ufGroupType +
= array(
269 'User Registration' => ts('Drupal User Registration'),
270 'User Account' => ts('View/Edit Drupal User Account'),
277 * The status of a contact within a group.
281 public static function groupContactStatus() {
283 'Added' => ts('Added'),
284 'Removed' => ts('Removed'),
285 'Pending' => ts('Pending'),
290 * List of Group Types.
294 public static function groupType() {
296 'query' => ts('Dynamic'),
297 'static' => ts('Static'),
302 * Compose the parameters for a date select object.
304 * @param string|NULL $type
306 * @param string|NULL $format
307 * date format (QF format)
308 * @param null $minOffset
309 * @param null $maxOffset
314 public static function date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL, $context = 'display') {
315 // These options are deprecated. Definitely not used in datepicker. Possibly not even in jcalendar+addDateTime.
317 'addEmptyOption' => TRUE,
318 'emptyOptionText' => ts('- select -'),
319 'emptyOptionValue' => '',
323 $date['format'] = $format;
327 $dao = new CRM_Core_DAO_PreferencesDate();
329 if (!$dao->find(TRUE)) {
330 CRM_Core_Error
::fatal();
333 $maxOffset = $dao->end
;
336 $minOffset = $dao->start
;
339 $date['format'] = $dao->date_format
;
340 $date['time'] = (bool) $dao->time_format
;
343 if (empty($date['format'])) {
344 if ($context == 'Input') {
345 $date['format'] = Civi
::settings()->get('dateInputFormat');
348 $date['format'] = 'M d';
353 $date['smarty_view_format'] = CRM_Utils_Date
::getDateFieldViewFormat($date['format']);
354 if (!isset($date['time'])) {
355 $date['time'] = FALSE;
359 $date['minYear'] = $year - (int) $minOffset;
360 $date['maxYear'] = $year +
(int) $maxOffset;
365 * Values for UF form visibility options.
369 public static function ufVisibility() {
371 'User and User Admin Only' => ts('User and User Admin Only'),
372 'Public Pages' => ts('Expose Publicly'),
373 'Public Pages and Listings' => ts('Expose Publicly and for Listings'),
378 * Values for group form visibility options.
382 public static function groupVisibility() {
384 'User and User Admin Only' => ts('User and User Admin Only'),
385 'Public Pages' => ts('Public Pages'),
390 * Different type of Mailing Components.
394 public static function mailingComponents() {
396 'Header' => ts('Header'),
397 'Footer' => ts('Footer'),
398 'Reply' => ts('Reply Auto-responder'),
399 'OptOut' => ts('Opt-out Message'),
400 'Subscribe' => ts('Subscription Confirmation Request'),
401 'Welcome' => ts('Welcome Message'),
402 'Unsubscribe' => ts('Unsubscribe Message'),
403 'Resubscribe' => ts('Resubscribe Message'),
412 public function getHours() {
414 for ($i = 0; $i <= 6; $i++
) {
425 public function getMinutes() {
427 for ($i = 0; $i < 60; $i = $i +
15) {
434 * Get the Map Provider.
437 * array of map providers
439 public static function mapProvider() {
442 $map = array('' => '- select -') + CRM_Utils_System
::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
448 * Get the Geocoding Providers from available plugins.
451 * array of geocoder providers
453 public static function geoProvider() {
456 $geo = array('' => '- select -') + CRM_Utils_System
::getPluginList('CRM/Utils/Geocode');
462 * Get the Address Standardization Providers from available plugins.
465 * array of address standardization providers
467 public static function addressProvider() {
470 $addr = CRM_Utils_System
::getPluginList('CRM/Utils/Address', '.php', array('BatchUpdate'));
476 * Different type of Mailing Tokens.
480 public static function mailingTokens() {
482 '{action.unsubscribe}' => ts('Unsubscribe via email'),
483 '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'),
484 '{action.resubscribe}' => ts('Resubscribe via email'),
485 '{action.resubscribeUrl}' => ts('Resubscribe via web page'),
486 '{action.optOut}' => ts('Opt out via email'),
487 '{action.optOutUrl}' => ts('Opt out via web page'),
488 '{action.forward}' => ts('Forward this email (link)'),
489 '{action.reply}' => ts('Reply to this email (link)'),
490 '{action.subscribeUrl}' => ts('Subscribe via web page'),
491 '{domain.name}' => ts('Domain name'),
492 '{domain.address}' => ts('Domain (organization) address'),
493 '{domain.phone}' => ts('Domain (organization) phone'),
494 '{domain.email}' => ts('Domain (organization) email'),
495 '{mailing.name}' => ts('Mailing name'),
496 '{mailing.group}' => ts('Mailing group'),
497 '{mailing.viewUrl}' => ts('Mailing permalink'),
502 * Different type of Activity Tokens.
506 public static function activityTokens() {
508 '{activity.activity_id}' => ts('Activity ID'),
509 '{activity.subject}' => ts('Activity Subject'),
510 '{activity.details}' => ts('Activity Details'),
511 '{activity.activity_date_time}' => ts('Activity Date Time'),
516 * Different type of Membership Tokens.
520 public static function membershipTokens() {
522 '{membership.id}' => ts('Membership ID'),
523 '{membership.status}' => ts('Membership Status'),
524 '{membership.type}' => ts('Membership Type'),
525 '{membership.start_date}' => ts('Membership Start Date'),
526 '{membership.join_date}' => ts('Membership Join Date'),
527 '{membership.end_date}' => ts('Membership End Date'),
528 '{membership.fee}' => ts('Membership Fee'),
533 * Different type of Event Tokens.
537 public static function eventTokens() {
539 '{event.event_id}' => ts('Event ID'),
540 '{event.title}' => ts('Event Title'),
541 '{event.start_date}' => ts('Event Start Date'),
542 '{event.end_date}' => ts('Event End Date'),
543 '{event.event_type}' => ts('Event Type'),
544 '{event.summary}' => ts('Event Summary'),
545 '{event.contact_email}' => ts('Event Contact Email'),
546 '{event.contact_phone}' => ts('Event Contact Phone'),
547 '{event.description}' => ts('Event Description'),
548 '{event.location}' => ts('Event Location'),
549 '{event.fee_amount}' => ts('Event Fees'),
550 '{event.info_url}' => ts('Event Info URL'),
551 '{event.registration_url}' => ts('Event Registration URL'),
552 '{event.balance}' => ts('Event Balance'),
557 * Different type of Event Tokens.
561 public static function contributionTokens() {
562 return array_merge(array(
563 '{contribution.contribution_id}' => ts('Contribution ID'),
564 '{contribution.total_amount}' => ts('Total Amount'),
565 '{contribution.fee_amount}' => ts('Fee Amount'),
566 '{contribution.net_amount}' => ts('Net Amount'),
567 '{contribution.non_deductible_amount}' => ts('Non-deductible Amount'),
568 '{contribution.receive_date}' => ts('Contribution Date Received'),
569 '{contribution.payment_instrument}' => ts('Payment Method'),
570 '{contribution.trxn_id}' => ts('Transaction ID'),
571 '{contribution.invoice_id}' => ts('Invoice ID'),
572 '{contribution.currency}' => ts('Currency'),
573 '{contribution.cancel_date}' => ts('Contribution Cancel Date'),
574 '{contribution.cancel_reason}' => ts('Contribution Cancel Reason'),
575 '{contribution.receipt_date}' => ts('Receipt Date'),
576 '{contribution.thankyou_date}' => ts('Thank You Date'),
577 '{contribution.contribution_source}' => ts('Contribution Source'),
578 '{contribution.amount_level}' => ts('Amount Level'),
579 //'{contribution.contribution_recur_id}' => ts('Contribution Recurring ID'),
580 //'{contribution.honor_contact_id}' => ts('Honor Contact ID'),
581 '{contribution.contribution_status_id}' => ts('Contribution Status'),
582 //'{contribution.honor_type_id}' => ts('Honor Type ID'),
583 //'{contribution.address_id}' => ts('Address ID'),
584 '{contribution.check_number}' => ts('Check Number'),
585 '{contribution.campaign}' => ts('Contribution Campaign'),
586 ), CRM_Utils_Token
::getCustomFieldTokens('contribution', TRUE));
590 * Different type of Contact Tokens.
594 public static function contactTokens() {
595 static $tokens = NULL;
597 $additionalFields = array(
598 'checksum' => array('title' => ts('Checksum')),
599 'contact_id' => array('title' => ts('Internal Contact ID')),
601 $exportFields = array_merge(CRM_Contact_BAO_Contact
::exportableFields(), $additionalFields);
603 $values = array_merge(array_keys($exportFields));
606 //FIXME:skipping some tokens for time being.
620 $customFields = CRM_Core_BAO_CustomField
::getFields(array('Individual', 'Address'));
621 $legacyTokenNames = array_flip(CRM_Utils_Token
::legacyContactTokens());
623 foreach ($values as $val) {
624 if (in_array($val, $skipTokens)) {
627 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
628 $customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val);
629 if ($customFieldId) {
630 // CRM-15191 - if key is not in $customFields then the field is disabled and should be ignored
631 if (!empty($customFields[$customFieldId])) {
632 $tokens["{contact.$val}"] = $customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'];
636 // Support legacy token names
637 $tokenName = CRM_Utils_Array
::value($val, $legacyTokenNames, $val);
638 $tokens["{contact.$tokenName}"] = $exportFields[$val]['title'];
642 // Get all the hook tokens too
643 $hookTokens = array();
644 CRM_Utils_Hook
::tokens($hookTokens);
645 foreach ($hookTokens as $tokenValues) {
646 foreach ($tokenValues as $key => $value) {
647 if (is_numeric($key)) {
650 if (!preg_match('/^\{[^\}]+\}$/', $key)) {
651 $key = '{' . $key . '}';
653 if (preg_match('/^\{([^\}]+)\}$/', $value, $matches)) {
654 $value = $matches[1];
656 $tokens[$key] = $value;
665 * Different type of Participant Tokens.
669 public static function participantTokens() {
670 static $tokens = NULL;
672 $exportFields = CRM_Event_BAO_Participant
::exportableFields();
674 $values = array_merge(array_keys($exportFields));
677 // skipping some tokens for time being.
680 'participant_is_pay_later',
681 'participant_is_test',
682 'participant_contact_id',
683 'participant_fee_currency',
684 'participant_campaign_id',
685 'participant_status',
686 'participant_discount_name',
689 $customFields = CRM_Core_BAO_CustomField
::getFields('Participant');
691 foreach ($values as $key => $val) {
692 if (in_array($val, $skipTokens)) {
695 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
696 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
697 $tokens["{participant.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
700 $tokens["{participant.$val}"] = $exportFields[$val]['title'];
708 * @param int $caseTypeId
711 public static function caseTokens($caseTypeId = NULL) {
712 static $tokens = NULL;
714 foreach (CRM_Case_BAO_Case
::fields() as $field) {
715 $tokens["{case.{$field['name']}}"] = $field['title'];
718 $customFields = CRM_Core_BAO_CustomField
::getFields('Case', FALSE, FALSE, $caseTypeId);
719 foreach ($customFields as $id => $field) {
720 $tokens["{case.custom_$id}"] = "{$field['label']} :: {$field['groupTitle']}";
727 * CiviCRM supported date input formats.
731 public static function getDatePluginInputFormats() {
732 $dateInputFormats = array(
733 "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'),
734 "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'),
735 "yy-mm-dd" => ts('yyyy-mm-dd (2009-12-31)'),
736 "dd-mm-yy" => ts('dd-mm-yyyy (31-12-2009)'),
737 'dd.mm.yy' => ts('dd.mm.yyyy (31.12.2009)'),
738 "M d, yy" => ts('M d, yyyy (Dec 31, 2009)'),
739 'd M yy' => ts('d M yyyy (31 Dec 2009)'),
740 "MM d, yy" => ts('MM d, yyyy (December 31, 2009)'),
741 'd MM yy' => ts('d MM yyyy (31 December 2009)'),
742 "DD, d MM yy" => ts('DD, d MM yyyy (Thursday, 31 December 2009)'),
743 "mm/dd" => ts('mm/dd (12/31)'),
744 "dd-mm" => ts('dd-mm (31-12)'),
745 "yy-mm" => ts('yyyy-mm (2009-12)'),
746 'M yy' => ts('M yyyy (Dec 2009)'),
747 "yy" => ts('yyyy (2009)'),
751 Year greater than 2000 get wrong result for following format
752 echo date( 'Y-m-d', strtotime( '7 Nov, 2001') );
753 echo date( 'Y-m-d', strtotime( '7 November, 2001') );
755 expected :: 2001-11-07
758 echo date( 'Y-m-d', strtotime( 'Nov 7, 2001') );
759 echo date( 'Y-m-d', strtotime( 'November 7, 2001') );
763 return $dateInputFormats;
771 public static function getTimeFormats() {
773 '1' => ts('12 Hours'),
774 '2' => ts('24 Hours'),
779 * Get numeric options.
786 public static function getNumericOptions($start = 0, $end = 10) {
787 $numericOptions = array();
788 for ($i = $start; $i <= $end; $i++
) {
789 $numericOptions[$i] = $i;
791 return $numericOptions;
799 public static function getBarcodeTypes() {
801 'barcode' => ts('Linear (1D)'),
802 'qrcode' => ts('QR code'),
811 public static function getDedupeRuleTypes() {
813 'Unsupervised' => ts('Unsupervised'),
814 'Supervised' => ts('Supervised'),
815 'General' => ts('General'),
820 * Campaign group types.
824 public static function getCampaignGroupTypes() {
826 'Include' => ts('Include'),
827 'Exclude' => ts('Exclude'),
832 * Subscription history method.
836 public static function getSubscriptionHistoryMethods() {
838 'Admin' => ts('Admin'),
839 'Email' => ts('Email'),
850 public static function getPremiumUnits() {
853 'week' => ts('Week'),
854 'month' => ts('Month'),
855 'year' => ts('Year'),
864 public static function getExtensionTypes() {
866 'payment' => ts('Payment'),
867 'search' => ts('Search'),
868 'report' => ts('Report'),
869 'module' => ts('Module'),
879 public static function getJobFrequency() {
882 'Yearly' => ts('Yearly'),
883 'Quarter' => ts('Quarterly'),
884 'Monthly' => ts('Monthly'),
885 'Weekly' => ts('Weekly'),
887 'Daily' => ts('Daily'),
888 'Hourly' => ts('Hourly'),
889 'Always' => ts('Every time cron job is run'),
894 * Search builder operators.
898 public static function getSearchBuilderOperators($fieldType = NULL) {
899 $builderOperators = array(
907 'NOT IN' => ts('Not In'),
908 'LIKE' => ts('Like'),
909 'NOT LIKE' => ts('Not Like'),
910 'RLIKE' => ts('Regex'),
911 'IS EMPTY' => ts('Is Empty'),
912 'IS NOT EMPTY' => ts('Not Empty'),
913 'IS NULL' => ts('Is Null'),
914 'IS NOT NULL' => ts('Not Null'),
917 switch ($fieldType) {
918 case CRM_Utils_Type
::T_STRING
:
919 unset($builderOperators['>']);
920 unset($builderOperators['<']);
921 unset($builderOperators['>=']);
922 unset($builderOperators['<=']);
926 return $builderOperators;
930 * Profile group types.
934 public static function getProfileGroupType() {
935 $profileGroupType = array(
936 'Activity' => ts('Activities'),
937 'Contribution' => ts('Contributions'),
938 'Membership' => ts('Memberships'),
939 'Participant' => ts('Participants'),
941 $contactTypes = self
::contactType();
942 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
943 $profileGroupType = array_merge($contactTypes, $profileGroupType);
945 return $profileGroupType;
950 * Word replacement match type.
954 public static function getWordReplacementMatchType() {
956 'exactMatch' => ts('Exact Match'),
957 'wildcardMatch' => ts('Wildcard Match'),
962 * Mailing group types.
966 public static function getMailingGroupTypes() {
968 'Include' => ts('Include'),
969 'Exclude' => ts('Exclude'),
970 'Base' => ts('Base'),
975 * Mailing Job Status.
979 public static function getMailingJobStatus() {
981 'Scheduled' => ts('Scheduled'),
982 'Running' => ts('Running'),
983 'Complete' => ts('Complete'),
984 'Paused' => ts('Paused'),
985 'Canceled' => ts('Canceled'),
992 public static function billingMode() {
994 CRM_Core_Payment
::BILLING_MODE_FORM
=> 'form',
995 CRM_Core_Payment
::BILLING_MODE_BUTTON
=> 'button',
996 CRM_Core_Payment
::BILLING_MODE_NOTIFY
=> 'notify',
1003 public static function contributeMode() {
1005 CRM_Core_Payment
::BILLING_MODE_FORM
=> 'direct',
1006 CRM_Core_Payment
::BILLING_MODE_BUTTON
=> 'directIPN',
1007 CRM_Core_Payment
::BILLING_MODE_NOTIFY
=> 'notify',
1012 * Frequency unit for schedule reminders.
1018 public static function getRecurringFrequencyUnits($count = 1) {
1019 // @todo this used to refer to the 'recur_frequency_unit' option_values which
1020 // is for recurring payments and probably not good to re-use for recurring entities.
1021 // If something other than a hard-coded list is desired, add a new option_group.
1023 'hour' => ts('hour', array('plural' => 'hours', 'count' => $count)),
1024 'day' => ts('day', array('plural' => 'days', 'count' => $count)),
1025 'week' => ts('week', array('plural' => 'weeks', 'count' => $count)),
1026 'month' => ts('month', array('plural' => 'months', 'count' => $count)),
1027 'year' => ts('year', array('plural' => 'years', 'count' => $count)),
1032 * Relative Date Terms.
1036 public static function getRelativeDateTerms() {
1038 'previous' => ts('Previous'),
1039 'previous_2' => ts('Previous 2'),
1040 'previous_before' => ts('Prior to Previous'),
1041 'before_previous' => ts('All Prior to Previous'),
1042 'earlier' => ts('To End of Previous'),
1043 'greater_previous' => ts('From End of Previous'),
1044 'greater' => ts('From Start Of Current'),
1045 'current' => ts('Current'),
1046 'ending_3' => ts('Last 3'),
1047 'ending_2' => ts('Last 2'),
1048 'ending' => ts('Last'),
1049 'this' => ts('This'),
1050 'starting' => ts('Upcoming'),
1051 'less' => ts('To End of'),
1052 'next' => ts('Next'),
1057 * Relative Date Units.
1061 public static function getRelativeDateUnits() {
1063 'year' => ts('Years'),
1064 'fiscal_year' => ts('Fiscal Years'),
1065 'quarter' => ts('Quarters'),
1066 'month' => ts('Months'),
1067 'week' => ts('Weeks'),
1068 'day' => ts('Days'),
1073 * Exportable document formats.
1077 public static function documentFormat() {
1079 'pdf' => ts('Portable Document Format (.pdf)'),
1080 'docx' => ts('MS Word (.docx)'),
1081 'odt' => ts('Open Office (.odt)'),
1082 'html' => ts('Webpage (.html)'),
1087 * Application type of document.
1091 public static function documentApplicationType() {
1093 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
1094 'odt' => 'application/vnd.oasis.opendocument.text',
1099 * Activity Text options.
1103 public static function activityTextOptions() {
1105 2 => ts('Details Only'),
1106 3 => ts('Subject Only'),