3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
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) {
316 'addEmptyOption' => TRUE,
317 'emptyOptionText' => ts('- select -'),
318 'emptyOptionValue' => '',
322 $date['format'] = $format;
326 $dao = new CRM_Core_DAO_PreferencesDate();
328 if (!$dao->find(TRUE)) {
329 CRM_Core_Error
::fatal();
333 if ($type == 'creditCard') {
334 $minOffset = $dao->start
;
335 $maxOffset = $dao->end
;
336 $date['format'] = $dao->date_format
;
337 $date['addEmptyOption'] = TRUE;
338 $date['emptyOptionText'] = ts('- select -');
339 $date['emptyOptionValue'] = '';
342 if (empty($date['format'])) {
343 $date['format'] = 'M d';
348 $date['minYear'] = $year - $minOffset;
349 $date['maxYear'] = $year +
$maxOffset;
354 * Values for UF form visibility options.
358 public static function ufVisibility() {
360 'User and User Admin Only' => ts('User and User Admin Only'),
361 'Public Pages' => ts('Expose Publicly'),
362 'Public Pages and Listings' => ts('Expose Publicly and for Listings'),
367 * Values for group form visibility options.
371 public static function groupVisibility() {
373 'User and User Admin Only' => ts('User and User Admin Only'),
374 'Public Pages' => ts('Public Pages'),
379 * Different type of Mailing Components.
383 public static function mailingComponents() {
385 'Header' => ts('Header'),
386 'Footer' => ts('Footer'),
387 'Reply' => ts('Reply Auto-responder'),
388 'OptOut' => ts('Opt-out Message'),
389 'Subscribe' => ts('Subscription Confirmation Request'),
390 'Welcome' => ts('Welcome Message'),
391 'Unsubscribe' => ts('Unsubscribe Message'),
392 'Resubscribe' => ts('Resubscribe Message'),
401 public function getHours() {
403 for ($i = 0; $i <= 6; $i++
) {
414 public function getMinutes() {
416 for ($i = 0; $i < 60; $i = $i +
15) {
423 * Get the Map Provider.
426 * array of map providers
428 public static function mapProvider() {
431 $map = array('' => '- select -') + CRM_Utils_System
::getPluginList('templates/CRM/Contact/Form/Task/Map', ".tpl");
437 * Get the Geocoding Providers from available plugins.
440 * array of geocoder providers
442 public static function geoProvider() {
445 $geo = array('' => '- select -') + CRM_Utils_System
::getPluginList('CRM/Utils/Geocode');
451 * Get the Address Standardization Providers from available plugins.
454 * array of address standardization providers
456 public static function addressProvider() {
459 $addr = CRM_Utils_System
::getPluginList('CRM/Utils/Address', '.php', array('BatchUpdate'));
465 * Different type of Mailing Tokens.
469 public static function mailingTokens() {
471 '{action.unsubscribe}' => ts('Unsubscribe via email'),
472 '{action.unsubscribeUrl}' => ts('Unsubscribe via web page'),
473 '{action.resubscribe}' => ts('Resubscribe via email'),
474 '{action.resubscribeUrl}' => ts('Resubscribe via web page'),
475 '{action.optOut}' => ts('Opt out via email'),
476 '{action.optOutUrl}' => ts('Opt out via web page'),
477 '{action.forward}' => ts('Forward this email (link)'),
478 '{action.reply}' => ts('Reply to this email (link)'),
479 '{action.subscribeUrl}' => ts('Subscribe via web page'),
480 '{domain.name}' => ts('Domain name'),
481 '{domain.address}' => ts('Domain (organization) address'),
482 '{domain.phone}' => ts('Domain (organization) phone'),
483 '{domain.email}' => ts('Domain (organization) email'),
484 '{mailing.name}' => ts('Mailing name'),
485 '{mailing.group}' => ts('Mailing group'),
486 '{mailing.viewUrl}' => ts('Mailing permalink'),
491 * Different type of Activity Tokens.
495 public static function activityTokens() {
497 '{activity.activity_id}' => ts('Activity ID'),
498 '{activity.subject}' => ts('Activity Subject'),
499 '{activity.details}' => ts('Activity Details'),
500 '{activity.activity_date_time}' => ts('Activity Date Time'),
505 * Different type of Membership Tokens.
509 public static function membershipTokens() {
511 '{membership.id}' => ts('Membership ID'),
512 '{membership.status}' => ts('Membership Status'),
513 '{membership.type}' => ts('Membership Type'),
514 '{membership.start_date}' => ts('Membership Start Date'),
515 '{membership.join_date}' => ts('Membership Join Date'),
516 '{membership.end_date}' => ts('Membership End Date'),
517 '{membership.fee}' => ts('Membership Fee'),
522 * Different type of Event Tokens.
526 public static function eventTokens() {
528 '{event.event_id}' => ts('Event ID'),
529 '{event.title}' => ts('Event Title'),
530 '{event.start_date}' => ts('Event Start Date'),
531 '{event.end_date}' => ts('Event End Date'),
532 '{event.event_type}' => ts('Event Type'),
533 '{event.summary}' => ts('Event Summary'),
534 '{event.contact_email}' => ts('Event Contact Email'),
535 '{event.contact_phone}' => ts('Event Contact Phone'),
536 '{event.description}' => ts('Event Description'),
537 '{event.location}' => ts('Event Location'),
538 '{event.fee_amount}' => ts('Event Fees'),
539 '{event.info_url}' => ts('Event Info URL'),
540 '{event.registration_url}' => ts('Event Registration URL'),
541 '{event.balance}' => ts('Event Balance'),
546 * Different type of Event Tokens.
550 public static function contributionTokens() {
552 '{contribution.contribution_id}' => ts('Contribution ID'),
553 '{contribution.total_amount}' => ts('Total Amount'),
554 '{contribution.fee_amount}' => ts('Fee Amount'),
555 '{contribution.net_amount}' => ts('Net Amount'),
556 '{contribution.non_deductible_amount}' => ts('Non-deductible Amount'),
557 '{contribution.receive_date}' => ts('Contribution Date Received'),
558 '{contribution.payment_instrument}' => ts('Payment Method'),
559 '{contribution.trxn_id}' => ts('Transaction ID'),
560 '{contribution.invoice_id}' => ts('Invoice ID'),
561 '{contribution.currency}' => ts('Currency'),
562 '{contribution.cancel_date}' => ts('Contribution Cancel Date'),
563 '{contribution.cancel_reason}' => ts('Contribution Cancel Reason'),
564 '{contribution.receipt_date}' => ts('Receipt Date'),
565 '{contribution.thankyou_date}' => ts('Thank You Date'),
566 '{contribution.contribution_source}' => ts('Contribution Source'),
567 '{contribution.amount_level}' => ts('Amount Level'),
568 //'{contribution.contribution_recur_id}' => ts('Contribution Recurring ID'),
569 //'{contribution.honor_contact_id}' => ts('Honor Contact ID'),
570 '{contribution.contribution_status_id}' => ts('Contribution Status'),
571 //'{contribution.honor_type_id}' => ts('Honor Type ID'),
572 //'{contribution.address_id}' => ts('Address ID'),
573 '{contribution.check_number}' => ts('Check Number'),
574 '{contribution.campaign}' => ts('Contribution Campaign'),
579 * Different type of Contact Tokens.
583 public static function contactTokens() {
584 static $tokens = NULL;
586 $additionalFields = array(
587 'checksum' => array('title' => ts('Checksum')),
588 'contact_id' => array('title' => ts('Internal Contact ID')),
590 $exportFields = array_merge(CRM_Contact_BAO_Contact
::exportableFields(), $additionalFields);
592 $values = array_merge(array_keys($exportFields));
595 //FIXME:skipping some tokens for time being.
609 $customFields = CRM_Core_BAO_CustomField
::getFields(array('Individual', 'Address'));
610 $legacyTokenNames = array_flip(CRM_Utils_Token
::legacyContactTokens());
612 foreach ($values as $val) {
613 if (in_array($val, $skipTokens)) {
616 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
617 $customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val);
618 if ($customFieldId) {
619 // CRM-15191 - if key is not in $customFields then the field is disabled and should be ignored
620 if (!empty($customFields[$customFieldId])) {
621 $tokens["{contact.$val}"] = $customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'];
625 // Support legacy token names
626 $tokenName = CRM_Utils_Array
::value($val, $legacyTokenNames, $val);
627 $tokens["{contact.$tokenName}"] = $exportFields[$val]['title'];
631 // Get all the hook tokens too
632 $hookTokens = array();
633 CRM_Utils_Hook
::tokens($hookTokens);
634 foreach ($hookTokens as $tokenValues) {
635 foreach ($tokenValues as $key => $value) {
636 if (is_numeric($key)) {
639 if (!preg_match('/^\{[^\}]+\}$/', $key)) {
640 $key = '{' . $key . '}';
642 if (preg_match('/^\{([^\}]+)\}$/', $value, $matches)) {
643 $value = $matches[1];
645 $tokens[$key] = $value;
654 * Different type of Participant Tokens.
658 public static function participantTokens() {
659 static $tokens = NULL;
661 $exportFields = CRM_Event_BAO_Participant
::exportableFields();
663 $values = array_merge(array_keys($exportFields));
666 // skipping some tokens for time being.
669 'participant_is_pay_later',
670 'participant_is_test',
671 'participant_contact_id',
672 'participant_fee_currency',
673 'participant_campaign_id',
674 'participant_status',
675 'participant_discount_name',
678 $customFields = CRM_Core_BAO_CustomField
::getFields('Participant');
680 foreach ($values as $key => $val) {
681 if (in_array($val, $skipTokens)) {
684 //keys for $tokens should be constant. $token Values are changed for Custom Fields. CRM-3734
685 if ($customFieldId = CRM_Core_BAO_CustomField
::getKeyID($val)) {
686 $tokens["{participant.$val}"] = !empty($customFields[$customFieldId]) ?
$customFields[$customFieldId]['label'] . " :: " . $customFields[$customFieldId]['groupTitle'] : '';
689 $tokens["{participant.$val}"] = $exportFields[$val]['title'];
697 * @param int $caseTypeId
700 public static function caseTokens($caseTypeId = NULL) {
701 static $tokens = NULL;
703 foreach (CRM_Case_BAO_Case
::fields() as $field) {
704 $tokens["{case.{$field['name']}}"] = $field['title'];
707 $customFields = CRM_Core_BAO_CustomField
::getFields('Case', FALSE, FALSE, $caseTypeId);
708 foreach ($customFields as $id => $field) {
709 $tokens["{case.custom_$id}"] = "{$field['label']} :: {$field['groupTitle']}";
716 * CiviCRM supported date input formats.
720 public static function getDatePluginInputFormats() {
721 $dateInputFormats = array(
722 "mm/dd/yy" => ts('mm/dd/yyyy (12/31/2009)'),
723 "dd/mm/yy" => ts('dd/mm/yyyy (31/12/2009)'),
724 "yy-mm-dd" => ts('yyyy-mm-dd (2009-12-31)'),
725 "dd-mm-yy" => ts('dd-mm-yyyy (31-12-2009)'),
726 'dd.mm.yy' => ts('dd.mm.yyyy (31.12.2009)'),
727 "M d, yy" => ts('M d, yyyy (Dec 31, 2009)'),
728 'd M yy' => ts('d M yyyy (31 Dec 2009)'),
729 "MM d, yy" => ts('MM d, yyyy (December 31, 2009)'),
730 'd MM yy' => ts('d MM yyyy (31 December 2009)'),
731 "DD, d MM yy" => ts('DD, d MM yyyy (Thursday, 31 December 2009)'),
732 "mm/dd" => ts('mm/dd (12/31)'),
733 "dd-mm" => ts('dd-mm (31-12)'),
734 "yy-mm" => ts('yyyy-mm (2009-12)'),
735 'M yy' => ts('M yyyy (Dec 2009)'),
736 "yy" => ts('yyyy (2009)'),
740 Year greater than 2000 get wrong result for following format
741 echo date( 'Y-m-d', strtotime( '7 Nov, 2001') );
742 echo date( 'Y-m-d', strtotime( '7 November, 2001') );
744 expected :: 2001-11-07
747 echo date( 'Y-m-d', strtotime( 'Nov 7, 2001') );
748 echo date( 'Y-m-d', strtotime( 'November 7, 2001') );
752 return $dateInputFormats;
756 * Map date plugin and actual format that is used by PHP.
760 public static function datePluginToPHPFormats() {
761 $dateInputFormats = array(
762 "mm/dd/yy" => 'm/d/Y',
763 "dd/mm/yy" => 'd/m/Y',
764 "yy-mm-dd" => 'Y-m-d',
765 "dd-mm-yy" => 'd-m-Y',
766 "dd.mm.yy" => 'd.m.Y',
767 "M d, yy" => 'M j, Y',
769 "MM d, yy" => 'F j, Y',
770 "d MM yy" => 'j F Y',
771 "DD, d MM yy" => 'l, j F Y',
778 return $dateInputFormats;
786 public static function getTimeFormats() {
788 '1' => ts('12 Hours'),
789 '2' => ts('24 Hours'),
794 * Get numeric options.
801 public static function getNumericOptions($start = 0, $end = 10) {
802 $numericOptions = array();
803 for ($i = $start; $i <= $end; $i++
) {
804 $numericOptions[$i] = $i;
806 return $numericOptions;
814 public static function getBarcodeTypes() {
816 'barcode' => ts('Linear (1D)'),
817 'qrcode' => ts('QR code'),
826 public static function getDedupeRuleTypes() {
828 'Unsupervised' => ts('Unsupervised'),
829 'Supervised' => ts('Supervised'),
830 'General' => ts('General'),
835 * Campaign group types.
839 public static function getCampaignGroupTypes() {
841 'Include' => ts('Include'),
842 'Exclude' => ts('Exclude'),
847 * Subscription history method.
851 public static function getSubscriptionHistoryMethods() {
853 'Admin' => ts('Admin'),
854 'Email' => ts('Email'),
865 public static function getPremiumUnits() {
868 'week' => ts('Week'),
869 'month' => ts('Month'),
870 'year' => ts('Year'),
879 public static function getExtensionTypes() {
881 'payment' => ts('Payment'),
882 'search' => ts('Search'),
883 'report' => ts('Report'),
884 'module' => ts('Module'),
894 public static function getJobFrequency() {
897 'Yearly' => ts('Yearly'),
898 'Quarter' => ts('Quarterly'),
899 'Monthly' => ts('Monthly'),
900 'Weekly' => ts('Weekly'),
902 'Daily' => ts('Daily'),
903 'Hourly' => ts('Hourly'),
904 'Always' => ts('Every time cron job is run'),
909 * Search builder operators.
913 public static function getSearchBuilderOperators($fieldType = NULL) {
914 $builderOperators = array(
922 'NOT IN' => ts('Not In'),
923 'LIKE' => ts('Like'),
924 'NOT LIKE' => ts('Not Like'),
925 'RLIKE' => ts('Regex'),
926 'IS EMPTY' => ts('Is Empty'),
927 'IS NOT EMPTY' => ts('Not Empty'),
928 'IS NULL' => ts('Is Null'),
929 'IS NOT NULL' => ts('Not Null'),
932 switch ($fieldType) {
933 case CRM_Utils_Type
::T_STRING
:
934 unset($builderOperators['>']);
935 unset($builderOperators['<']);
936 unset($builderOperators['>=']);
937 unset($builderOperators['<=']);
941 return $builderOperators;
945 * Profile group types.
949 public static function getProfileGroupType() {
950 $profileGroupType = array(
951 'Activity' => ts('Activities'),
952 'Contribution' => ts('Contributions'),
953 'Membership' => ts('Memberships'),
954 'Participant' => ts('Participants'),
956 $contactTypes = self
::contactType();
957 $contactTypes = !empty($contactTypes) ?
array('Contact' => 'Contacts') +
$contactTypes : array();
958 $profileGroupType = array_merge($contactTypes, $profileGroupType);
960 return $profileGroupType;
965 * Word replacement match type.
969 public static function getWordReplacementMatchType() {
971 'exactMatch' => ts('Exact Match'),
972 'wildcardMatch' => ts('Wildcard Match'),
977 * Mailing group types.
981 public static function getMailingGroupTypes() {
983 'Include' => ts('Include'),
984 'Exclude' => ts('Exclude'),
985 'Base' => ts('Base'),
990 * Mailing Job Status.
994 public static function getMailingJobStatus() {
996 'Scheduled' => ts('Scheduled'),
997 'Running' => ts('Running'),
998 'Complete' => ts('Complete'),
999 'Paused' => ts('Paused'),
1000 'Canceled' => ts('Canceled'),
1007 public static function billingMode() {
1009 CRM_Core_Payment
::BILLING_MODE_FORM
=> 'form',
1010 CRM_Core_Payment
::BILLING_MODE_BUTTON
=> 'button',
1011 CRM_Core_Payment
::BILLING_MODE_NOTIFY
=> 'notify',
1016 * Frequency unit for schedule reminders.
1022 public static function getRecurringFrequencyUnits($count = 1) {
1023 // @todo this used to refer to the 'recur_frequency_unit' option_values which
1024 // is for recurring payments and probably not good to re-use for recurring entities.
1025 // If something other than a hard-coded list is desired, add a new option_group.
1027 'hour' => ts('hour', array('plural' => 'hours', 'count' => $count)),
1028 'day' => ts('day', array('plural' => 'days', 'count' => $count)),
1029 'week' => ts('week', array('plural' => 'weeks', 'count' => $count)),
1030 'month' => ts('month', array('plural' => 'months', 'count' => $count)),
1031 'year' => ts('year', array('plural' => 'years', 'count' => $count)),
1036 * Relative Date Terms.
1040 public static function getRelativeDateTerms() {
1042 'previous' => ts('Previous'),
1043 'previous_2' => ts('Previous 2'),
1044 'previous_before' => ts('Prior to Previous'),
1045 'before_previous' => ts('All Prior to Previous'),
1046 'earlier' => ts('To End of Previous'),
1047 'greater_previous' => ts('From End of Previous'),
1048 'greater' => ts('From Start Of Current'),
1049 'current' => ts('Current'),
1050 'ending_3' => ts('Last 3'),
1051 'ending_2' => ts('Last 2'),
1052 'ending' => ts('Last'),
1053 'this' => ts('This'),
1054 'starting' => ts('Upcoming'),
1055 'less' => ts('To End of'),
1056 'next' => ts('Next'),
1061 * Relative Date Units.
1065 public static function getRelativeDateUnits() {
1067 'year' => ts('Years'),
1068 'fiscal_year' => ts('Fiscal Years'),
1069 'quarter' => ts('Quarters'),
1070 'month' => ts('Months'),
1071 'week' => ts('Weeks'),
1072 'day' => ts('Days'),
1077 * Exportable document formats.
1081 public static function documentFormat() {
1083 'pdf' => ts('Portable Document Format (.pdf)'),
1084 'docx' => ts('MS Word (.docx)'),
1085 'odt' => ts('Open Office (.odt)'),
1086 'html' => ts('Webpage (.html)'),