Skip to content

Commit

Permalink
Merge pull request #20834 from colemanw/fixUnusedVars
Browse files Browse the repository at this point in the history
[REF] Remove unused variables
  • Loading branch information
demeritcowboy authored Jul 13, 2021
2 parents c59cb73 + 8a6b218 commit ff82ff2
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 56 deletions.
12 changes: 1 addition & 11 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,17 +915,7 @@ public function postProcess($params = NULL) {
$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'
Expand Down
3 changes: 0 additions & 3 deletions CRM/Campaign/Form/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ public static function submit($params, $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'
Expand Down
8 changes: 0 additions & 8 deletions CRM/Campaign/Form/Petition/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,6 @@ public function postProcess() {
// 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,
Expand Down
6 changes: 0 additions & 6 deletions CRM/Case/Form/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,6 @@ public function submit(&$params) {

// 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'
Expand Down
8 changes: 0 additions & 8 deletions CRM/Contact/Form/CustomData.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ public function setDefaultValues() {
$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);
Expand All @@ -245,13 +244,6 @@ public function setDefaultValues() {
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,
Expand Down
10 changes: 1 addition & 9 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -1632,15 +1632,7 @@ public function formatParams(&$params, $onDuplicate, $cid) {
$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);
Expand Down
3 changes: 0 additions & 3 deletions CRM/Event/Form/ParticipantView.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public function preProcess() {

$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');
Expand All @@ -80,7 +79,6 @@ public function preProcess() {
$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
Expand Down Expand Up @@ -137,7 +135,6 @@ public function preProcess() {
$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) {
Expand Down
8 changes: 1 addition & 7 deletions CRM/Grant/Form/Grant.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,7 @@ public function postProcess() {
$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'
Expand Down
1 change: 0 additions & 1 deletion CRM/Pledge/Form/Pledge.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ public function postProcess() {
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'
Expand Down

0 comments on commit ff82ff2

Please sign in to comment.