From: Atif Shaikh Date: Wed, 16 Apr 2014 13:50:17 +0000 (+0530) Subject: CRM-14277 Fix - Error when clicking Done on viewing a Contribution X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=29571f63f1f10b3fb47112cd22e6855280f0ad8d;p=civicrm-core.git CRM-14277 Fix - Error when clicking Done on viewing a Contribution https://issues.civicrm.org/jira/browse/CRM-14277 --- diff --git a/CRM/Activity/Selector/Activity.php b/CRM/Activity/Selector/Activity.php index 4b5537280c..f3a319291b 100644 --- a/CRM/Activity/Selector/Activity.php +++ b/CRM/Activity/Selector/Activity.php @@ -108,8 +108,10 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C $key = NULL, $compContext = NULL) { static $activityActTypes = NULL; + //CRM-14277 added addtitional param to handle activity search + $extraParams = "&searchContext=activity"; - $extraParams = ($key) ? "&key={$key}" : NULL; + $extraParams .= ($key) ? "&key={$key}" : NULL; if ($compContext) { $extraParams .= "&compContext={$compContext}"; } diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index 259bb4f04e..af32e5a578 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -305,6 +305,8 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { ); $compContext = CRM_Utils_Request::retrieve('compContext', 'String', $this); + $searchContext = CRM_Utils_Request::retrieve('searchContext', 'String', $this); + //swap the context. if ($context == 'search' && $compContext) { $context = $compContext; @@ -355,6 +357,9 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { if ($context == 'advanced') { $url = CRM_Utils_System::url('civicrm/contact/search/advanced', $extraParams); } + else if ($searchContext) { + $url = CRM_Utils_System::url("civicrm/$searchContext/search", $extraParams); + } else { $url = CRM_Utils_System::url('civicrm/contribute/search', $extraParams); } diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index 85355a8be5..d0805eefe0 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -195,6 +195,8 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { 'String', $this ); + $searchContext = CRM_Utils_Request::retrieve('searchContext', 'String', $this); + $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this); //validate the qfKey @@ -217,6 +219,9 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { if ($compContext == 'advanced') { $url = CRM_Utils_System::url('civicrm/contact/search/advanced', $urlParams); } + else if ($searchContext) { + $url = CRM_Utils_System::url('civicrm/activity/search', $urlParams); + } else { $url = CRM_Utils_System::url('civicrm/event/search', $urlParams); } diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 2222123da6..028ff5fca7 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -349,6 +349,9 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search' ); $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form); + + $searchContext = CRM_Utils_Request::retrieve('searchContext', 'String', $this); + //validate the qfKey if (!CRM_Utils_Rule::qfKey($qfKey)) { $qfKey = NULL; @@ -373,8 +376,13 @@ class CRM_Member_Page_Tab extends CRM_Core_Page { $urlParams .= "&qfKey=$qfKey"; } $form->assign('searchKey', $qfKey); - - $url = CRM_Utils_System::url('civicrm/member/search', $urlParams); + + if ($searchContext) { + $url = CRM_Utils_System::url("civicrm/$searchContext/search", $urlParams); + } + else { + $url = CRM_Utils_System::url('civicrm/member/search', $urlParams); + } break; case 'home':