CRM-14195 fix - Fix buildACLClause for Activity Reports
authormonishdeb <monish.deb@webaccess.co.in>
Mon, 17 Feb 2014 13:45:48 +0000 (19:15 +0530)
committermonishdeb <monish.deb@webaccess.co.in>
Mon, 17 Feb 2014 13:45:48 +0000 (19:15 +0530)
http://issues.civicrm.org/jira/browse/CRM-14195

CRM/Report/Form/Activity.php

index bc1f7c2a282c3139f4b373b2f080d535ecd949bf..99b927ab1a57a291a205bf9cda7028014f4a5f19 100644 (file)
@@ -577,7 +577,6 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}";
   }
 
   function postProcess() {
-    $this->buildACLClause(array('civicrm_contact_source', 'civicrm_contact_target', 'civicrm_contact_assignee'));
     $this->beginPostProcess();
 
     //Assign those recordtype to array which have filter operator as 'Is not empty' or 'Is empty'
@@ -592,6 +591,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}";
     }
 
       // 1. fill temp table with target results
+    $this->buildACLClause(array('civicrm_contact_target'));
     $this->select('target');
     $this->from('target');
     $this->customDataFrom();
@@ -614,6 +614,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}";
     CRM_Core_DAO::executeQuery($tempQuery);
 
     // 3. fill temp table with assignee results
+    $this->buildACLClause(array('civicrm_contact_assignee'));
     $this->select('assignee');
     $this->from('assignee');
     $this->customDataFrom();
@@ -625,6 +626,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}";
     CRM_Core_DAO::executeQuery($tempQuery);
 
     // 4. fill temp table with source results
+    $this->buildACLClause(array('civicrm_contact_source'));
     $this->select('source');
     $this->from('source');
     $this->customDataFrom();
@@ -784,7 +786,7 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy} {$this->_limit}"
           $fullDetails = $rows[$rowNum]['civicrm_activity_details'];
           $rows[$rowNum]['civicrm_activity_details'] = substr($fullDetails, 0, strrpos(substr($fullDetails, 0, 80), ' '));
           if ($actUrl) {
-            $rows[$rowNum]['civicrm_activity_details'] .= " <a href='{$actUrl}' title='{$onHoverAct}'>(more)</a>"; 
+            $rows[$rowNum]['civicrm_activity_details'] .= " <a href='{$actUrl}' title='{$onHoverAct}'>(more)</a>";
           }
           $entryFound = TRUE;
         }