CRM_Core_BAO_CustomField - Remove unused param
authorColeman Watts <coleman@civicrm.org>
Thu, 24 Dec 2015 01:10:40 +0000 (20:10 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 26 Dec 2015 03:08:42 +0000 (22:08 -0500)
15 files changed:
CRM/Activity/BAO/Query.php
CRM/Campaign/BAO/Query.php
CRM/Case/BAO/Query.php
CRM/Contact/Form/Search/Criteria.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/BAO/Query.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/CustomGroup.php
CRM/Core/BAO/UFGroup.php
CRM/Core/Form.php
CRM/Custom/Form/Preview.php
CRM/Event/BAO/Query.php
CRM/Grant/BAO/Query.php
CRM/Member/BAO/Query.php
CRM/Pledge/BAO/Query.php

index adfd8fb490fde2431eefbcbd457b38832829a33c..2626bd2b25d2cb68ff0c8bec72d6826469ad28cf 100644 (file)
@@ -462,7 +462,7 @@ class CRM_Activity_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index 78b653f1b001e8830baa0ce38b2fa90276f24e44..523ebb69e2f653e0aa9e590326f287d00611b7c3 100755 (executable)
@@ -406,7 +406,7 @@ INNER JOIN  civicrm_custom_group grp on fld.custom_group_id = grp.id
           $fieldId = $dao->id;
           $fieldName = 'custom_' . $dao->id;
           $customSearchFields[$name] = $fieldName;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form, $fieldName, $fieldId, FALSE, FALSE);
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $fieldName, $fieldId, FALSE);
           break;
         }
       }
index c13fc984a8d2c13627bca3cb73e2c61ed50515ed..7e721863626ab45da4ea0c0ff604c803dec9b9e6 100644 (file)
@@ -715,11 +715,7 @@ case_relation_type.id = case_relationship.relationship_type_id )";
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index bdfcec58d5a7911c2bc21ed1a273d9391a2b9505..37cd6c4274fc744c405e1d42bb8ad2ddc13198c6 100644 (file)
@@ -372,11 +372,7 @@ class CRM_Contact_Form_Search_Criteria {
       foreach ($groupDetails as $group) {
         foreach ($group['fields'] as $field) {
           $elementName = 'custom_' . $field['id'];
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $field['id'],
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $field['id'], FALSE, TRUE);
         }
       }
     }
@@ -452,11 +448,7 @@ class CRM_Contact_Form_Search_Criteria {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
@@ -533,11 +525,7 @@ class CRM_Contact_Form_Search_Criteria {
       foreach ($group['fields'] as $field) {
         $fieldId = $field['id'];
         $elementName = 'custom_' . $fieldId;
-        CRM_Core_BAO_CustomField::addQuickFormElement($form,
-          $elementName,
-          $fieldId,
-          FALSE, FALSE, TRUE
-        );
+        CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
       }
     }
   }
index ca7c4009a4eee831881cc1c539c7f81dd81834fc..1403ae18d71896b5b884cc5a5b229719b000d3a6 100644 (file)
@@ -742,11 +742,7 @@ INNER JOIN civicrm_contribution       con ON ( con.id = mp.contribution_id )
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index 15330cb87b0b734125efe8e3d467ed7ccc8b9b3b..c39a490372221eefb83bcca447cd35d51ef2cbcd 100644 (file)
@@ -1106,11 +1106,7 @@ class CRM_Contribute_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index c92b20c35b8afdcf1f896b261a4a08c125e88f76..f886d41ee1179b807f499a8db9ec617db51006b7 100644 (file)
@@ -777,32 +777,24 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
   }
 
   /**
-   * This function for building custom fields.
+   * Add a custom field to an existing form.
    *
    * @param CRM_Core_Form $qf
    *   Form object (reference).
    * @param string $elementName
    *   Name of the custom field.
    * @param int $fieldId
-   * @param bool $inactiveNeeded
-   *   -deprecated.
    * @param bool $useRequired
    *   True if required else false.
    * @param bool $search
    *   True if used for search else false.
    * @param string $label
    *   Label for custom field.
-   *
-   * @return HTML_QuickForm_Element|null
+   * @return \HTML_QuickForm_Element|null
+   * @throws \CiviCRM_API3_Exception
    */
   public static function addQuickFormElement(
-    &$qf,
-    $elementName,
-    $fieldId,
-    $inactiveNeeded = FALSE,
-    $useRequired = TRUE,
-    $search = FALSE,
-    $label = NULL
+    $qf, $elementName, $fieldId, $useRequired = TRUE, $search = FALSE, $label = NULL
   ) {
     $field = self::getFieldObject($fieldId);
     $widget = $field->html_type;
index dafb03aed759e8f8b15f0ccf8b2eae9952283cbd..73a2501130d2891518220d7171b32e40302b1873 100644 (file)
@@ -1557,7 +1557,7 @@ ORDER BY civicrm_custom_group.weight,
 
         $fieldId = $field['id'];
         $elementName = $field['element_name'];
-        CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, $inactiveNeeded, $required);
+        CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, $required);
       }
     }
   }
index fdb4eda617f73f318271afebe89116d9199214eb..6ab0e76dd00bdf64f821988bb5ea93ab104bc120 100644 (file)
@@ -2099,14 +2099,14 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
     elseif (substr($fieldName, 0, 6) === 'custom') {
       $customFieldID = CRM_Core_BAO_CustomField::getKeyID($fieldName);
       if ($customFieldID) {
-        CRM_Core_BAO_CustomField::addQuickFormElement($form, $name, $customFieldID, FALSE, $required, $search, $title);
+        CRM_Core_BAO_CustomField::addQuickFormElement($form, $name, $customFieldID, $required, $search, $title);
       }
     }
     elseif (substr($fieldName, 0, 14) === 'address_custom') {
       list($fName, $locTypeId) = CRM_Utils_System::explode('-', $fieldName, 2);
       $customFieldID = CRM_Core_BAO_CustomField::getKeyID(substr($fName, 8));
       if ($customFieldID) {
-        CRM_Core_BAO_CustomField::addQuickFormElement($form, $name, $customFieldID, FALSE, $required, $search, $title);
+        CRM_Core_BAO_CustomField::addQuickFormElement($form, $name, $customFieldID, $required, $search, $title);
       }
     }
     elseif (in_array($fieldName, array(
index c4a4d65b90f14d1bd111c86915b66d185aa18cd3..d282e8cd56456e6055e5b57357b1270d083f68b6 100644 (file)
@@ -1353,7 +1353,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     // Handle custom fields
     if (strpos($name, 'custom_') === 0 && is_numeric($name[7])) {
       $fieldId = (int) substr($name, 7);
-      return CRM_Core_BAO_CustomField::addQuickFormElement($this, $name, $fieldId, FALSE, $required, $props['context'] == 'search', CRM_Utils_Array::value('label', $props));
+      return CRM_Core_BAO_CustomField::addQuickFormElement($this, $name, $fieldId, $required, $props['context'] == 'search', CRM_Utils_Array::value('label', $props));
     }
 
     // Core field - get metadata.
index d9aa9ab2c8e4c42f45fedd201c7a5ee143fcc0a4..80565596fd5e06bf475bb0591b1bf5d353f9eaa4 100644 (file)
@@ -112,7 +112,7 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form {
     if (is_array($this->_groupTree[$this->_groupId])) {
       foreach ($this->_groupTree[$this->_groupId]['fields'] as & $field) {
         //add the form elements
-        CRM_Core_BAO_CustomField::addQuickFormElement($this, $field['element_name'], $field['id'], FALSE, CRM_Utils_Array::value('is_required', $field));
+        CRM_Core_BAO_CustomField::addQuickFormElement($this, $field['element_name'], $field['id'], CRM_Utils_Array::value('is_required', $field));
       }
 
       $this->assign('groupTree', $this->_groupTree);
index f2f0d16f1bd3f9f6a9b7919530fcee55c769edd1..96cf00f4f3f2727a188c75aa682e6f58cc8656ca 100644 (file)
@@ -613,11 +613,7 @@ class CRM_Event_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index 830573adb7a77b99104ddbf28a641d773a2b8d41..fbd7ba972d23f16327e3a46c3c13dd30e4514345 100644 (file)
@@ -363,11 +363,7 @@ class CRM_Grant_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index 60f7793ba5e490db7be4d0bf7e543fa1ac5f2f53..efccbe25b537ad590b08f2460f74f6b49b8dc02f 100644 (file)
@@ -451,11 +451,7 @@ class CRM_Member_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }
index c8ee5529617e94935c2ce7456219386328fa35cc..2d890f373dc47e4ac0a977042f6613b1f9b7b84e 100644 (file)
@@ -566,11 +566,7 @@ class CRM_Pledge_BAO_Query {
         foreach ($group['fields'] as $field) {
           $fieldId = $field['id'];
           $elementName = 'custom_' . $fieldId;
-          CRM_Core_BAO_CustomField::addQuickFormElement($form,
-            $elementName,
-            $fieldId,
-            FALSE, FALSE, TRUE
-          );
+          CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
       }
     }