From 6d9ac92c5af39600f88e8a1b1569bf9dbc62f4ea Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 18 Jun 2015 23:12:19 -0400 Subject: [PATCH] CRM-16401 - Allow admin to set which day is the first day of the week --- CRM/Admin/Form/Setting/Date.php | 4 ++++ settings/Localization.setting.php | 16 ++++++++++++++++ templates/CRM/Admin/Form/Setting/Date.tpl | 6 +++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Setting/Date.php b/CRM/Admin/Form/Setting/Date.php index 470cfbaa6a..b01810861a 100644 --- a/CRM/Admin/Form/Setting/Date.php +++ b/CRM/Admin/Form/Setting/Date.php @@ -39,6 +39,10 @@ */ class CRM_Admin_Form_Setting_Date extends CRM_Admin_Form_Setting { + public $_settings = array( + 'weekBegins' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, + ); + /** * Build the form object. * diff --git a/settings/Localization.setting.php b/settings/Localization.setting.php index fb502a7939..a8fc48d7b6 100644 --- a/settings/Localization.setting.php +++ b/settings/Localization.setting.php @@ -297,4 +297,20 @@ return array( 'description' => '', 'help_text' => NULL, ), + 'weekBegins' => array( + 'group_name' => 'Localization Preferences', + 'group' => 'localization', + 'name' => 'weekBegins', + 'type' => 'String', + 'quick_form_type' => 'Element', + 'html_type' => 'select', + 'option_values' => CRM_Utils_Date::getFullWeekdayNames(), + 'default' => '0', + 'add' => '4.7', + 'title' => 'Week begins on', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => "", + 'help_text' => NULL, + ), ); diff --git a/templates/CRM/Admin/Form/Setting/Date.tpl b/templates/CRM/Admin/Form/Setting/Date.tpl index 71b550c1bb..a30bc408d7 100644 --- a/templates/CRM/Admin/Form/Setting/Date.tpl +++ b/templates/CRM/Admin/Form/Setting/Date.tpl @@ -65,8 +65,12 @@ -
{ts}Fiscal Year{/ts} +
{ts}Calendar{/ts} + + + + -- 2.25.1
{$form.weekBegins.label}{$form.weekBegins.html}
{$form.fiscalYearStart.label} {$form.fiscalYearStart.html}