From: Kurund Jalmi Date: Mon, 29 Apr 2013 21:08:35 +0000 (-0700) Subject: worked on CRM-12357, fixed pager for mailing listing in mailing tab X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=82845090b0df9099fc4f720562cd75b992bfc0d7;p=civicrm-core.git worked on CRM-12357, fixed pager for mailing listing in mailing tab --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index a940ed231d..ba54ceccb4 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2784,6 +2784,10 @@ AND m.id = %1 */ static public function getContactMailings(&$params) { $params['version'] = 3; + $params['offset'] = ($params['page'] - 1) * $params['rp']; + $params['limit'] = $params['rp']; + $params['sort'] = CRM_Utils_Array::value('sortBy', $params); + $result = civicrm_api('MailingContact', 'get', $params); return $result['values']; } @@ -2801,6 +2805,8 @@ AND m.id = %1 static public function getContactMailingsCount(&$params) { //FIX ME: need to implement getcount api for MailingContact $params['version'] = 3; + unset($params['offset']); + unset($params['limit']); $result = civicrm_api('MailingContact', 'get', $params); return count($result['values']); }