From: Pradeep Nayak Date: Thu, 9 Jul 2020 21:25:35 +0000 (+0100) Subject: getLoggedInContactID() is a static function X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2dbdb9b90b5295af5c35ab1d4875d29eff2e8ac8;p=civicrm-core.git getLoggedInContactID() is a static function --- diff --git a/CRM/ACL/API.php b/CRM/ACL/API.php index ba4991dc2d..17982fb7ba 100644 --- a/CRM/ACL/API.php +++ b/CRM/ACL/API.php @@ -189,7 +189,7 @@ class CRM_ACL_API { } if (!$contactID) { - $contactID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $contactID = CRM_Core_Session::getLoggedInContactID(); } $key = "{$tableName}_{$type}_{$contactID}"; diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index ddea89ac89..0f68d5a057 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -376,7 +376,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { CRM_Utils_System::permissionDenied(); } // ensure that oid is not the current user, if so refuse to do the merge - if (CRM_Core_Session::singleton()->getLoggedInContactID() == $oid) { + if (CRM_Core_Session::getLoggedInContactID() == $oid) { $message = ts('The contact record which is linked to the currently logged in user account - \'%1\' - cannot be deleted.', [1 => CRM_Core_Session::singleton()->getLoggedInContactDisplayName()] ); diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index fddf30a8f9..51ac8c9ad6 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -235,7 +235,7 @@ class CRM_Contact_Form_Task_PDFLetterCommon extends CRM_Core_Form_Task_PDFLetter $activityParams = [ 'subject' => $subject, 'campaign_id' => $campaign_id, - 'source_contact_id' => CRM_Core_Session::singleton()->getLoggedInContactID(), + 'source_contact_id' => CRM_Core_Session::getLoggedInContactID(), 'activity_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Print PDF Letter'), 'activity_date_time' => date('YmdHis'), 'details' => $html_message, diff --git a/CRM/Contact/Page/View/UserDashBoard.php b/CRM/Contact/Page/View/UserDashBoard.php index 347824cceb..8cba50bcb0 100644 --- a/CRM/Contact/Page/View/UserDashBoard.php +++ b/CRM/Contact/Page/View/UserDashBoard.php @@ -47,7 +47,7 @@ class CRM_Contact_Page_View_UserDashBoard extends CRM_Core_Page { } $this->_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this); - $userID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $userID = CRM_Core_Session::getLoggedInContactID(); $userChecksum = $this->getUserChecksum(); $validUser = FALSE; diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index ca2805d551..6822a355f6 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -222,7 +222,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->_emailExists = $this->get('emailExists'); // this was used prior to the cleverer this_>getContactID - unsure now - $this->_userID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $this->_userID = CRM_Core_Session::getLoggedInContactID(); $this->_contactID = $this->_membershipContactID = $this->getContactID(); $this->_mid = NULL; diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index 14e885a6e2..264e3ad4af 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -328,7 +328,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { return [$userName, $userEmail]; } - $userID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $userID = CRM_Core_Session::getLoggedInContactID(); if (!empty($userID)) { list($userName, $userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID); } diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 3ec6dea97f..0dd1bca05a 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -305,7 +305,7 @@ AND reset_date IS NULL $contactFromEmails = []; // add logged in user's active email ids - $contactID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $contactID = CRM_Core_Session::getLoggedInContactID(); if ($contactID) { $contactEmails = self::allEmails($contactID); $fromDisplayName = CRM_Core_Session::singleton()->getLoggedInContactDisplayName(); diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index e2ed3102e7..c93215d235 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -169,7 +169,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { $noteActions = FALSE; - $loggedInContactID = CRM_Core_Session::singleton()->getLoggedInContactID(); + $loggedInContactID = CRM_Core_Session::getLoggedInContactID(); if ($loggedInContactID) { if ($loggedInContactID == $note->entity_id) { $noteActions = TRUE; diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index d05b01176d..1a3e59a0be 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1810,7 +1810,7 @@ WHERE civicrm_participant.contact_id = {$contactID} AND ]; // create activity with target contacts - $id = CRM_Core_Session::singleton()->getLoggedInContactID(); + $id = CRM_Core_Session::getLoggedInContactID(); if ($id) { $activityParams['source_contact_id'] = $id; $activityParams['target_contact_id'][] = $contactId; diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index 8c7cd19959..b53a723b4f 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -491,7 +491,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR if ($editLink && ($mask & CRM_Core_Permission::EDIT)) { // do not allow edit for anon users in joomla frontend, CRM-4668 $config = CRM_Core_Config::singleton(); - if (!$config->userFrameworkFrontend || CRM_Core_Session::singleton()->getLoggedInContactID()) { + if (!$config->userFrameworkFrontend || CRM_Core_Session::getLoggedInContactID()) { $this->_editLink = TRUE; } }