+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
// check for is_monetary status
$isMonetary = CRM_Utils_Array::value('is_monetary', $this->_values);
$isPayLater = CRM_Utils_Array::value('is_pay_later', $this->_values);
- if (!empty($this->_ccid) && $isPayLater) {
- $isPayLater = FALSE;
- $this->_values['is_pay_later'] = FALSE;
+ if (!empty($this->_ccid)) {
+ $this->_values['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution',
+ $this->_ccid,
+ 'financial_type_id'
+ );
+ if ($isPayLater) {
+ $isPayLater = FALSE;
+ $this->_values['is_pay_later'] = FALSE;
+ }
}
if ($isMonetary &&
'total_amount' => 1,
'amount_level' => 1,
'contribution_status_id' => 1,
+ // @todo replace payment_instrument with payment instrument id.
+ // both are available now but the id field is the most consistent.
'payment_instrument' => 1,
- 'check_number' => 1,
+ 'payment_instrument_id' => 1,
+ 'contribution_check_number' => 1,
'financial_type' => 1,
);
else {
$viewOnlyFileValues[$key] = $fileValue;
}
+
+ // On viewOnly use-case (as in online contribution Confirm page) we no longer need to set
+ // required property because being required file is already uploaded while registration
+ $field['is_required'] = FALSE;
}
if ($profileContactType) {
//Since we are showing honoree name separately so we are removing it from honoree profile just for display