From 82845090b0df9099fc4f720562cd75b992bfc0d7 Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Mon, 29 Apr 2013 14:08:35 -0700 Subject: [PATCH] worked on CRM-12357, fixed pager for mailing listing in mailing tab --- CRM/Mailing/BAO/Mailing.php | 6 ++++++ 1 file changed, 6 insertions(+) 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']); } -- 2.25.1