本文整理汇总了PHP中CRM_Contribute_BAO_ContributionRecur::getRecurContributions方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionRecur::getRecurContributions方法的具体用法?PHP CRM_Contribute_BAO_ContributionRecur::getRecurContributions怎么用?PHP CRM_Contribute_BAO_ContributionRecur::getRecurContributions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_ContributionRecur
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_ContributionRecur::getRecurContributions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_Recurring_Record
function get_Recurring_Record($contactID)
{
$cRecur = null;
$aContributionRecur = CRM_Contribute_BAO_ContributionRecur::getRecurContributions($contactID);
foreach ($aContributionRecur as $ContributionRecur) {
$sql = " SELECT name FROM civicrm_payment_processor WHERE id = %1 ";
$param = array(1 => array($ContributionRecur['payment_processor_id'], 'Integer'));
$dao = CRM_Core_DAO::singleValueQuery($sql, $param);
/*$acontribution = self::_get_ContributionId_By_ContributionRecurId( $ContributionRecur['id'] );
$cRecur[] = array(
'contribution_id' => $acontribution['id'],
'contribution_recur_id' => $ContributionRecur['id'],
'status' => $ContributionRecur['contribution_status'],
'amount' => $ContributionRecur['amount'],
'payment_processor' => $dao,
);*/
$cRecur[$ContributionRecur['id']] = $dao . '/' . $ContributionRecur['contribution_status'] . '/' . $ContributionRecur['amount'];
}
$cRecur['new_recur'] = 'Create New Recurring';
return $cRecur;
}
开发者ID:priyankakaran26,项目名称:uk.co.vedaconsulting.module.smartdebit_reconciliation,代码行数:21,代码来源:Utils.php
示例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
/**
* This function is called when action is browse
*
* return null
* @access 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);
$controller->setEmbedded(TRUE);
$controller->reset();
$controller->set('cid', $this->_contactId);
$controller->set('crid', $this->_crid);
$controller->set('context', 'contribution');
$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'));
}
}
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('recurRows', $params);
$this->assign('recur', TRUE);
}
//add honor block
// form all action links
$action = array_sum(array_keys($this->honorLinks()));
$params = array();
$params = CRM_Contribute_BAO_Contribution::getHonorContacts($this->_contactId);
if (!empty($params)) {
foreach ($params as $ids => $honorId) {
$params[$ids]['action'] = CRM_Core_Action::formLink(self::honorLinks(), $action, array('cid' => $honorId['honorId'], 'id' => $ids, 'cxt' => 'contribution', 'contributionType' => $honorId['type_id'], 'honorId' => $this->_contactId));
}
// assign vars to templates
$this->assign('action', $this->_action);
$this->assign('honorRows', $params);
$this->assign('honor', 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_Contribution::getSoftContributionList($this->_contactId, $isTest);
if (!empty($softCreditList)) {
$softCreditTotals = array();
list($softCreditTotals['amount'], $softCreditTotals['avg'], $softCreditTotals['currency']) = CRM_Contribute_BAO_Contribution::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);
}
}
示例4: 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);
}
}
示例5: buildQuickForm
//.........这里部分代码省略.........
if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'spacing' => ' ', 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
return;
}
//need to assign custom data type and subtype to the template
$this->assign('customDataType', 'Contribution');
$this->assign('customDataSubType', $this->_contributionType);
$this->assign('entityID', $this->_id);
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
// Check permissions for financial type first
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, $this->_action);
if (empty($financialTypes)) {
CRM_Core_Error::statusBounce(ts('You do not have all the permissions needed for this page.'));
}
$financialType = $this->add('select', 'financial_type_id', ts('Financial Type'), array('' => ts('- select -')) + $financialTypes, TRUE, array('onChange' => "CRM.buildCustomData( 'Contribution', this.value );"));
$paymentInstrument = FALSE;
if (!$this->_mode) {
$paymentInstrument = $this->add('select', 'payment_instrument_id', ts('Payment Method'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), TRUE, array('onChange' => "return showHideByValue('payment_instrument_id','4','checkNumber','table-row','select',false);"));
}
$this->_paymentProcessors = $this->getValidProcessors();
$offlinePaymentProcessors = array();
foreach ($this->_paymentProcessors as $key => $value) {
$offlinePaymentProcessors[$value['id']] = $value['name'];
}
if ($this->_context == 'standalone') {
$this->assign('showRecurringField', 1);
$this->assign('backOfficePaymentProcessors', json_encode($offlinePaymentProcessors));
$recurringContribution = $this->add('select', 'contribution_recur_id', ts('Recurring Contribution'), FALSE, NULL);
} else {
$recurContributions = array();
$existingRecurContributions = CRM_Contribute_BAO_ContributionRecur::getRecurContributions($this->_contactID);
// Get all backoffice payment processors
if (!empty($existingRecurContributions)) {
foreach ($existingRecurContributions as $ids => $recur) {
if (array_key_exists($recur['payment_processor_id'], $offlinePaymentProcessors)) {
$recurContributions[$ids] = CRM_Utils_Money::format($recur['amount']) . ' / ' . $offlinePaymentProcessors[$recur['payment_processor_id']] . ' / ' . CRM_Contribute_PseudoConstant::contributionStatus($recur['contribution_status_id']) . ' / ' . CRM_Utils_Date::customFormat($recur['start_date']);
}
}
}
if (!empty($recurContributions)) {
$this->assign('showRecurringField', 1);
$recurringContribution = $this->add('select', 'contribution_recur_id', ts('Recurring Contribution'), array('' => ts('- select -')) + $recurContributions, FALSE, NULL);
}
}
$trxnId = $this->add('text', 'trxn_id', ts('Transaction ID'), array('class' => 'twelve') + $attributes['trxn_id']);
//add receipt for offline contribution
$this->addElement('checkbox', 'is_email_receipt', ts('Send Receipt?'));
$this->add('select', 'from_email_address', ts('Receipt From'), $this->_fromEmails);
$status = CRM_Contribute_PseudoConstant::contributionStatus();
// suppressing contribution statuses that are NOT relevant to pledges (CRM-5169)
$statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
if ($this->_ppID) {
foreach (array('Cancelled', 'Failed', 'In Progress') as $suppress) {
unset($status[CRM_Utils_Array::key($suppress, $statusName)]);
}
} elseif (!$this->_ppID && $this->_id || !$this->_id) {
$suppressFlag = FALSE;
if ($this->_id) {
$componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id);
if (CRM_Utils_Array::value('membership', $componentDetails) || CRM_Utils_Array::value('participant', $componentDetails)) {
$suppressFlag = TRUE;
}
}
开发者ID:Kajakaran,项目名称:uk.co.vedaconsulting.offlinerecurringcontributions,代码行数:67,代码来源:Contribution.php