<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
public $_contactId = NULL;
/**
- * This function is called when action is browse
+ * called when action is browse
*
- * return null
- * @access public
+ * @return null
*/
- function browse() {
+ public function browse() {
$controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('context', 'pledge');
+ $controller->set('limit', '25');
$controller->process();
$controller->run();
$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
}
/**
- * 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
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;
// 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);
}
/**
- * 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
return parent::run();
}
- function setContext(&$form) {
+ public static function setContext(&$form) {
$context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search');
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $form);
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;
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;
$session->pushUserContext($url);
}
}
-