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


PHP CRM_Core_Config::isEnabledBackOfficeCreditCardPayments方法代码示例

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


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

示例1: run

 /**
  * 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.
  *
  * return null
  * @access public
  */
 function run()
 {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('action', $this->_action);
     $this->assign('context', $this->_context);
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
     CRM_Pledge_Page_Tab::setContext($this);
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $this->edit();
     } else {
         $pledgeId = CRM_Utils_Request::retrieve('pledgeId', 'Positive', $this);
         $paymentDetails = CRM_Pledge_BAO_PledgePayment::getPledgePayments($pledgeId);
         $this->assign('rows', $paymentDetails);
         $this->assign('pledgeId', $pledgeId);
         $this->assign('contactId', $this->_contactId);
         // check if we can process credit card contribs
         $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
         // check is the user has view/edit signer permission
         $permission = 'view';
         if (CRM_Core_Permission::check('edit pledges')) {
             $permission = 'edit';
         }
         $this->assign('permission', $permission);
     }
     return parent::run();
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:33,代码来源:Payment.php

示例2: setDefaultValues

 /**
  * Set default values.
  *
  * @return array
  */
 public function setDefaultValues()
 {
     $defaults = $this->_values;
     // Set defaults for pledge payment.
     if ($this->_ppID) {
         $defaults['total_amount'] = CRM_Utils_Array::value('scheduled_amount', $this->_pledgeValues['pledgePayment']);
         $defaults['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_pledgeValues);
         $defaults['currency'] = CRM_Utils_Array::value('currency', $this->_pledgeValues);
         $defaults['option_type'] = 1;
     }
     if ($this->_action & CRM_Core_Action::DELETE) {
         return $defaults;
     }
     $defaults['frequency_interval'] = 1;
     $defaults['frequency_unit'] = 'month';
     // Set soft credit defaults.
     CRM_Contribute_Form_SoftCredit::setDefaultValues($defaults, $this);
     if ($this->_mode) {
         $config = CRM_Core_Config::singleton();
         // Set default country from config if no country set.
         if (empty($defaults["billing_country_id-{$this->_bltID}"])) {
             $defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry;
         }
         if (empty($defaults["billing_state_province_id-{$this->_bltID}"])) {
             $defaults["billing_state_province_id-{$this->_bltID}"] = $config->defaultContactStateProvince;
         }
         $billingDefaults = $this->getProfileDefaults('Billing', $this->_contactID);
         $defaults = array_merge($defaults, $billingDefaults);
     }
     if ($this->_id) {
         $this->_contactID = $defaults['contact_id'];
     }
     // Set $newCredit variable in template to control whether link to credit card mode is included.
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
     // Fix the display of the monetary value, CRM-4038.
     if (isset($defaults['total_amount'])) {
         if (!empty($defaults['tax_amount'])) {
             $componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id);
             if (!(CRM_Utils_Array::value('membership', $componentDetails) || CRM_Utils_Array::value('participant', $componentDetails))) {
                 $defaults['total_amount'] = CRM_Utils_Money::format($defaults['total_amount'] - $defaults['tax_amount'], NULL, '%a');
             }
         } else {
             $defaults['total_amount'] = CRM_Utils_Money::format($defaults['total_amount'], NULL, '%a');
         }
     }
     if (isset($defaults['non_deductible_amount'])) {
         $defaults['non_deductible_amount'] = CRM_Utils_Money::format($defaults['non_deductible_amount'], NULL, '%a');
     }
     if (isset($defaults['fee_amount'])) {
         $defaults['fee_amount'] = CRM_Utils_Money::format($defaults['fee_amount'], NULL, '%a');
     }
     if (isset($defaults['net_amount'])) {
         $defaults['net_amount'] = CRM_Utils_Money::format($defaults['net_amount'], NULL, '%a');
     }
     if ($this->_contributionType) {
         $defaults['financial_type_id'] = $this->_contributionType;
     }
     if (empty($defaults['payment_instrument_id'])) {
         $defaults['payment_instrument_id'] = key(CRM_Core_OptionGroup::values('payment_instrument', FALSE, FALSE, FALSE, 'AND is_default = 1'));
     }
     if (!empty($defaults['is_test'])) {
         $this->assign('is_test', TRUE);
     }
     $this->assign('showOption', TRUE);
     // For Premium section.
     if ($this->_premiumID) {
         $this->assign('showOption', FALSE);
         $options = isset($this->_options[$this->_productDAO->product_id]) ? $this->_options[$this->_productDAO->product_id] : "";
         if (!$options) {
             $this->assign('showOption', TRUE);
         }
         $options_key = CRM_Utils_Array::key($this->_productDAO->product_option, $options);
         if ($options_key) {
             $defaults['product_name'] = array($this->_productDAO->product_id, trim($options_key));
         } else {
             $defaults['product_name'] = array($this->_productDAO->product_id);
         }
         if ($this->_productDAO->fulfilled_date) {
             list($defaults['fulfilled_date']) = CRM_Utils_Date::setDateDefaults($this->_productDAO->fulfilled_date);
         }
     }
     if (isset($this->userEmail)) {
         $this->assign('email', $this->userEmail);
     }
     if (!empty($defaults['is_pay_later'])) {
         $this->assign('is_pay_later', TRUE);
     }
     $this->assign('contribution_status_id', CRM_Utils_Array::value('contribution_status_id', $defaults));
     $dates = array('receive_date', 'receipt_date', 'cancel_date', 'thankyou_date');
     foreach ($dates as $key) {
         if (!empty($defaults[$key])) {
             list($defaults[$key], $defaults[$key . '_time']) = CRM_Utils_Date::setDateDefaults(CRM_Utils_Array::value($key, $defaults), 'activityDateTime');
         }
     }
     if (!$this->_id && empty($defaults['receive_date'])) {
//.........这里部分代码省略.........
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:101,代码来源:Contribution.php

示例3: 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 registration
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
     self::setContext($this);
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
         $this->edit();
     } elseif ($this->_action & CRM_Core_Action::DETACH) {
         CRM_Pledge_BAO_Pledge::cancel($this->_id);
         $session = CRM_Core_Session::singleton();
         $session->setStatus(ts('Pledge has been Cancelled and all scheduled (not completed) payments have been cancelled.<br />'));
         CRM_Utils_System::redirect($session->popUserContext());
     } else {
         $this->browse();
     }
     return parent::run();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:25,代码来源:Tab.php

示例4: setTemplateShortcutValues

 /**
  * Create the list of options to create New objects for the application and format is as a block.
  *
  * @return void
  */
 private static function setTemplateShortcutValues()
 {
     $config = CRM_Core_Config::singleton();
     static $shortCuts = array();
     if (!$shortCuts) {
         if (CRM_Core_Permission::check('add contacts')) {
             if (CRM_Core_Permission::giveMeAllACLs()) {
                 $shortCuts = CRM_Contact_BAO_ContactType::getCreateNewList();
             }
         }
         // new activity (select target contact)
         $shortCuts = array_merge($shortCuts, array(array('path' => 'civicrm/activity', 'query' => 'action=add&reset=1&context=standalone', 'ref' => 'new-activity', 'title' => ts('Activity'))));
         $components = CRM_Core_Component::getEnabledComponents();
         if (!empty($config->enableComponents)) {
             // check if we can process credit card contribs
             $newCredit = CRM_Core_Config::isEnabledBackOfficeCreditCardPayments();
             foreach ($components as $componentName => $obj) {
                 if (in_array($componentName, $config->enableComponents)) {
                     $obj->creatNewShortcut($shortCuts, $newCredit);
                 }
             }
         }
         // new email (select recipients)
         $shortCuts = array_merge($shortCuts, array(array('path' => 'civicrm/activity/email/add', 'query' => 'atype=3&action=add&reset=1&context=standalone', 'ref' => 'new-email', 'title' => ts('Email'))));
         if (CRM_Core_Permission::check('edit groups')) {
             $shortCuts = array_merge($shortCuts, array(array('path' => 'civicrm/group/add', 'query' => 'reset=1', 'ref' => 'new-group', 'title' => ts('Group'))));
         }
         if (CRM_Core_Permission::check('administer CiviCRM')) {
             $shortCuts = array_merge($shortCuts, array(array('path' => 'civicrm/admin/tag', 'query' => 'reset=1&action=add', 'ref' => 'new-tag', 'title' => ts('Tag'))));
         }
         if (empty($shortCuts)) {
             return NULL;
         }
     }
     $values = array();
     foreach ($shortCuts as $key => $short) {
         $values[$key] = self::setShortCutValues($short);
     }
     // call links hook to add user defined links
     CRM_Utils_Hook::links('create.new.shorcuts', NULL, CRM_Core_DAO::$_nullObject, $values, CRM_Core_DAO::$_nullObject, CRM_Core_DAO::$_nullObject);
     foreach ($values as $key => $val) {
         if (!empty($val['title'])) {
             $values[$key]['name'] = CRM_Utils_Array::value('name', $val, $val['title']);
         }
     }
     self::setProperty(self::CREATE_NEW, 'templateValues', array('shortCuts' => $values));
 }
开发者ID:utkarshsharma,项目名称:civicrm-core,代码行数:52,代码来源:Block.php

示例5: setDefaultValues

 /**
  * @return array
  */
 public function setDefaultValues()
 {
     if ($this->_view == 'transaction' && $this->_action & CRM_Core_Action::BROWSE) {
         return NULL;
     }
     $defaults = array();
     if ($this->_mode) {
         $defaults = $this->_values;
         $config = CRM_Core_Config::singleton();
         // set default country from config if no country set
         if (empty($defaults["billing_country_id-{$this->_bltID}"])) {
             $defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry;
         }
         if (empty($defaults["billing_state_province_id-{$this->_bltID}"])) {
             $defaults["billing_state_province_id-{$this->_bltID}"] = $config->defaultContactStateProvince;
         }
         $billingDefaults = $this->getProfileDefaults('Billing', $this->_contactId);
         $defaults = array_merge($defaults, $billingDefaults);
     }
     if (empty($defaults['trxn_date']) && empty($defaults['trxn_date_time'])) {
         list($defaults['trxn_date'], $defaults['trxn_date_time']) = CRM_Utils_Date::setDateDefaults(CRM_Utils_Array::value('register_date', $defaults), 'activityDateTime');
     }
     if ($this->_refund) {
         $defaults['total_amount'] = abs($this->_refund);
     }
     // Set $newCredit variable in template to control whether link to credit card mode is included
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
     return $defaults;
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:32,代码来源:AdditionalPayment.php

示例6: 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();
 }
开发者ID:kidaa30,项目名称:yes,代码行数:45,代码来源:Tab.php

示例7: 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 contribs
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
         $this->edit();
     } else {
         $this->browse();
     }
     return parent::run();
 }
开发者ID:veda-consulting,项目名称:caat-4.7-recurring,代码行数:21,代码来源:ContributionRecurTab.php

示例8: 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 registration
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());
     // Only show credit card registration button if user has CiviContribute permission
     if (CRM_Core_Permission::access('CiviContribute')) {
         $this->assign('accessContribution', TRUE);
     } else {
         $this->assign('accessContribution', FALSE);
     }
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
         $this->edit();
     } else {
         $this->browse();
     }
     return parent::run();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:26,代码来源:Tab.php


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