<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
* Set variables up before form is built.
*
* @param CRM_Core_Form $form
- *
- * @return void
*/
public static function preProcess(&$form) {
//as when call come from register.php
* This function sets the default values for the form in edit/view mode
* the default values are retrieved from the database
*
- *
* @param CRM_Core_Form $form
- *
- * @return void
*/
public static function setDefaultValues(&$form) {
$defaults = array();
* @param int $eventID
* @param bool $includeQtyZero
*
- * @return void
+ * @return array
*/
public static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) {
$defaults = array();
* Build the form object.
*
* @param CRM_Core_Form $form
- *
- * @return void
*/
public static function buildQuickForm(&$form) {
if ($form->_eventId) {
CRM_Event_Form_Registration::initEventFee($form, $event['id']);
CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
$lineItem = array();
- $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
+ $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
$totalTaxAmount = 0;
if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
$element->freeze();
}
}
+ if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()
+ && !CRM_Utils_Array::value('fee', $form->_values)
+ && CRM_Utils_Array::value('snippet', $_REQUEST) == CRM_Core_Smarty::PRINT_NOFORM
+ ) {
+ $form->assign('isFTPermissionDenied', TRUE);
+ return FALSE;
+ }
if ($form->_mode) {
CRM_Core_Payment_Form::buildPaymentForm($form, $form->_paymentProcessor, FALSE, TRUE);
}
$form->addElement('checkbox', 'record_contribution', ts('Record Payment?'), NULL,
array('onclick' => "return showHideByValue('record_contribution','','payment_information','table-row','radio',false);")
);
+ // Check permissions for financial type first
+ if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) {
+ CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, $form->_action);
+ }
+ else {
+ $financialTypes = CRM_Contribute_PseudoConstant::financialType();
+ }
$form->add('select', 'financial_type_id',
ts('Financial Type'),
- array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType()
+ array('' => ts('- select -')) + $financialTypes
);
$form->addDateTime('receive_date', ts('Received'), FALSE, array('formatType' => 'activityDateTime'));
}
}
- $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
- 'mailing_backend'
- );
+ $mailingInfo = Civi::settings()->get('mailing_backend');
$form->assign('outBound_option', $mailingInfo['outBound_option']);
$form->assign('hasPayment', $form->_paymentId);
}