/**
* The query object.
*
- * @var \CRM_Contact_BAO_Query
+ * @var CRM_Contact_BAO_Query
*/
protected $_query;
$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,
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';
}
}
/**
- * @return \CRM_Contact_BAO_Query
+ * @return CRM_Contact_BAO_Query
*/
public function &getQuery() {
return $this->_query;