From: eileen Date: Thu, 5 Dec 2019 02:57:42 +0000 (+1300) Subject: dev/core#1444 Permit activities with campaigns on contact tab for contacts without... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=44422cc861c69e8bd82092bcb3f03a7dad62cb88;p=civicrm-core.git dev/core#1444 Permit activities with campaigns on contact tab for contacts without 'administer CiviCampaign' It seems that if an activity has a campaign it is suppressed from the activity table unless the user has 'administer CiviCampaign'. This is inconsistent with the code to view the activity - which permits the activity to be viewed but the campaign cannot be edited It is also inconsistent with activity search behaviour --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 8f460090e6..a42019a405 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2436,14 +2436,9 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = $activityParams['activity_type_id'] = self::filterActivityTypes($params); $enabledComponents = self::activityComponents(); - // @todo - should we move this to activity get api. - foreach ([ - 'case_id' => 'CiviCase', - 'campaign_id' => 'CiviCampaign', - ] as $attr => $component) { - if (!in_array($component, $enabledComponents)) { - $activityParams[$attr] = ['IS NULL' => 1]; - } + // @todo - this appears to be duplicating the activity api. + if (!in_array('CiviCase', $enabledComponents)) { + $activityParams['case_id'] = ['IS NULL' => 1]; } return $activityParams; }