X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSelectValues.php;h=506fce1804717b7e847fc699da3d73592e79cecf;hb=536f0e025a823c6ed9c7926d885f3e6bc108e6bc;hp=2e30aafd67cbb6ad4ec3a99c3432e93a5f873ed7;hpb=2817d84b3736cb0c6051fd9fac875e85f8497caa;p=civicrm-core.git diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 2e30aafd67..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,12 +31,24 @@ * 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 { + /** + * Yes/No options + * + * @return array + */ + public static function boolean() { + return array( + 1 => ts('Yes'), + 0 => ts('No'), + ); + } + /** * Preferred mail format. * @@ -231,7 +243,6 @@ class CRM_Core_SelectValues { * Styles for displaying the custom data group. * * @return array - * */ public static function customGroupStyle() { return array( @@ -265,7 +276,6 @@ class CRM_Core_SelectValues { * The status of a contact within a group. * * @return array - * */ public static function groupContactStatus() { 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'), @@ -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) { @@ -863,6 +873,9 @@ class CRM_Core_SelectValues { */ 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'), @@ -968,18 +981,21 @@ class CRM_Core_SelectValues { /** * 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)), + ); } }