当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange方法代码示例

本文整理汇总了PHP中CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange方法的具体用法?PHP CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange怎么用?PHP CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Contribute_BAO_ContributionRecur的用法示例。


在下文中一共展示了CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: view

 /**
  * View details of a recurring contribution.
  */
 public function view()
 {
     $recur = new CRM_Contribute_DAO_ContributionRecur();
     $recur->id = $this->_id;
     if ($recur->find(TRUE)) {
         $values = array();
         CRM_Core_DAO::storeValues($recur, $values);
         // if there is a payment processor ID, get the name of the payment processor
         if (!empty($values['payment_processor_id'])) {
             $values['payment_processor'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $values['payment_processor_id'], 'name');
         }
         $idFields = array('contribution_status_id', 'campaign_id');
         if (CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($values['id'])) {
             $idFields[] = 'financial_type_id';
         }
         foreach ($idFields as $idField) {
             if (!empty($values[$idField])) {
                 $values[substr($idField, 0, -3)] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_ContributionRecur', $idField, $values[$idField]);
             }
         }
         // Get financial type name
         if (!empty($values['financial_type_id'])) {
             $values['financial_type_name'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'financial_type_id', $values['financial_type_id']);
         }
         // Get Paid By label
         if (!empty($values['payment_instrument_id'])) {
             $values['payment_instrument'] = CRM_Core_OptionGroup::getLabel('payment_instrument', $values['payment_instrument_id']);
         }
         $this->assign('recur', $values);
         $this->assign('customDataType', 'ContributionRecur');
         $groupTree = CRM_Core_BAO_CustomGroup::getTree('ContributionRecur', $this, $this->_id);
         CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
     }
 }
开发者ID:Kajakaran,项目名称:uk.co.vedaconsulting.offlinerecurringcontributions,代码行数:37,代码来源:ContributionRecur.php

示例2: view

 /**
  * View details of a recurring contribution.
  */
 public function view()
 {
     $recur = new CRM_Contribute_DAO_ContributionRecur();
     $recur->id = $this->_id;
     if ($recur->find(TRUE)) {
         $values = array();
         CRM_Core_DAO::storeValues($recur, $values);
         // if there is a payment processor ID, get the name of the payment processor
         if (!empty($values['payment_processor_id'])) {
             $values['payment_processor'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessor', $values['payment_processor_id'], 'name');
         }
         $idFields = array('contribution_status_id', 'campaign_id');
         if (CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($values['id'])) {
             $idFields[] = 'financial_type_id';
         }
         foreach ($idFields as $idField) {
             if (!empty($values[$idField])) {
                 $values[substr($idField, 0, -3)] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_ContributionRecur', $idField, $values[$idField]);
             }
         }
         $this->assign('recur', $values);
     }
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:26,代码来源:ContributionRecur.php

示例3: buildQuickForm

 /**
  * Actually build the components of the form.
  */
 public function buildQuickForm()
 {
     // CRM-16398: If current recurring contribution got > 1 lineitems then make amount field readonly
     $amtAttr = array('size' => 20);
     $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($this->_coid);
     if (count($lineItems) > 1) {
         $amtAttr += array('readonly' => TRUE);
     }
     $this->addMoney('amount', ts('Recurring Contribution Amount'), TRUE, $amtAttr, TRUE, 'currency', $this->_subscriptionDetails->currency, TRUE);
     $this->add('text', 'installments', ts('Number of Installments'), array('size' => 20), FALSE);
     if ($this->_donorEmail) {
         $this->add('checkbox', 'is_notify', ts('Notify Contributor?'));
     }
     if (CRM_Core_Permission::check('edit contributions')) {
         CRM_Campaign_BAO_Campaign::addCampaign($this, $this->_subscriptionDetails->campaign_id);
     }
     if (CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($this->contributionRecurID)) {
         $this->addEntityRef('financial_type_id', ts('Financial Type'), array('entity' => 'FinancialType'), TRUE);
     }
     $type = 'next';
     if ($this->_selfService) {
         $type = 'submit';
     }
     // define the buttons
     $this->addButtons(array(array('type' => $type, 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:29,代码来源:UpdateSubscription.php

示例4: testSupportFinancialTypeChange

 /**
  * Test checking if contribution recurr object can allow for changes to financial types.
  *
  */
 public function testSupportFinancialTypeChange()
 {
     $contributionRecur = $this->callAPISuccess('contribution_recur', 'create', $this->_params);
     $contribution = $this->callAPISuccess('contribution', 'create', array('contribution_recur_id' => $contributionRecur['id'], 'total_amount' => '3.00', 'financial_type_id' => 1, 'payment_instrument_id' => 1, 'currency' => 'USD', 'contact_id' => $this->individualCreate(), 'contribution_status_id' => 1, 'recieve_date' => 'yesterday'));
     $this->assertTrue(CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange($contributionRecur['id']));
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:10,代码来源:ContributionRecurTest.php


注:本文中的CRM_Contribute_BAO_ContributionRecur::supportsFinancialTypeChange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。