'month' => ts('month'),
'year' => ts('year'),
];
- if ($unitType == 'duration') {
+ if ($unitType === 'duration') {
$unitList['lifetime'] = ts('lifetime');
}
return $unitList;
*/
public static function emailSelectMethods() {
return [
- 'automatic' => ts("Automatic"),
- 'location-only' => ts("Only send to email addresses assigned to the specified location"),
- 'location-prefer' => ts("Prefer email addresses assigned to the specified location"),
- 'location-exclude' => ts("Exclude email addresses assigned to the specified location"),
+ 'automatic' => ts('Automatic'),
+ 'location-only' => ts('Only send to email addresses assigned to the specified location'),
+ 'location-prefer' => ts('Prefer email addresses assigned to the specified location'),
+ 'location-exclude' => ts('Exclude email addresses assigned to the specified location'),
];
}
*
* @return array
* the date array
- * @throws \Exception
+ * @throws CRM_Core_Exception
*/
public static function date($type = NULL, $format = NULL, $minOffset = NULL, $maxOffset = NULL, $context = 'display') {
// These options are deprecated. Definitely not used in datepicker. Possibly not even in jcalendar+addDateTime.
$dao = new CRM_Core_DAO_PreferencesDate();
$dao->name = $type;
if (!$dao->find(TRUE)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Date preferences not configured.');
}
if (!$maxOffset) {
$maxOffset = $dao->end;
}
if (empty($date['format'])) {
- if ($context == 'Input') {
+ if ($context === 'Input') {
$date['format'] = Civi::settings()->get('dateInputFormat');
}
else {
return $geo;
}
+ /**
+ * Get options for displaying tax.
+ *
+ * @return array
+ *
+ * @throws \CRM_Core_Exception
+ */
+ public function taxDisplayOptions() {
+ return [
+ 'Do_not_show' => ts('Do not show breakdown, only show total - i.e %1', [
+ 1 => CRM_Utils_Money::format(120),
+ ]),
+ 'Inclusive' => ts('Show [tax term] inclusive price - i.e. %1', [
+ 1 => ts('%1 (includes [tax term] of %2)', [1 => CRM_Utils_Money::format(120), 2 => CRM_Utils_Money::format(20)]),
+ ]),
+ 'Exclusive' => ts('Show [tax term] exclusive price - i.e. %1', [
+ 1 => ts('%1 + %2 [tax term]', [1 => CRM_Utils_Money::format(120), 2 => CRM_Utils_Money::format(20)]),
+ ]),
+ ];
+ }
+
/**
* Get the Address Standardization Providers from available plugins.
*
*
* @return array
*/
- public static function getSearchBuilderOperators($fieldType = NULL) {
+ public static function getSearchBuilderOperators() {
return [
'=' => '=',
'!=' => '≠',
* Dropdown options for quicksearch in the menu
*
* @return array
+ * @throws \CiviCRM_API3_Exception
*/
public static function quicksearchOptions() {
$includeEmail = civicrm_api3('setting', 'getvalue', ['name' => 'includeEmailInName', 'group' => 'Search Preferences']);