Fix phpdoc types for $_query in CRM_Core_Selector_Base subclasses
[civicrm-core.git] / CRM / Activity / Selector / Search.php
index d0367750cb8b118cd742f979b7e393e262286da7..bb56feaafc128eaf7b46d454072742f2924482f1 100644 (file)
@@ -113,7 +113,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
   /**
    * The query object.
    *
-   * @var \CRM_Contact_BAO_Query
+   * @var CRM_Contact_BAO_Query
    */
   protected $_query;
 
@@ -154,37 +154,6 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
 
     $this->_activityClause = $activityClause;
 
-    // CRM-12675
-    $components = CRM_Core_Component::getNames();
-    $componentClause = [];
-    foreach ($components as $componentID => $componentName) {
-      // CRM-19201: Add support for searching CiviCampaign and CiviCase
-      // activities. For CiviCase, "access all cases and activities" is
-      // required here rather than "access my cases and activities" to
-      // prevent those with only the later permission from seeing a list
-      // of all cases which might present a privacy issue.
-      // @todo this is the cause of the current devastatingly bad performance on
-      // activity search - it involves a bad join.
-      // The correct fix is to use the permission infrastrucutre - ie. add in the
-      // clause generated by CRM_Activity_BAO_Query::addSelectWhere
-      // but some testing needs to check that before making the change
-      // see https://github.com/civicrm/civicrm-core/blob/be2fb01f90f5f299dd07402a41fed7c7c7567f00/CRM/Utils/SQL.php#L48
-      // for how it's done in the api kernel.
-      if (!CRM_Core_Permission::access($componentName, TRUE, TRUE)) {
-        $componentClause[] = " (activity_type.component_id IS NULL OR activity_type.component_id <> {$componentID}) ";
-      }
-    }
-
-    if (!empty($componentClause)) {
-      $componentRestriction = implode(' AND ', $componentClause);
-      if (empty($this->_activityClause)) {
-        $this->_activityClause = $componentRestriction;
-      }
-      else {
-        $this->_activityClause .= ' AND ' . $componentRestriction;
-      }
-    }
-
     // type of selector
     $this->_action = $action;
     $this->_query = new CRM_Contact_BAO_Query($this->_queryParams,
@@ -205,7 +174,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
   public function getPagerParams($action, &$params) {
     $params['status'] = ts('Activities %%StatusMessage%%');
     $params['csvString'] = NULL;
-    $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
+    $params['rowCount'] = Civi::settings()->get('default_pager_size');
     $params['buttonTop'] = 'PagerTopButton';
     $params['buttonBottom'] = 'PagerBottomButton';
   }
@@ -426,7 +395,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
   }
 
   /**
-   * @return \CRM_Contact_BAO_Query
+   * @return CRM_Contact_BAO_Query
    */
   public function &getQuery() {
     return $this->_query;