Skip to content

Commit

Permalink
Merge pull request #12418 from eileenmcnaughton/totten
Browse files Browse the repository at this point in the history
CRM_Core_BAO_PrevNextCache - Remove unused buildSelectedContactPager()
  • Loading branch information
totten authored Jul 5, 2018
2 parents 40fbf4e + 774ac53 commit 94c2fda
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions CRM/Core/BAO/PrevNextCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,45 +559,6 @@ public static function getSelectedContacts() {
return $val;
}

/**
* @param CRM_Core_Form $form
* @param array $params
*
* @return mixed
*/
public static function buildSelectedContactPager(&$form, &$params) {
$params['status'] = ts('Contacts %%StatusMessage%%');
$params['csvString'] = NULL;
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
$params['rowCount'] = $form->get(CRM_Utils_Pager::PAGE_ROWCOUNT);

if (!$params['rowCount']) {
$params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
}

$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $form);
$cacheKey = "civicrm search {$qfKey}";

$query = "
SELECT count(*)
FROM civicrm_prevnext_cache
WHERE cacheKey LIKE %1
AND is_selected = 1
AND cacheKey NOT LIKE %2
";
$params1[1] = array("{$cacheKey}%", 'String');
$params1[2] = array("{$cacheKey}_alphabet%", 'String');
$paramsTotal = CRM_Core_DAO::singleValueQuery($query, $params1);
$params['total'] = $paramsTotal;
$form->_pager = new CRM_Utils_Pager($params);
$form->assign_by_ref('pager', $form->_pager);
list($offset, $rowCount) = $form->_pager->getOffsetAndRowCount();
$params['offset'] = $offset;
$params['rowCount1'] = $rowCount;
return $params;
}

/**
* Flip 2 contacts in the prevNext cache.
*
Expand Down

0 comments on commit 94c2fda

Please sign in to comment.