From 3a7773be13e943a5dacb028fcb3edbcf0e8b97b7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 23 Dec 2015 20:10:40 -0500 Subject: [PATCH] CRM_Core_BAO_CustomField - Remove unused param --- CRM/Activity/BAO/Query.php | 2 +- CRM/Campaign/BAO/Query.php | 2 +- CRM/Case/BAO/Query.php | 6 +----- CRM/Contact/Form/Search/Criteria.php | 18 +++--------------- CRM/Contribute/BAO/ContributionRecur.php | 6 +----- CRM/Contribute/BAO/Query.php | 6 +----- CRM/Core/BAO/CustomField.php | 16 ++++------------ CRM/Core/BAO/CustomGroup.php | 2 +- CRM/Core/BAO/UFGroup.php | 4 ++-- CRM/Core/Form.php | 2 +- CRM/Custom/Form/Preview.php | 2 +- CRM/Event/BAO/Query.php | 6 +----- CRM/Grant/BAO/Query.php | 6 +----- CRM/Member/BAO/Query.php | 6 +----- CRM/Pledge/BAO/Query.php | 6 +----- 15 files changed, 21 insertions(+), 69 deletions(-) diff --git a/CRM/Activity/BAO/Query.php b/CRM/Activity/BAO/Query.php index adfd8fb490..2626bd2b25 100644 --- a/CRM/Activity/BAO/Query.php +++ b/CRM/Activity/BAO/Query.php @@ -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); } } } diff --git a/CRM/Campaign/BAO/Query.php b/CRM/Campaign/BAO/Query.php index 78b653f1b0..523ebb69e2 100755 --- a/CRM/Campaign/BAO/Query.php +++ b/CRM/Campaign/BAO/Query.php @@ -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; } } diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index c13fc984a8..7e72186362 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -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); } } } diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index bdfcec58d5..37cd6c4274 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -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); } } } diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index ca7c4009a4..1403ae18d7 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -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); } } } diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index 15330cb87b..c39a490372 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -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); } } } diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index c92b20c35b..f886d41ee1 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -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; diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index dafb03aed7..73a2501130 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -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); } } } diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index fdb4eda617..6ab0e76dd0 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -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( diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index c4a4d65b90..d282e8cd56 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -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. diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php index d9aa9ab2c8..80565596fd 100644 --- a/CRM/Custom/Form/Preview.php +++ b/CRM/Custom/Form/Preview.php @@ -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); diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index f2f0d16f1b..96cf00f4f3 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -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); } } } diff --git a/CRM/Grant/BAO/Query.php b/CRM/Grant/BAO/Query.php index 830573adb7..fbd7ba972d 100644 --- a/CRM/Grant/BAO/Query.php +++ b/CRM/Grant/BAO/Query.php @@ -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); } } } diff --git a/CRM/Member/BAO/Query.php b/CRM/Member/BAO/Query.php index 60f7793ba5..efccbe25b5 100644 --- a/CRM/Member/BAO/Query.php +++ b/CRM/Member/BAO/Query.php @@ -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); } } } diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index c8ee552961..2d890f373d 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -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); } } } -- 2.25.1