From 8e50d640489419f99de761ec12d86430738b7ac0 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Mon, 26 Sep 2016 18:15:56 +0530 Subject: [PATCH] CRM-16189, fixed buutton link for record payment ---------------------------------------- * CRM-16189: https://issues.civicrm.org/jira/browse/CRM-16189 --- CRM/Contribute/Selector/Search.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index efb4b786ce..d692af8c4f 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -441,25 +441,18 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C 'id' => $result->contribution_id, 'cid' => $result->contact_id, 'cxt' => $this->_context, - 'compId' => $result->contribution_id, - 'comp' => 'contribution', ); - if ($row['contribution_status_name'] == 'Partially paid' || $isPayLater) { - $links[CRM_Core_Action::ADD] = array( - 'name' => ts('Record Payment'), - 'url' => 'civicrm/payment', - 'qs' => 'reset=1&id=%%compId%%&cid=%%cid%%&action=add&component=%%comp%%', - 'title' => ts('Record Payment'), - ); - } - - if ($row['contribution_status_name'] == 'Pending refund') { + if (in_array($row['contribution_status_name'], array('Partially paid', 'Pending refund')) || $isPayLater) { + $buttonName = ts('Record Payment'); + if ($row['contribution_status_name'] == 'Pending refund') { + $buttonName = ts('Record Refund'); + } $links[CRM_Core_Action::ADD] = array( - 'name' => ts('Record Refund'), + 'name' => $buttonName, 'url' => 'civicrm/payment', - 'qs' => 'reset=1&id=%%pid%%&cid=%%cid%%&action=add&component=event', - 'title' => ts('Record Refund'), + 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=contribution', + 'title' => $buttonName, ); } -- 2.25.1