CRM-16401 - Allow admin to set which day is the first day of the week
authorColeman Watts <coleman@civicrm.org>
Fri, 19 Jun 2015 03:12:19 +0000 (23:12 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 19 Jun 2015 03:12:19 +0000 (23:12 -0400)
CRM/Admin/Form/Setting/Date.php
settings/Localization.setting.php
templates/CRM/Admin/Form/Setting/Date.tpl

index 470cfbaa6a05895fe84148d506cfa205e900a70c..b01810861a845a1c27e6ea63d3417375713efe68 100644 (file)
  */
 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.
    *
index fb502a7939ac3aebd249c7d312231f61598c528f..a8fc48d7b6dc5b24680418953241e88ba7198102 100644 (file)
@@ -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,
+  ),
 );
index 71b550c1bb1f0693409007b8eb39194e7df08d77..a30bc408d73db9b960dda33cfe826700ed5d09ba 100644 (file)
        </tr>
    </table>
 </fieldset>
-<fieldset><legend>{ts}Fiscal Year{/ts}</legend>
+<fieldset><legend>{ts}Calendar{/ts}</legend>
    <table class="form-layout-compressed">
+       <tr class="crm-date-form-block-weekBegins">
+         <td class="label">{$form.weekBegins.label}</td>
+         <td>{$form.weekBegins.html}</td>
+       </tr>
        <tr class="crm-date-form-block-fiscalYearStart">
           <td class="label">{$form.fiscalYearStart.label}</td>
           <td>{$form.fiscalYearStart.html}</td>