From 4dd3f46d35b13a7efe469c4ab0c366c399235e01 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Wed, 17 Dec 2014 17:05:37 -0800 Subject: [PATCH] CRM-14696 - Fixes for text input price field sold out display. Also spacing and font size improvements. ---------------------------------------- * CRM-14696: https://issues.civicrm.org/jira/browse/CRM-14696 --- CRM/Price/BAO/PriceField.php | 3 +- css/civicrm.css | 4 ++- templates/CRM/Price/Form/PriceSet.tpl | 48 ++++++++++++++++----------- 3 files changed, 32 insertions(+), 23 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 75aeb4edbd..e0d971542a 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -331,8 +331,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { // CRM-6902 - Add "max" option for a price set field if (in_array($optionKey, $freezeOptions)) { $element->freeze(); - // CRM-14696 - Improve display for sold out price set options - $element->setLabel($label . ' (' . ts('Sold out') . ')'); + // CRM-14696 - Styling for sold out Text input fields is handled in PriceSet.tpl } //CRM-10117 diff --git a/css/civicrm.css b/css/civicrm.css index 6d4f7c0dbb..41bbfe18e0 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -4317,7 +4317,8 @@ span.crm-status-icon { padding-top: 6px; } -#crm-container.crm-public .calc-value { +#crm-container.crm-public .calc-value, +#crm-container.crm-public .content { padding-top: 6px; font-size: 15px; } @@ -4473,6 +4474,7 @@ span.crm-status-icon { #crm-container .price-set-row span.sold-out-option .crm-price-amount-amount { font-style: italic !important; font-weight: normal !important; + font-size: 15px; color: #666 !important; } #crm-container .crm-extensions-upgrade { diff --git a/templates/CRM/Price/Form/PriceSet.tpl b/templates/CRM/Price/Form/PriceSet.tpl index 1c61d27a7f..9eb449a452 100644 --- a/templates/CRM/Price/Form/PriceSet.tpl +++ b/templates/CRM/Price/Form/PriceSet.tpl @@ -68,32 +68,40 @@
{$form.$element_name.label}
{$form.$element_name.html} - {if $element.is_display_amounts && $element.html_type eq 'Text'} - - {foreach item=option from=$element.options} - {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing} - {assign var="amount" value=`$option.amount+$option.tax_amount`} - {if $displayOpt == 'Do_not_show'} - {$amount|crmMoney} - {elseif $displayOpt == 'Inclusive'} - {$amount|crmMoney} - (includes {$taxTerm} of {$option.tax_amount|crmMoney}) - {else} - {$option.amount|crmMoney} - + {$option.tax_amount|crmMoney} {$taxTerm} - {/if} - {else} - {$option.amount|crmMoney} - {/if} - {/foreach} + {if $element.html_type eq 'Text'} + {if $element.is_display_amounts} + + {foreach item=option from=$element.options} + {if ($option.tax_amount || $option.tax_amount == "0") && $displayOpt && $invoicing} + {assign var="amount" value=`$option.amount+$option.tax_amount`} + {if $displayOpt == 'Do_not_show'} + {$amount|crmMoney} + {elseif $displayOpt == 'Inclusive'} + {$amount|crmMoney} + (includes {$taxTerm} of {$option.tax_amount|crmMoney}) + {else} + {$option.amount|crmMoney} + + {$option.tax_amount|crmMoney} {$taxTerm} + {/if} + {else} + {$option.amount|crmMoney} {$fieldHandle} {$form.$fieldHandle.frozen} + {/if} + {if $form.$element_name.frozen EQ 1} ({ts}Sold out{/ts}){/if} + {/foreach} + {else} + {* Not showing amount, but still need to conditionally show Sold out marker *} + {if $form.$element_name.frozen EQ 1} + ({ts}Sold out{/ts}) + {/if} + {/if} {/if} - {if $element.help_post}
{$element.help_post}{/if} + {if $element.help_post}
{$element.help_post}{/if}
{/if} - + {/if} {/foreach} -- 2.25.1