return $name;
}
+ /**
+ * Get the currency for the form.
+ *
+ * @todo this should be overriden on the forms rather than having this
+ * historic, possible handling in here. As we clean that up we should
+ * add deprecation notices into here.
+ */
+ public function getCurrency() {
+ $currency = CRM_Utils_Array::value('currency', $this->_values);
+ // For event forms, currency is in a different spot
+ if (empty($currency)) {
+ $currency = CRM_Utils_Array::value('currency', CRM_Utils_Array::value('event', $this->_values));
+ }
+ if (empty($currency)) {
+ $currency = CRM_Utils_Request::retrieveValue('currency', 'String');
+ }
+ // @todo If empty there is a problem - we should probably put in a deprecation notice
+ // to warn if that seems to be happening.
+ return $currency;
+ }
+
}
$form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
- $currency = CRM_Utils_Array::value('currency', $form->_values);
- // For event forms, currency is in a different spot
- if (empty($currency)) {
- $currency = CRM_Utils_Array::value('currency', $form->_values['event']);
- }
+ $currency = $form->getCurrency();
$form->assign('currency', $currency);
// also set cancel subscription url