X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSelectValues.php;h=506fce1804717b7e847fc699da3d73592e79cecf;hb=536f0e025a823c6ed9c7926d885f3e6bc108e6bc;hp=40d983c454bd161c3379d38c70c58ceb159fe7b0;hpb=04d2e082924ee167fa35b78dfaacfaef07c8cd8a;p=civicrm-core.git diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 40d983c454..506fce1804 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -31,14 +31,26 @@ * smart caching scheme on a per domain basis * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ class CRM_Core_SelectValues { /** - * Preferred mail format + * Yes/No options + * + * @return array + */ + public static function boolean() { + return array( + 1 => ts('Yes'), + 0 => ts('No'), + ); + } + + /** + * Preferred mail format. * * @return array */ @@ -51,7 +63,7 @@ class CRM_Core_SelectValues { } /** - * Privacy options + * Privacy options. * * @return array */ @@ -67,7 +79,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined contact super types + * Various pre defined contact super types. * * @return array */ @@ -80,7 +92,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined unit list + * Various pre defined unit list. * * @param string $unitType * @return array @@ -98,7 +110,7 @@ class CRM_Core_SelectValues { } /** - * Membership type unit + * Membership type unit. * * @return array */ @@ -107,7 +119,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined period types + * Various pre defined period types. * * @return array */ @@ -119,7 +131,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined email selection methods + * Various pre defined email selection methods. * * @return array */ @@ -133,7 +145,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined member visibility options + * Various pre defined member visibility options. * * @return array */ @@ -158,7 +170,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined event dates + * Various pre defined event dates. * * @return array */ @@ -171,7 +183,7 @@ class CRM_Core_SelectValues { } /** - * Custom form field types + * Custom form field types. * * @return array */ @@ -198,7 +210,7 @@ class CRM_Core_SelectValues { } /** - * Various pre defined extensions for dynamic properties and groups + * Various pre defined extensions for dynamic properties and groups. * * @return array * @@ -228,10 +240,9 @@ class CRM_Core_SelectValues { } /** - * Styles for displaying the custom data group + * Styles for displaying the custom data group. * * @return array - * */ public static function customGroupStyle() { return array( @@ -242,7 +253,7 @@ class CRM_Core_SelectValues { } /** - * For displaying the uf group types + * For displaying the uf group types. * * @return array */ @@ -262,10 +273,9 @@ class CRM_Core_SelectValues { } /** - * The status of a contact within a group + * The status of a contact within a group. * * @return array - * */ public static function groupContactStatus() { return array( @@ -276,7 +286,7 @@ class CRM_Core_SelectValues { } /** - * List of Group Types + * List of Group Types. * * @return array */ @@ -288,7 +298,7 @@ class CRM_Core_SelectValues { } /** - * Compose the parameters for a date select object + * Compose the parameters for a date select object. * * @param string|NULL $type * the type of date @@ -340,7 +350,7 @@ class CRM_Core_SelectValues { } /** - * Values for UF form visibility options + * Values for UF form visibility options. * * @return array */ @@ -353,7 +363,7 @@ class CRM_Core_SelectValues { } /** - * Values for group form visibility options + * Values for group form visibility options. * * @return array */ @@ -365,7 +375,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Mailing Components + * Different type of Mailing Components. * * @return array */ @@ -383,7 +393,7 @@ class CRM_Core_SelectValues { } /** - * Get hours + * Get hours. * * @return array */ @@ -396,7 +406,7 @@ class CRM_Core_SelectValues { } /** - * Get minutes + * Get minutes. * * @return array */ @@ -409,7 +419,7 @@ class CRM_Core_SelectValues { } /** - * Get the Map Provider + * Get the Map Provider. * * @return array * array of map providers @@ -423,7 +433,7 @@ class CRM_Core_SelectValues { } /** - * Get the Geocoding Providers from available plugins + * Get the Geocoding Providers from available plugins. * * @return array * array of geocoder providers @@ -437,7 +447,7 @@ class CRM_Core_SelectValues { } /** - * Get the Address Standardization Providers from available plugins + * Get the Address Standardization Providers from available plugins. * * @return array * array of address standardization providers @@ -451,7 +461,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Mailing Tokens + * Different type of Mailing Tokens. * * @return array */ @@ -477,7 +487,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Activity Tokens + * Different type of Activity Tokens. * * @return array */ @@ -491,7 +501,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Membership Tokens + * Different type of Membership Tokens. * * @return array */ @@ -508,7 +518,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Event Tokens + * Different type of Event Tokens. * * @return array */ @@ -532,7 +542,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Event Tokens + * Different type of Event Tokens. * * @return array */ @@ -543,8 +553,8 @@ class CRM_Core_SelectValues { '{contribution.fee_amount}' => ts('Fee Amount'), '{contribution.net_amount}' => ts('Net Amount'), '{contribution.non_deductible_amount}' => ts('Non-deductible Amount'), - '{contribution.receive_date}' => ts('Contribution Receive Date'), - '{contribution.payment_instrument}' => ts('Payment Instrument'), + '{contribution.receive_date}' => ts('Contribution Date Received'), + '{contribution.payment_instrument}' => ts('Payment Method'), '{contribution.trxn_id}' => ts('Transaction ID'), '{contribution.invoice_id}' => ts('Invoice ID'), '{contribution.currency}' => ts('Currency'), @@ -565,7 +575,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Contact Tokens + * Different type of Contact Tokens. * * @return array */ @@ -617,7 +627,7 @@ class CRM_Core_SelectValues { } } - // might as well get all the hook tokens to + // Get all the hook tokens too $hookTokens = array(); CRM_Utils_Hook::tokens($hookTokens); foreach ($hookTokens as $tokenValues) { @@ -640,7 +650,7 @@ class CRM_Core_SelectValues { } /** - * Different type of Participant Tokens + * Different type of Participant Tokens. * * @return array */ @@ -683,7 +693,7 @@ class CRM_Core_SelectValues { } /** - * CiviCRM supported date input formats + * CiviCRM supported date input formats. * * @return array */ @@ -723,7 +733,7 @@ class CRM_Core_SelectValues { } /** - * Map date plugin and actual format that is used by PHP + * Map date plugin and actual format that is used by PHP. * * @return array */ @@ -749,7 +759,7 @@ class CRM_Core_SelectValues { } /** - * Time formats + * Time formats. * * @return array */ @@ -761,7 +771,7 @@ class CRM_Core_SelectValues { } /** - * Get numeric options + * Get numeric options. * * @param int $start * @param int $end @@ -777,7 +787,7 @@ class CRM_Core_SelectValues { } /** - * Barcode types + * Barcode types. * * @return array */ @@ -789,7 +799,7 @@ class CRM_Core_SelectValues { } /** - * Dedupe rule types + * Dedupe rule types. * * @return array */ @@ -802,7 +812,7 @@ class CRM_Core_SelectValues { } /** - * Campaign group types + * Campaign group types. * * @return array */ @@ -814,7 +824,7 @@ class CRM_Core_SelectValues { } /** - * Subscription history method + * Subscription history method. * * @return array */ @@ -828,7 +838,7 @@ class CRM_Core_SelectValues { } /** - * Premium units + * Premium units. * * @return array */ @@ -842,7 +852,7 @@ class CRM_Core_SelectValues { } /** - * Extension types + * Extension types. * * @return array */ @@ -857,12 +867,15 @@ class CRM_Core_SelectValues { } /** - * Job frequency + * Job frequency. * * @return array */ public static function getJobFrequency() { return array( + '1stOfQtr' => ts('1st day of every quarter'), + '1stOfMth' => ts('1st day of every month'), + 'Mondays' => ts('Monday of every week'), 'Daily' => ts('Daily'), 'Hourly' => ts('Hourly'), 'Always' => ts('Every time cron job is run'), @@ -870,7 +883,7 @@ class CRM_Core_SelectValues { } /** - * Search builder operators + * Search builder operators. * * @return array */ @@ -895,7 +908,7 @@ class CRM_Core_SelectValues { } /** - * Profile group types + * Profile group types. * * @return array */ @@ -915,7 +928,7 @@ class CRM_Core_SelectValues { /** - * Word replacement match type + * Word replacement match type. * * @return array */ @@ -927,7 +940,7 @@ class CRM_Core_SelectValues { } /** - * Mailing group types + * Mailing group types. * * @return array */ @@ -940,7 +953,7 @@ class CRM_Core_SelectValues { } /** - * Mailing Job Status + * Mailing Job Status. * * @return array */ @@ -966,20 +979,23 @@ class CRM_Core_SelectValues { } /** - * Frequency unit for schedule reminders + * Frequency unit for schedule reminders. * + * @param int $count + * For pluralization * @return array */ - public static function getScheduleReminderFrequencyUnits() { - //@todo update schema to refer to option group direct & remove this - static $scheduleReminderFrequencyUnits = NULL; - if (!$scheduleReminderFrequencyUnits) { - $scheduleReminderFrequencyUnits = array( - 'hour' => ts('hour'), - ) + CRM_Core_OptionGroup::values('recur_frequency_units'); - } - - return $scheduleReminderFrequencyUnits; + public static function getRecurringFrequencyUnits($count = 1) { + // @todo this used to refer to the 'recur_frequency_unit' option_values which + // is for recurring payments and probably not good to re-use for recurring entities. + // If something other than a hard-coded list is desired, add a new option_group. + return array( + 'hour' => ts('hour', array('plural' => 'hours', 'count' => $count)), + 'day' => ts('day', array('plural' => 'days', 'count' => $count)), + 'week' => ts('week', array('plural' => 'weeks', 'count' => $count)), + 'month' => ts('month', array('plural' => 'months', 'count' => $count)), + 'year' => ts('year', array('plural' => 'years', 'count' => $count)), + ); } }