cleanup function and remove unused param
authorkurund <kurund@civicrm.org>
Thu, 22 Aug 2013 20:09:06 +0000 (01:39 +0530)
committerkurund <kurund@civicrm.org>
Thu, 22 Aug 2013 20:09:06 +0000 (01:39 +0530)
CRM/Case/Form/CustomData.php
CRM/Contact/Form/Edit/Address.php
CRM/Core/BAO/CustomGroup.php
CRM/Custom/Form/CustomData.php
tools/drupal/modules/civicrm_regsite/civicrm_regsite.module

index 2d5c83ff3d5c9b4aaca94a11067bd8da05a7d69c..681eaf4afbc7ddf8c79fe3d2614b23f59e43e205 100644 (file)
@@ -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);
index 6c6ff2613f80c683477177b59c9abd313393d024..42c83697615f3e088c1c38045c1864a58a71a829 100644 (file)
@@ -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');
index a6d9bd7ee202f878c5180aa7121b23de48b60d3e..a4fd28ade365205b2801247d21c7c8d272b3db6b 100644 (file)
@@ -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
index ad02bf58369c5d09ece8943115ae3024d128f729..e0189b7670f37b5c425f5ad87283a8b9e6574687 100644 (file)
@@ -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);
   }
 }
 
index b6d80a1ad91cc9d5835b4f539ee78da6516b2f33..6db359bff410e7684e8a8deca9614a31bc0b9c59 100644 (file)
@@ -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');