Merge pull request #3223 from lcdservices/CRM-14672
[civicrm-core.git] / CRM / Event / Page / Tab.php
index be4637fd38cb0ddd099eb2950500de24e5bf78a8..14ff3f8421e09a685fe03fc29be16c9cbc7efefd 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -60,6 +60,11 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
       $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
       $this->assign('displayName', $displayName);
       $this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('participant', $this->_contactId);
+      // Refresh other tabs with related data
+      $this->ajaxResponse['updateTabs'] = array(
+        '#tab_contribute' => CRM_Contact_BAO_Contact::getCountComponent('contribution', $this->_contactId),
+        '#tab_activity' => CRM_Contact_BAO_Contact::getCountComponent('activity', $this->_contactId),
+      );
     }
   }
 
@@ -190,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
@@ -212,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/$searchContext/search", $urlParams);
+        }
         else {
           $url = CRM_Utils_System::url('civicrm/event/search', $urlParams);
         }