From 7b226831b3e35be4864a78064660357565822e71 Mon Sep 17 00:00:00 2001 From: kurund Date: Fri, 23 Aug 2013 01:39:06 +0530 Subject: [PATCH] cleanup function and remove unused param --- CRM/Case/Form/CustomData.php | 2 +- CRM/Contact/Form/Edit/Address.php | 2 +- CRM/Core/BAO/CustomGroup.php | 21 +++++-------------- CRM/Custom/Form/CustomData.php | 2 +- .../civicrm_regsite/civicrm_regsite.module | 2 +- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index 2d5c83ff3d..681eaf4afb 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -99,7 +99,7 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form { CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $this->_defaults); $this->setDefaults($this->_defaults); - CRM_Core_BAO_CustomGroup::buildQuickForm($this, $groupTree, FALSE, 1); + CRM_Core_BAO_CustomGroup::buildQuickForm($this, $groupTree); //need to assign custom data type and subtype to the template $this->assign('entityID', $this->_entityID); diff --git a/CRM/Contact/Form/Edit/Address.php b/CRM/Contact/Form/Edit/Address.php index 6c6ff2613f..42c8369761 100644 --- a/CRM/Contact/Form/Edit/Address.php +++ b/CRM/Contact/Form/Edit/Address.php @@ -272,7 +272,7 @@ class CRM_Contact_Form_Edit_Address { // we setting the prefix to 'dnc_' below, so that we don't overwrite smarty's grouptree var. // And we can't set it to 'address_' because we want to set it in a slightly different format. - CRM_Core_BAO_CustomGroup::buildQuickForm($form, $groupTree, FALSE, 1, 'dnc_'); + CRM_Core_BAO_CustomGroup::buildQuickForm($form, $groupTree, FALSE, 'dnc_'); $template = CRM_Core_Smarty::singleton(); $tplGroupTree = $template->get_template_vars('address_groupTree'); diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index a6d9bd7ee2..a4fd28ade3 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1454,34 +1454,23 @@ ORDER BY civicrm_custom_group.weight, /** * generic function to build all the form elements for a specific group tree * - * @param CRM_Core_Form $form the form object - * @param array $groupTree the group tree object - * @param string $showName - * @param string $hideName + * @param object $form the form object + * @param array $groupTree the group tree object + * @param boolean $inactiveNeeded return inactive custom groups + * @param string $prefix prefix for custom grouptree assigned to template * * @return void * @access public * @static */ - static function buildQuickForm(&$form, - &$groupTree, - $inactiveNeeded = FALSE, - $groupCount = 1, - $prefix = '' - ) { - + static function buildQuickForm(&$form, &$groupTree, $inactiveNeeded = FALSE, $prefix = '' ) { $form->assign_by_ref("{$prefix}groupTree", $groupTree); - $sBlocks = array(); - $hBlocks = array(); // this is fix for date field $form->assign('currentYear', date('Y')); foreach ($groupTree as $id => $group) { - CRM_Core_ShowHideBlocks::links($form, $group['title'], '', ''); - - $groupId = CRM_Utils_Array::value('id', $group); foreach ($group['fields'] as $field) { $required = CRM_Utils_Array::value('is_required', $field); //fix for CRM-1620 diff --git a/CRM/Custom/Form/CustomData.php b/CRM/Custom/Form/CustomData.php index ad02bf5836..e0189b7670 100644 --- a/CRM/Custom/Form/CustomData.php +++ b/CRM/Custom/Form/CustomData.php @@ -156,7 +156,7 @@ class CRM_Custom_Form_CustomData { static function buildQuickForm(&$form) { $form->addElement('hidden', 'hidden_custom', 1); $form->addElement('hidden', "hidden_custom_group_count[{$form->_groupID}]", $form->_groupCount); - CRM_Core_BAO_CustomGroup::buildQuickForm($form, $form->_groupTree, FALSE, $form->_groupCount); + CRM_Core_BAO_CustomGroup::buildQuickForm($form, $form->_groupTree); } } diff --git a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module b/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module index b6d80a1ad9..6db359bff4 100644 --- a/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module +++ b/tools/drupal/modules/civicrm_regsite/civicrm_regsite.module @@ -317,7 +317,7 @@ function _event_survey_civicrm_buildForm_Profile($formName, &$form) { ); // simplified formatted groupTree $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $form); - CRM_Core_BAO_CustomGroup::buildQuickForm($form, $groupTree, FALSE, 1, 'event_survey_'); + CRM_Core_BAO_CustomGroup::buildQuickForm($form, $groupTree, FALSE, 'event_survey_'); if (isset($groupTree) && is_array($groupTree)) { $participantId = CRM_Utils_Request::retrieve('pid', 'Positive', $form, TRUE, 0, 'REQUEST'); -- 2.25.1