Skip to content

Commit

Permalink
Fix address options page
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Oct 29, 2018
1 parent 6b59316 commit 5eadd1f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
14 changes: 6 additions & 8 deletions CRM/Admin/Form/Preferences/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
* This class generates form components for Address Section.
*/
class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences {

protected $_settings = [
'address_options' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
];

public function preProcess() {

CRM_Utils_System::setTitle(ts('Settings - Addresses'));
Expand All @@ -46,11 +51,6 @@ public function preProcess() {

$this->_varNames = array(
CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array(
'address_options' => array(
'html_type' => 'checkboxes',
'title' => ts('Address Fields'),
'weight' => 1,
),
'address_format' => array(
'html_type' => 'textarea',
'title' => ts('Display Format'),
Expand Down Expand Up @@ -98,7 +98,7 @@ public function preProcess() {
* @return array
*/
public function setDefaultValues() {
$defaults = array();
$defaults = parent::setDefaultValues();
$defaults['address_standardization_provider'] = $this->_config->address_standardization_provider;
$defaults['address_standardization_userid'] = $this->_config->address_standardization_userid;
$defaults['address_standardization_url'] = $this->_config->address_standardization_url;
Expand All @@ -109,8 +109,6 @@ public function setDefaultValues() {
$defaults['mailing_format'] = $this->_config->mailing_format;
$defaults['hideCountryMailingLabels'] = $this->_config->hideCountryMailingLabels;

parent::cbsDefaultValues($defaults);

return $defaults;
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Admin/Form/Preferences/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ class CRM_Admin_Form_Preferences_Event extends CRM_Admin_Form_Preferences {
'enable_cart' => CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
'show_events' => CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
];

}
6 changes: 4 additions & 2 deletions CRM/Core/SelectValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,10 +1113,12 @@ public static function getPermissionedRelationshipOptions() {
* Get option values for dashboard entries (used for 'how many events to display on dashboard').
*
* @return array
* [-1 => 'Show All', 10 => 10, 20 => 20... 100 => 100]
* Dasboard entries options - in practice [-1 => 'Show All', 10 => 10, 20 => 20, ... 100 => 100].
*/
public static function getDashboardEntriesCount() {
$optionValues = [-1 => ts('show all')];
$optionValues = [
-1 => ts('show all'),
];
for ($i = 10; $i <= 100; $i += 10) {
$optionValues[$i] = $i;
}
Expand Down
5 changes: 3 additions & 2 deletions settings/Core.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,18 @@
'group' => 'core',
'name' => 'address_options',
'type' => 'String',
'html_type' => 'Text',
'html_type' => 'checkboxes',
'pseudoconstant' => array(
'optionGroupName' => 'address_options',
),
'default' => '123456891011',
'add' => '4.1',
'title' => 'Addressing Options',
'title' => ts('Address Fields'),
'is_domain' => 1,
'is_contact' => 0,
'description' => NULL,
'help_text' => NULL,
'serialize' => CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND,
),
'address_format' => array(
'group_name' => 'CiviCRM Preferences',
Expand Down
4 changes: 2 additions & 2 deletions settings/Event.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'is_contact' => 0,
'description' => ts('This feature allows users to register for more than one event at a time. When enabled, users will add event(s) to a "cart" and then pay for them all at once. Enabling this setting will affect online registration for all active events. The code is an alpha state, and you will potentially need to have developer resources to debug and fix sections of the codebase while testing and deploying it'),
'help_text' => '',
'help_link' => ['page' => 'CiviEvent Cart Checkout', 'resource' => 'wiki']
'help_link' => ['page' => 'CiviEvent Cart Checkout', 'resource' => 'wiki'],
),
'show_events' => array(
'name' => 'show_events',
Expand All @@ -66,6 +66,6 @@
'help_text' => NULL,
'pseudoconstant' => [
'callback' => 'CRM_Core_SelectValues::getDashboardEntriesCount',
]
],
),
);

0 comments on commit 5eadd1f

Please sign in to comment.