From e2d2aeab27791b05557908c3db57ac48e27b04c5 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 15 Dec 2014 14:08:42 -0800 Subject: [PATCH] CRM-15688 - Fix price field form display for consistent layout between widgets. ---------------------------------------- * CRM-15688: https://issues.civicrm.org/jira/browse/CRM-15688 --- CRM/Price/BAO/PriceField.php | 26 +++++++++++++------------- css/civicrm.css | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 29e06a6020..0ac93479df 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -358,22 +358,22 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { foreach ($customOption as $opId => $opt) { $taxAmount = CRM_Utils_Array::value('tax_amount', $opt); if ($field->is_display_amounts) { - $opt['label'] = !empty($opt['label']) ? $opt['label'] : ''; + $opt['label'] = !empty($opt['label']) ? $opt['label'] . ' - ' : ''; if (isset($taxAmount) && $invoicing) { if ($displayOpt == 'Do_not_show') { - $opt['label'] = '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ' ' . $opt['label'] . ''; + $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ''; } else if ($displayOpt == 'Inclusive') { - $opt['label'] = '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ' ' . $opt['label'] . ''; - $opt['label'] .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; + $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName] + $taxAmount) . ''; + $opt['label'] .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; } else { - $opt['label'] = '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ' ' . $opt['label'] . ''; - $opt['label'] .= ' + '. CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . ''; + $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ''; + $opt['label'] .= ' + '. CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . ''; } } else { - $opt['label'] = '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ' ' . $opt['label'] . ''; + $opt['label'] = '' . $opt['label'] . '' . '' . CRM_Utils_Money::format($opt[$valueFieldName]) . ''; } } $count = CRM_Utils_Array::value('count', $opt, ''); @@ -456,10 +456,10 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { if ($field->is_display_amounts) { $opt['label'] .= ' - '; if (isset($taxAmount) && $invoicing) { - $opt['label'] .= self::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm); + $opt['label'] = $opt['label'] . self::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm); } else { - $opt['label'] .= CRM_Utils_Money::format($opt[$valueFieldName]); + $opt['label'] = $opt['label'] . CRM_Utils_Money::format($opt[$valueFieldName]); } } @@ -471,7 +471,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { } // CRM-14696 - Improve display for sold out price set options else { - $opt['label'] = $opt['label'] . ' - ' . ts('Sold out'); + $opt['label'] = $opt['label'] . ' (' . ts('Sold out') . ')'; } $selectOption[$opt['id']] = $opt['label']; @@ -504,7 +504,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $max_value = CRM_Utils_Array::value('max_value', $opt, ''); if ($field->is_display_amounts) { - $opt['label'] .= ' - '; + $opt['label'] = '' . $opt['label'] . ' - '; if (isset($taxAmount) && $invoicing) { $opt['label'] .= self::getTaxLabel($opt, $valueFieldName, $displayOpt, $taxTerm); } @@ -770,11 +770,11 @@ WHERE id IN (" . implode(',', array_keys($priceFields)) . ')'; } else if ($displayOpt == 'Inclusive') { $label = CRM_Utils_Money::format($opt[$valueFieldName] + $opt['tax_amount']); - $label .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; + $label .= ' (includes ' . $taxTerm . ' of ' . CRM_Utils_Money::format($opt['tax_amount']) . ')'; } else { $label = CRM_Utils_Money::format($opt[$valueFieldName]); - $label .= ' + '. CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . ''; + $label .= ' + '. CRM_Utils_Money::format($opt['tax_amount']) . ' ' . $taxTerm . ''; } return $label; diff --git a/css/civicrm.css b/css/civicrm.css index 5897a2c3b9..485ed2aeaf 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -4444,13 +4444,13 @@ span.crm-status-icon { } #crm-container.crm-public .price-set-row .crm-price-amount-amount { - font-weight: bold; min-width: 2em; color: #333333; } #crm-container.crm-public .price-set-row .crm-price-amount-label { color: #444444; + font-weight: bold; } #crm-container.crm-public .price-set-row .highlight label { -- 2.25.1