X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FPledge%2FPage%2FTab.php;h=f0480a0e5f9fff9a09af5ef22b9b1fd9efbfabd9;hb=76e7a76c36e82fca4901e87abf8f1afddf2384ef;hp=ca0e360704c742b66416c9936d8441d83146830c;hpb=785b0cfda8edb302604577e5992ad8168ddca3d8;p=civicrm-core.git diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index ca0e360704..f0480a0e5f 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -1,7 +1,7 @@ _action); $controller->setEmbedded(TRUE); $controller->reset(); $controller->set('cid', $this->_contactId); $controller->set('context', 'pledge'); + $controller->set('limit', '25'); $controller->process(); $controller->run(); @@ -57,18 +57,18 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { $this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('pledge', $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), ); } } /** - * This function is called when action is view + * called when action is view * - * return null - * @access public + * @return null */ - function view() { + public function view() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_PledgeView', 'View Pledge', $this->_action @@ -81,12 +81,11 @@ class CRM_Pledge_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() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Pledge', 'Create Pledge', $this->_action @@ -98,10 +97,10 @@ class CRM_Pledge_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; @@ -112,9 +111,6 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); - - // set page title - CRM_Contact_Page_View::setTitle($this->_contactId); } $this->assign('action', $this->_action); @@ -127,18 +123,17 @@ class CRM_Pledge_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 $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()); - $this->setContext(); + self::setContext($this); if ($this->_action & CRM_Core_Action::VIEW) { $this->view(); @@ -159,10 +154,10 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { return parent::run(); } - function setContext() { - $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search'); + public static function setContext(&$form) { + $context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search'); - $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this); + $qfKey = CRM_Utils_Request::retrieve('key', 'String', $form); //validate the qfKey if (!CRM_Utils_Rule::qfKey($qfKey)) { $qfKey = NULL; @@ -189,7 +184,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { case 'pledge': $url = CRM_Utils_System::url('civicrm/contact/view', - "reset=1&force=1&cid={$this->_contactId}&selectedChild=pledge" + "reset=1&force=1&cid={$form->_contactId}&selectedChild=pledge" ); break; @@ -199,7 +194,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { case 'activity': $url = CRM_Utils_System::url('civicrm/contact/view', - "reset=1&force=1&cid={$this->_contactId}&selectedChild=activity" + "reset=1&force=1&cid={$form->_contactId}&selectedChild=activity" ); break; @@ -209,8 +204,8 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { default: $cid = NULL; - if ($this->_contactId) { - $cid = '&cid=' . $this->_contactId; + if ($form->_contactId) { + $cid = '&cid=' . $form->_contactId; } $url = CRM_Utils_System::url('civicrm/pledge/search', 'force=1' . $cid @@ -221,4 +216,3 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { $session->pushUserContext($url); } } -