+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* 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.
*
* Styles for displaying the custom data group.
*
* @return array
- *
*/
public static function customGroupStyle() {
return array(
* The status of a contact within a group.
*
* @return array
- *
*/
public static function groupContactStatus() {
return array(
'{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'),
}
}
- // 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) {
*/
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'),
/**
* 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)),
+ );
}
}