CRM-16373 - Config - Migrate fiscalYearStart
authorTim Otten <totten@civicrm.org>
Tue, 18 Aug 2015 01:54:33 +0000 (18:54 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 18 Aug 2015 01:55:49 +0000 (18:55 -0700)
CRM/Admin/Form/Setting/Date.php
CRM/Core/Form.php
settings/Localization.setting.php

index e43136ca69ae0f3cc3f1c21f6859d79cae4d988b..575997e204adc5dae0d169dcd24bd20501bfea32 100644 (file)
@@ -43,6 +43,7 @@ class CRM_Admin_Form_Setting_Date extends CRM_Admin_Form_Setting {
     'weekBegins' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'dateInputFormat' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'timeInputFormat' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
+    'fiscalYearStart' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
   );
 
   /**
@@ -59,10 +60,6 @@ class CRM_Admin_Form_Setting_Date extends CRM_Admin_Form_Setting {
     $this->addElement('text', 'dateformatYear', ts('Year Only'));
     $this->addElement('text', 'dateformatTime', ts('Time Only'));
 
-    $this->add('date', 'fiscalYearStart', ts('Fiscal Year Start'),
-      CRM_Core_SelectValues::date(NULL, 'M d')
-    );
-
     parent::buildQuickForm();
   }
 
index d4f144091ea2771559a91d25c662f5f1c026cc70..932c1d81844525f18d6834de7e778193a5a95fe3 100644 (file)
@@ -343,6 +343,19 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     return $element;
   }
 
+  /**
+   * Add an element for inputting a month+day (partial date).
+   *
+   * @param string $name
+   * @param string $label
+   * @return HTML_QuickForm_Element
+   */
+  public function addMonthDay($name, $label) {
+    return $this->add('date', $name, $label,
+      CRM_Core_SelectValues::date(NULL, 'M d')
+    );
+  }
+
   /**
    * called before buildForm. Any pre-processing that
    * needs to be done for buildForm should be done here
index 517f57fa33f7c8a1979a44b6448069f7dbc76154..d7775c5602f222ebf6e78d5ad3a7a81eba165852 100644 (file)
@@ -383,6 +383,22 @@ return array(
     'title' => 'Import / Export Field Separator',
     'description' => 'Global CSV separator character. Modify this setting to enable import and export of different kinds of CSV files (for example: \',\' \';\' \':\' \'|\' ).',
   ),
+  'fiscalYearStart' => array(
+    'add' => '4.7',
+    'prefetch' => 1,
+    'help_text' => NULL,
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'group_name' => 'Localization Preferences',
+    'group' => 'localization',
+    'name' => 'fiscalYearStart',
+    'type' => 'Array',
+    'quick_form_type' => 'MonthDay',
+    'html_type' => 'MonthDay',
+    'default' => ',',
+    'title' => 'Fiscal Year Start',
+    'description' => '',
+  ),
   'lcMessages' => array(
     'group_name' => 'Localization Preferences',
     'group' => 'localization',