CRM-12675 : cleanup - Contribution activities shown to users without permission
authoryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 17 Jun 2015 13:29:33 +0000 (18:59 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Wed, 17 Jun 2015 13:29:33 +0000 (18:59 +0530)
https://issues.civicrm.org/jira/browse/CRM-12675

CRM/Activity/Form/Task.php
CRM/Activity/Selector/Search.php

index 0ce725dcaec5500021211544f85b90a653ba87f5..64aa3fa841582dfa30fe22fad698795a8ad98a74 100644 (file)
@@ -118,9 +118,10 @@ class CRM_Activity_Form_Task extends CRM_Core_Form {
       $activityClause = NULL;
 
       $components = CRM_Core_Component::getNames();
+      $componentClause = array();
       foreach ($components as $componentID => $componentName) {
         if (!CRM_Core_Permission::check("access $componentName")) {
-          $componentClause = " (activity_type.component_id IS NULL OR activity_type.component_id <> {$componentID}) ";
+          $componentClause[] = " (activity_type.component_id IS NULL OR activity_type.component_id <> {$componentID}) ";
         }
       }
       if (!empty($componentClause)) {
index 59d6d8b31d99b16971beb163c80a7320a3fd6d11..090ed4b0eb8530bcb6c89510c0f99e6c2c22a69b 100644 (file)
@@ -175,6 +175,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
 
     // CRM-12675
     $components = CRM_Core_Component::getNames();
+    $componentClause = array();
     foreach ($components as $componentID => $componentName) {
       if (!CRM_Core_Permission::check("access $componentName")) {
         $componentClause[] = " (activity_type.component_id IS NULL OR activity_type.component_id <> {$componentID}) ";