From 3bba4de032ea9655d49b0fdbfe22db19b124e247 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 19 Aug 2014 21:30:32 +0100 Subject: [PATCH] Add pager to contact pledge tab --- CRM/Pledge/Page/Tab.php | 1 + templates/CRM/Pledge/Form/Selector.tpl | 30 +++++++------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index 68df77e40c..0aaa6291f5 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -48,6 +48,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { $controller->reset(); $controller->set('cid', $this->_contactId); $controller->set('context', 'pledge'); + $controller->set('limit', '25'); $controller->process(); $controller->run(); diff --git a/templates/CRM/Pledge/Form/Selector.tpl b/templates/CRM/Pledge/Form/Selector.tpl index ffb510e64a..2dd8e9a3f9 100644 --- a/templates/CRM/Pledge/Form/Selector.tpl +++ b/templates/CRM/Pledge/Form/Selector.tpl @@ -23,12 +23,11 @@ | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if $context EQ 'Search'} {include file="CRM/common/pager.tpl" location="top"} -{/if} -{capture assign=iconURL}{ts}open section{/ts}{/capture} -{ts 1=$iconURL}Click %1 to view pledge payments.{/ts} +

+ {ts}Click arrow to view pledge payments.{/ts} +

{strip} @@ -61,16 +60,16 @@ {if ! $single }  {$row.contact_type}
{/if} - + {ts}open section{/ts} + return false;">> - + {ts}open section{/ts} + return false;">^ {if ! $single } @@ -106,9 +105,7 @@
{/strip} -{if $context EQ 'Search'} {include file="CRM/common/pager.tpl" location="bottom"} -{/if} {* Build pledge payment details*} {literal} @@ -117,18 +114,7 @@ function buildPaymentDetails( pledgeId, contactId ) { var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId; - - cj.ajax({ - url : dataUrl, - dataType: "html", - timeout : 5000, //Time in milliseconds - success : function( data ){ - cj( '#paymentDetails' + pledgeId ).html( data ).trigger('crmLoad'); - }, - error : function( XMLHttpRequest, textStatus, errorThrown ) { - console.error( 'Error: '+ textStatus ); - } - }); + CRM.loadPage(dataUrl, {target: '#paymentDetails' + pledgeId}); } {/literal} -- 2.25.1