CRM-14277 Fix - Error when clicking Done on viewing a Contribution
authorAtif Shaikh <shaikh388@gmail.com>
Wed, 16 Apr 2014 13:50:17 +0000 (19:20 +0530)
committerAtif Shaikh <shaikh388@gmail.com>
Wed, 16 Apr 2014 13:50:17 +0000 (19:20 +0530)
https://issues.civicrm.org/jira/browse/CRM-14277

CRM/Activity/Selector/Activity.php
CRM/Contribute/Page/Tab.php
CRM/Event/Page/Tab.php
CRM/Member/Page/Tab.php

index 4b5537280c089b7e9d0e3543142fe89e42f128e4..f3a319291b557a30d6d155a1428f821f4a6f742b 100644 (file)
@@ -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}";
     }
index 259bb4f04ef0efc6e0d0d76ff077b78ddc2c978c..af32e5a57816432e6fd5231790bf13472b9e0e83 100644 (file)
@@ -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);
         }
index 85355a8be546e71db1422a5b78e888eabace0d3f..d0805eefe052430f0d6de207ab11f250f5f483d1 100644 (file)
@@ -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);
         }
index 2222123da648c10cd08f8129edb63fea6864f77a..028ff5fca731dcec06971a09d26f629e229762ec 100644 (file)
@@ -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':