X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FPage%2FTab.php;h=1cc1f3f996248fffe6b3550efc5362f24ebb78e5;hb=94c1e8ffaf3ee4a357c976d9050f10da4dc0d729;hp=8a8ab7bb7aa49dfc5aa115a3445608db02d90d8f;hpb=973535196eeb576136587c194710bc648df9946c;p=civicrm-core.git diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index 8a8ab7bb7a..1cc1f3f996 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -1,7 +1,7 @@ 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), ); + if (CRM_Core_Permission::access('CiviContribute')) { + $this->ajaxResponse['updateTabs']['#tab_contribute'] = CRM_Contact_BAO_Contact::getCountComponent('contribution', $this->_contactId); + } } } /** - * This function is called when action is view + * called when action is view * - * return null - * @access public + * @return null */ - function view() { + public function view() { // build associated contributions $this->associatedContribution(); @@ -91,12 +91,11 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { } /** - * This function is called when action is update or new + * called when action is update or new * - * return null - * @access public + * @return null */ - function edit() { + public function edit() { // set https for offline cc transaction $mode = CRM_Utils_Request::retrieve('mode', 'String', $this); if ($mode == 'test' || $mode == 'live') { @@ -121,10 +120,10 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { return $controller->run(); } - function preProcess() { - $context = CRM_Utils_Request::retrieve('context', 'String', $this); + public function preProcess() { + $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); - $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); + $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); if ($context == 'standalone') { $this->_action = CRM_Core_Action::ADD; @@ -147,12 +146,11 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { } /** - * This function is the main function that is called when the page loads, it decides the which action has to be taken for the page. + * the main function that is called when the page loads, it decides the which action has to be taken for the page. * - * return null - * @access public + * @return null */ - function run() { + public function run() { $this->preProcess(); // check if we can process credit card registration @@ -174,7 +172,8 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE - )) { + ) + ) { $this->edit(); } else { @@ -184,7 +183,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { return parent::run(); } - function setContext() { + public function setContext() { $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search' ); @@ -216,7 +215,7 @@ 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) { + elseif ($searchContext) { $url = CRM_Utils_System::url("civicrm/$searchContext/search", $urlParams); } else { @@ -249,7 +248,7 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { break; case 'fulltext': - $keyName = '&qfKey'; + $keyName = '&qfKey'; $urlParams = 'force=1'; $urlString = 'civicrm/contact/search/custom'; if ($this->_action == CRM_Core_Action::UPDATE) { @@ -282,13 +281,12 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { } /** - * This function is used for the to show the associated + * used for the to show the associated * contribution for the participant * - * return null - * @access public + * @return null */ - function associatedContribution() { + public function associatedContribution() { if (CRM_Core_Permission::access('CiviContribute')) { $this->assign('accessContribution', TRUE); $controller = new CRM_Core_Controller_Simple( @@ -310,4 +308,3 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { } } } -