Remove unused variables
authorColeman Watts <coleman@civicrm.org>
Mon, 12 Jul 2021 18:32:44 +0000 (14:32 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 13 Jul 2021 16:00:11 +0000 (12:00 -0400)
CRM/Activity/Form/Activity.php
CRM/Campaign/Form/Campaign.php
CRM/Campaign/Form/Petition/Signature.php
CRM/Case/Form/Case.php
CRM/Contact/Form/CustomData.php
CRM/Contact/Import/Parser/Contact.php
CRM/Event/Form/ParticipantView.php
CRM/Grant/Form/Grant.php
CRM/Pledge/Form/Pledge.php

index c6b07c4a397dbe7ba522f5b65b8f7d61a722cb9d..482937f3b17c43756412c90d6f3371111cb893ee 100644 (file)
@@ -915,17 +915,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
       $params['activity_type_id'] = $this->_activityTypeId;
     }
 
-    if (!empty($params['hidden_custom']) &&
-      !isset($params['custom'])
-    ) {
-      $customFields = CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE,
-        $this->_activityTypeId
-      );
-      $customFields = CRM_Utils_Array::crmArrayMerge($customFields,
-        CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE,
-          NULL, NULL, TRUE
-        )
-      );
+    if (!empty($params['hidden_custom']) && !isset($params['custom'])) {
       $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
         $this->_activityId,
         'Activity'
index be1e9bc39bcd4da9cfe4aed436fecb602dc13615..d6e7e2e03c5991995240a5a5890bf989b471ddde 100644 (file)
@@ -336,9 +336,6 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
     }
 
     //process custom data.
-    $customFields = CRM_Core_BAO_CustomField::getFields('Campaign', FALSE, FALSE,
-      CRM_Utils_Array::value('campaign_type_id', $params)
-    );
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
       $form->_campaignId,
       'Campaign'
index ae55710cd499cfe3f678a53909571db02ce80c0d..31e7edde21980cb5ed8016e7b266847a5e358755 100644 (file)
@@ -492,14 +492,6 @@ class CRM_Campaign_Form_Petition_Signature extends CRM_Core_Form {
     // get additional custom activity profile field data
     // to save with new signature activity record
     $surveyInfo = $this->bao->getSurveyInfo($this->_surveyId);
-    $customActivityFields = CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE,
-      $surveyInfo['activity_type_id']
-    );
-    $customActivityFields = CRM_Utils_Array::crmArrayMerge($customActivityFields,
-      CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE,
-        NULL, NULL, TRUE
-      )
-    );
 
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
       NULL,
index e2cb93223d6dd803232127150b596dff1082ba76..5d83a0ab82de7e6215cfda35957ea67632428adb 100644 (file)
@@ -389,12 +389,6 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
 
     // 3. format activity custom data
     if (!empty($params['hidden_custom'])) {
-      $customFields = CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE, $this->_activityTypeId);
-      $customFields = CRM_Utils_Array::crmArrayMerge($customFields,
-        CRM_Core_BAO_CustomField::getFields('Activity', FALSE, FALSE,
-          NULL, NULL, TRUE
-        )
-      );
       $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
         $this->_activityId,
         'Activity'
index a6b884c4c97ae61423fc9ab69fb0ce965cf76740..00b771fb7e85d7f1c56943c38c237018592ec1ea 100644 (file)
@@ -230,7 +230,6 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
         $valueIdDefaults = [];
         $groupTreeValueId = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, $this->_copyValueId, $this);
         CRM_Core_BAO_CustomGroup::setDefaults($groupTreeValueId, $valueIdDefaults, FALSE, FALSE, $this->get('action'));
-        $tableId = $groupTreeValueId[$this->_groupID]['table_id'];
         foreach ($valueIdDefaults as $valueIdElementName => $value) {
           // build defaults for COPY action for new record saving
           $valueIdElementNamePieces = explode('_', $valueIdElementName);
@@ -245,13 +244,6 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
       return $customDefaultValue;
     }
 
-    $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_contactType,
-      NULL,
-      $this->_tableID,
-      $this->_groupID,
-      $this->_contactSubType
-    );
-
     if (empty($_POST['hidden_custom_group_count'])) {
       // custom data building in edit mode (required to handle multi-value)
       $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_contactType, NULL, $this->_tableID,
index 113248c951b6bf05313dd400e0a049df52bf40aa..70da80437072187982e4246b97210f369b22ea8a 100644 (file)
@@ -1632,15 +1632,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
     $defaults = [];
     $contactObj = CRM_Contact_BAO_Contact::retrieve($contactParams, $defaults);
 
-    $modeUpdate = $modeFill = FALSE;
-
-    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) {
-      $modeUpdate = TRUE;
-    }
-
-    if ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) {
-      $modeFill = TRUE;
-    }
+    $modeFill = ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL);
 
     $groupTree = CRM_Core_BAO_CustomGroup::getTree($params['contact_type'], NULL, $cid, 0, NULL);
     CRM_Core_BAO_CustomGroup::setDefaults($groupTree, $defaults, FALSE, FALSE);
index 1d4f0bd454ecfffa228ae968b35808052e03f0dc..4345047ff4fe583c1324ab4dcbdbff472bd187f6 100644 (file)
@@ -71,7 +71,6 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
 
     $statusId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantID, 'status_id', 'id');
     $status = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_ParticipantStatusType', $statusId, 'name', 'id');
-    $status = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_ParticipantStatusType', $statusId, 'name', 'id');
     if ($status == 'Transferred') {
       $transferId = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $participantID, 'transferred_to_contact_id', 'id');
       $pid = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_Participant', $transferId, 'id', 'contact_id');
@@ -80,7 +79,6 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
       $this->assign('transferId', $transferId);
       $this->assign('transferName', $transferName);
     }
-    $participantStatuses = CRM_Event_PseudoConstant::participantStatus();
 
     // CRM-20879: Show 'Transfer or Cancel' option beside 'Change fee selection'
     //  only if logged in user have 'edit event participants' permission and
@@ -137,7 +135,6 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form {
     $eventNameCustomDataTypeID = array_search('ParticipantEventName', $customDataType);
     $eventTypeCustomDataTypeID = array_search('ParticipantEventType', $customDataType);
     $allRoleIDs = explode(CRM_Core_DAO::VALUE_SEPARATOR, $values[$participantID]['role_id']);
-    $groupTree = [];
     $finalTree = [];
 
     foreach ($allRoleIDs as $k => $v) {
index 04714b1b6a185bef2d794913d4f43ae125df4704..6d9a7aab2691a2fb6f0857f59f7b2c8e1e2dbd9d 100644 (file)
@@ -243,13 +243,7 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
       $ids['note']['id'] = $this->_noteId;
     }
 
-    // build custom data getFields array
-    $customFieldsGrantType = CRM_Core_BAO_CustomField::getFields('Grant', FALSE, FALSE,
-      CRM_Utils_Array::value('grant_type_id', $params)
-    );
-    $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsGrantType,
-      CRM_Core_BAO_CustomField::getFields('Grant', FALSE, FALSE, NULL, NULL, TRUE)
-    );
+    // build custom data array
     $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
       $this->_id,
       'Grant'
index d7fe5c8837af9b5cc7000aa7fa7ccad93ad6c305..d3759d761dc7ef216d80f1bc77902cdbae0a7b0a 100644 (file)
@@ -488,7 +488,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     if (!empty($formValues['hidden_custom'])) {
       $params['hidden_custom'] = 1;
 
-      $customFields = CRM_Core_BAO_CustomField::getFields('Pledge');
       $params['custom'] = CRM_Core_BAO_CustomField::postProcess($formValues,
         $this->_id,
         'Pledge'