fix CRM-12074
authorDonald A. Lobo <lobo@civicrm.org>
Sat, 9 Mar 2013 02:01:04 +0000 (18:01 -0800)
committerDonald A. Lobo <lobo@civicrm.org>
Sat, 9 Mar 2013 02:01:10 +0000 (18:01 -0800)
CRM/Contact/Page/View/GroupContact.php
CRM/Contact/Page/View/UserDashBoard/GroupContact.php
CRM/Contribute/Page/UserDashboard.php
CRM/Event/Page/UserDashboard.php
CRM/Pledge/Page/UserDashboard.php
CRM/Pledge/Selector/Search.php

index 61696ef0a007b4a70530f19f4e1a5fd3373f36cd..11f3b0f768807b0a47c8f3793e0b4c4335f28913 100644 (file)
@@ -173,7 +173,7 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
    *
    * $access public
    */
-  function del($groupContactId, $status, $contactID) {
+  static function del($groupContactId, $status, $contactID) {
     $groupId = CRM_Contact_BAO_GroupContact::getGroupId($groupContactId);
 
     switch ($status) {
@@ -194,9 +194,8 @@ class CRM_Contact_Page_View_GroupContact extends CRM_Core_Page {
         break;
     }
 
-    $groupNum = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId, 'Added',
-      NULL, TRUE, TRUE
-    );
+    $groupNum =
+      CRM_Contact_BAO_GroupContact::getContactGroup($contactID, 'Added', NULL, TRUE, TRUE);
     if ($groupNum == 1 &&
       $groupStatus == 'Removed' &&
       CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
index abd1d5ab9d05464b07d66717d9349f15f1c42882..c1276978890145d2227fb6cfa0c05add374e412e 100644 (file)
@@ -41,23 +41,29 @@ class CRM_Contact_Page_View_UserDashBoard_GroupContact extends CRM_Contact_Page_
    * @access public
    */
   function browse() {
-    $count = CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId,
+    $count = CRM_Contact_BAO_GroupContact::getContactGroup(
+      $this->_contactId,
       NULL,
       NULL, TRUE, TRUE,
       $this->_onlyPublicGroups
     );
 
-    $in = &CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId,
+    $in =& CRM_Contact_BAO_GroupContact::getContactGroup(
+      $this->_contactId,
       'Added',
       NULL, FALSE, TRUE,
       $this->_onlyPublicGroups
     );
-    $pending = &CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId,
+
+    $pending =& CRM_Contact_BAO_GroupContact::getContactGroup(
+      $this->_contactId,
       'Pending',
       NULL, FALSE, TRUE,
       $this->_onlyPublicGroups
     );
-    $out = &CRM_Contact_BAO_GroupContact::getContactGroup($this->_contactId,
+
+    $out =& CRM_Contact_BAO_GroupContact::getContactGroup(
+      $this->_contactId,
       'Removed',
       NULL, FALSE, TRUE,
       $this->_onlyPublicGroups
@@ -89,32 +95,29 @@ class CRM_Contact_Page_View_UserDashBoard_GroupContact extends CRM_Contact_Page_
     );
 
     if ($action == CRM_Core_Action::DELETE) {
-      $groupContactId = CRM_Utils_Request::retrieve('gcid', 'Positive',
-        CRM_Core_DAO::$_nullObject, TRUE
-      );
-      $status = CRM_Utils_Request::retrieve('st', 'String',
-        CRM_Core_DAO::$_nullObject, TRUE
-      );
+      $groupContactId =
+        CRM_Utils_Request::retrieve('gcid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
+      $status =
+        CRM_Utils_Request::retrieve('st', 'String', CRM_Core_DAO::$_nullObject, TRUE);
       if (is_numeric($groupContactId) && $status) {
         CRM_Contact_Page_View_GroupContact::del($groupContactId, $status, $this->_contactId);
       }
 
-      $url = CRM_Utils_System::url('civicrm/user',
-        "reset=1&id={$this->_contactId}"
-      );
+      $url = CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}");
       CRM_Utils_System::redirect($url);
     }
 
-    $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact',
+    $controller = new CRM_Core_Controller_Simple(
+      'CRM_Contact_Form_GroupContact',
       ts("Contact's Groups"),
-      CRM_Core_Action::ADD
+      CRM_Core_Action::ADD,
+      FALSE, FALSE, TRUE, FALSE
     );
     $controller->setEmbedded(TRUE);
 
     $session = CRM_Core_Session::singleton();
-    $session->pushUserContext(CRM_Utils_System::url('civicrm/user',
-        "reset=1&id={$this->_contactId}"
-      ),
+    $session->pushUserContext(
+      CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}"),
       FALSE
     );
 
index e5d277ddc3893b05aacd00389d7ceb8d75f8b222..70ad6fb3ef042a824d310f38f6c75edaee519aa9 100644 (file)
@@ -41,7 +41,12 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
    * @access public
    */
   function listContribution() {
-    $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), NULL);
+    $controller = new CRM_Core_Controller_Simple(
+      'CRM_Contribute_Form_Search',
+      ts('Contributions'),
+      NULL,
+      FALSE, FALSE, TRUE, FALSE
+    );
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('limit', 12);
index 37d91d93d6addc7a5daf97434691f74b6297b866..c26eb7815e8674320b12d63d66b1ad18701c42c0 100644 (file)
@@ -45,7 +45,12 @@ class CRM_Event_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard {
    * @access public
    */
   function listParticipations() {
-    $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), NULL);
+    $controller = new CRM_Core_Controller_Simple(
+      'CRM_Event_Form_Search',
+      ts('Events'),
+      NULL,
+      FALSE, FALSE, TRUE, FALSE
+    );
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
index 1af7b62559bc2de4a16b42156a842209fadb3ed0..cd6df057568b1e76f349acc68da67cb0301f29d7 100644 (file)
@@ -41,7 +41,12 @@ class CRM_Pledge_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard
    * @access public
    */
   function listPledges() {
-    $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), NULL);
+    $controller = new CRM_Core_Controller_Simple(
+      'CRM_Pledge_Form_Search',
+      ts('Pledges'),
+      NULL,
+      FALSE, FALSE, TRUE, FALSE
+    );
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('limit', 12);
index 65147a91b7d9ced7d1113a7e8b9442e196cb7055..4b13d0200be0f1a8c245503668364e4d6a85efbd 100644 (file)
@@ -188,7 +188,11 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
    * @access public
    *
    */
-  static function &links($hideOption, $key = NULL) {
+  static function &links() {
+    $args = func_get_args();
+    $hideOption = CRM_Utils_Array::value(0, $args);
+    $key = CRM_Utils_Array::value(1, $args);
+
     $extraParams = ($key) ? "&key={$key}" : NULL;
 
     $cancelExtra = ts('Cancelling this pledge will also cancel any scheduled (and not completed) pledge payments.') . ' ' . ts('This action cannot be undone.') . ' ' . ts('Do you want to continue?');