From: Donald A. Lobo Date: Sat, 9 Mar 2013 02:01:04 +0000 (-0800) Subject: fix CRM-12074 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9f6f062c9d145ed713e631c0088195e4b18407a1;p=civicrm-core.git fix CRM-12074 --- diff --git a/CRM/Contact/Page/View/GroupContact.php b/CRM/Contact/Page/View/GroupContact.php index 61696ef0a0..11f3b0f768 100644 --- a/CRM/Contact/Page/View/GroupContact.php +++ b/CRM/Contact/Page/View/GroupContact.php @@ -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, diff --git a/CRM/Contact/Page/View/UserDashBoard/GroupContact.php b/CRM/Contact/Page/View/UserDashBoard/GroupContact.php index abd1d5ab9d..c127697889 100644 --- a/CRM/Contact/Page/View/UserDashBoard/GroupContact.php +++ b/CRM/Contact/Page/View/UserDashBoard/GroupContact.php @@ -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 ); diff --git a/CRM/Contribute/Page/UserDashboard.php b/CRM/Contribute/Page/UserDashboard.php index e5d277ddc3..70ad6fb3ef 100644 --- a/CRM/Contribute/Page/UserDashboard.php +++ b/CRM/Contribute/Page/UserDashboard.php @@ -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); diff --git a/CRM/Event/Page/UserDashboard.php b/CRM/Event/Page/UserDashboard.php index 37d91d93d6..c26eb7815e 100644 --- a/CRM/Event/Page/UserDashboard.php +++ b/CRM/Event/Page/UserDashboard.php @@ -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'); diff --git a/CRM/Pledge/Page/UserDashboard.php b/CRM/Pledge/Page/UserDashboard.php index 1af7b62559..cd6df05756 100644 --- a/CRM/Pledge/Page/UserDashboard.php +++ b/CRM/Pledge/Page/UserDashboard.php @@ -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); diff --git a/CRM/Pledge/Selector/Search.php b/CRM/Pledge/Selector/Search.php index 65147a91b7..4b13d0200b 100644 --- a/CRM/Pledge/Selector/Search.php +++ b/CRM/Pledge/Selector/Search.php @@ -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?');