本文整理汇总了PHP中CRM_Contribute_BAO_ContributionSoft::getSoftContributionList方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionSoft::getSoftContributionList方法的具体用法?PHP CRM_Contribute_BAO_ContributionSoft::getSoftContributionList怎么用?PHP CRM_Contribute_BAO_ContributionSoft::getSoftContributionList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_ContributionSoft
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_ContributionSoft::getSoftContributionList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* the main function that is called when the page loads, it decides the which action has to be taken for the page.
*
* @return null
*/
public function run()
{
$this->preProcess();
// check if we can process credit card membership
$newCredit = CRM_Core_Config::isEnabledBackOfficeCreditCardPayments();
$this->assign('newCredit', $newCredit);
if ($newCredit) {
$this->_isPaymentProcessor = TRUE;
} else {
$this->_isPaymentProcessor = FALSE;
}
// Only show credit card membership signup if user has CiviContribute permission
if (CRM_Core_Permission::access('CiviContribute')) {
$this->_accessContribution = TRUE;
$this->assign('accessContribution', TRUE);
//show associated soft credit when contribution payment is paid by different person
if ($this->_id && $this->_contactId) {
$filter = " AND cc.id IN (SELECT contribution_id FROM civicrm_membership_payment WHERE membership_id = {$this->_id})";
$softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $filter);
if (!empty($softCreditList)) {
$this->assign('softCredit', TRUE);
$this->assign('softCreditRows', $softCreditList);
}
}
} else {
$this->_accessContribution = FALSE;
$this->assign('accessContribution', FALSE);
$this->assign('softCredit', FALSE);
}
if ($this->_action & CRM_Core_Action::VIEW) {
$this->view();
} elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
self::setContext($this);
$this->edit();
} else {
self::setContext($this);
$this->browse();
}
return parent::run();
}
示例2: browse
/**
* This function is called when action is browse
*
* return null
* @access public
*/
function browse()
{
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
// add annual contribution
$annual = array();
list($annual['count'], $annual['amount'], $annual['avg']) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
$this->assign('annual', $annual);
$controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), $this->_action, FALSE, FALSE, TRUE);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('crid', $this->_crid);
$controller->set('context', 'Search');
$controller->set('limit', 50);
$controller->process();
$controller->run();
// add recurring block
$action = array_sum(array_keys($this->recurLinks()));
$params = CRM_Contribute_BAO_ContributionRecur::getRecurContributions($this->_contactId);
if (!empty($params)) {
foreach ($params as $ids => $recur) {
$action = array_sum(array_keys($this->recurLinks($ids)));
// no action allowed if it's not active
$params[$ids]['is_active'] = $recur['contribution_status_id'] != 3;
if ($params[$ids]['is_active']) {
$details = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($params[$ids]['id'], 'recur');
$hideUpdate = $details->membership_id & $details->auto_renew;
if ($hideUpdate) {
$action -= CRM_Core_Action::UPDATE;
}
$params[$ids]['action'] = CRM_Core_Action::formLink(self::recurLinks($ids), $action, array('cid' => $this->_contactId, 'crid' => $ids, 'cxt' => 'contribution'), ts('more'), FALSE, 'contribution.selector.recurring', 'Contribution', $ids);
}
}
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('recurRows', $params);
$this->assign('recur', TRUE);
}
//enable/disable soft credit records for test contribution
$isTest = 0;
if (CRM_Utils_Request::retrieve('isTest', 'Positive', $this)) {
$isTest = 1;
}
$this->assign('isTest', $isTest);
$softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, $isTest);
if (!empty($softCreditList)) {
$softCreditTotals = array();
list($softCreditTotals['amount'], $softCreditTotals['avg'], $softCreditTotals['currency']) = CRM_Contribute_BAO_ContributionSoft::getSoftContributionTotals($this->_contactId, $isTest);
$this->assign('softCredit', TRUE);
$this->assign('softCreditRows', $softCreditList);
$this->assign('softCreditTotals', $softCreditTotals);
}
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
$this->ajaxResponse['tabCount'] = CRM_Contact_BAO_Contact::getCountComponent('contribution', $this->_contactId);
}
}
示例3: browse
/**
* called when action is browse.
*
*/
public function browse()
{
// add annual contribution
$annual = array();
list($annual['count'], $annual['amount'], $annual['avg']) = CRM_Contribute_BAO_Contribution::annual($this->_contactId);
$this->assign('annual', $annual);
$controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), $this->_action, FALSE, FALSE, TRUE);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('crid', $this->_crid);
$controller->set('context', 'contribution');
$controller->set('limit', 50);
$controller->process();
$controller->run();
// add recurring block
$action = array_sum(array_keys($this->recurLinks()));
$params = CRM_Contribute_BAO_ContributionRecur::getRecurContributions($this->_contactId);
// Get all backoffice payment processors
$backOfficePaymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors(array('BackOffice'));
if (!empty($params)) {
foreach ($params as $ids => $recur) {
$action = array_sum(array_keys($this->recurLinks($ids)));
// no action allowed if it's not active
$params[$ids]['is_active'] = $recur['contribution_status_id'] != 3;
// Get payment processor name
$paymentProcessorDetails = CRM_Financial_BAO_PaymentProcessor::getPayment($params[$ids]['payment_processor_id'], 'live');
$params[$ids]['payment_processor_name'] = $paymentProcessorDetails['name'];
$details = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($params[$ids]['id'], 'recur');
$hideUpdate = $details->membership_id & $details->auto_renew;
if ($hideUpdate) {
$action -= CRM_Core_Action::UPDATE;
}
$links = self::recurLinks($ids);
// Disable Edit/Delete link if no back office support
if (!array_key_exists($recur['payment_processor_id'], $backOfficePaymentProcessors)) {
unset($links[2]);
unset($links[8]);
}
// Remove cancel link for already cancelled recurring records
if ($recur['contribution_status_id'] == 3) {
unset($links[64]);
}
$params[$ids]['action'] = CRM_Core_Action::formLink($links, $action, array('cid' => $this->_contactId, 'crid' => $ids, 'cxt' => 'contribution'), ts('more'), FALSE, 'contribution.selector.recurring', 'Contribution', $ids);
}
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('recurRows', $params);
$this->assign('recur', TRUE);
}
//enable/disable soft credit records for test contribution
$isTest = 0;
if (CRM_Utils_Request::retrieve('isTest', 'Positive', $this)) {
$isTest = 1;
}
$this->assign('isTest', $isTest);
$softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionList($this->_contactId, NULL, $isTest);
if (!empty($softCreditList)) {
$softCreditTotals = array();
list($softCreditTotals['amount'], $softCreditTotals['avg'], $softCreditTotals['currency']) = CRM_Contribute_BAO_ContributionSoft::getSoftContributionTotals($this->_contactId, $isTest);
$this->assign('softCredit', TRUE);
$this->assign('softCreditRows', $softCreditList);
$this->assign('softCreditTotals', $softCreditTotals);
}
if ($this->_contactId) {
$displayName = CRM_Contact_BAO_Contact::displayName($this->_contactId);
$this->assign('displayName', $displayName);
$this->ajaxResponse['tabCount'] = CRM_Contribute_BAO_ContributionRecur::contributionRecurCount($this->_contactId);
}
}