X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FPrice%2FBAO%2FPriceField.php;h=b365b93cbfbbacba09dbf785afab00b037a0de3d;hb=a217b871c19e777c0ed429f5710117b4db7da870;hp=709e5546f69bf715e8d06efbac30f6a6985ef1c0;hpb=0dc0b75958ea0a4a5a279449117b028e1985cb83;p=civicrm-core.git diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 709e5546f6..b365b93cbf 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ @@ -320,22 +320,17 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { )); $extra = array(); - if (!empty($qf->_quickConfig) && !empty($qf->_contributionAmount)) { - foreach ($fieldOptions as &$fieldOption) { - if ($fieldOption['name'] == 'other_amount') { - $fieldOption['label'] = $fieldOption['label'] . ' ' . $currencySymbol; - } - } - $qf->assign('priceset', $elementName); - $extra = array('onclick' => 'useAmountOther();'); - } - if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) { $useRequired = 0; } elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label. $label = $fieldOptions[$optionKey]['label']; + if (!empty($qf->_quickConfig) && !empty($qf->_contributionAmount) && strtolower($fieldOptions[$optionKey]['name']) == 'other_amount') { + $label .= ' ' . $currencySymbol; + $qf->assign('priceset', $elementName); + $extra = array('onclick' => 'useAmountOther();'); + } } $element = &$qf->add('text', $elementName, $label, @@ -495,7 +490,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { } // CRM-14696 - Improve display for sold out price set options else { - $opt['id'] = 'crm_disabled_opt-'.$opt['id']; + $opt['id'] = 'crm_disabled_opt-' . $opt['id']; $opt['label'] = $opt['label'] . ' (' . ts('Sold out') . ')'; }