Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop passing html to crmMoney #19941

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/Contribution/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
{else}
<div class="display-block">
<td class="label">{$form.total_amount.label}</td>
<td><span>{$form.total_amount.html|crmMoney}&nbsp;&nbsp;{if $taxAmount}{ts 1=$taxTerm 2=$taxAmount|crmMoney}(includes %1 of %2){/ts}{/if}</span></td>
<td><span>{$form.total_amount.html}&nbsp;&nbsp;{if $taxAmount}{ts 1=$taxTerm 2=$taxAmount|crmMoney}(includes %1 of %2){/ts}{/if}</span></td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a bit to figure out how to even get here. Make a contribution with pending status and then visit any contribution page and add ccid=44 to the url, where 44 is the contribution id you just made. The difference after the patch is the dollar sign is missing. Otherwise it still seems ok even with a different locale.

</div>
{/if}
{else}
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Contribute/Form/ManagePremiums.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@
</tr>
<tr class="crm-contribution-form-block-min_contribution">
<td class="label">{$form.min_contribution.label}</td>
<td class="html-adjust">{$form.min_contribution.html|crmMoney}<br />
<td class="html-adjust">{$form.min_contribution.html}<br />
<span class="description">{ts}The minimum contribution amount required to be eligible to select this premium. If you want to offer it to all contributors regardless of contribution amount, enter '0'. If display of minimum contribution amounts is enabled then this text is displayed:{/ts} <em>{ts}(Contribute at least X to be eligible for this gift.){/ts}</em></span>
</td>
</tr>
<tr class="crm-contribution-form-block-price">
<td class="label">{$form.price.label}</td>
<td class="html-adjust">{$form.price.html|crmMoney}<br />
<td class="html-adjust">{$form.price.html}<br />
<span class="description">{ts}The market value of this premium (e.g. retail price). For tax-deductible contributions, this amount will be used to set the non-deductible amount in the contribution record and receipt.{/ts}</span>
</td>
</tr>
<tr class="crm-contribution-form-block-cost">
<td class="label">{$form.cost.label}</td>
<td class="html-adjust">{$form.cost.html|crmMoney}<br />
<td class="html-adjust">{$form.cost.html}<br />
Copy link
Contributor

@demeritcowboy demeritcowboy Mar 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the dollar sign goes missing but fixes the warning. There's also something else weird about this form both before and after the patch. In another locale it converts the separators to en_US when you go back in to edit, or maybe more accurately it doesn't convert them to the locale.

<span class="description">{ts}You may optionally record the actual cost of this premium to your organization. This may be useful when evaluating net return for this incentive.{/ts}</span>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Event/Form/EventFees.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<td class="label">{$form.financial_type_id.label}<span class="crm-marker"> *</span></td>
<td>{$form.financial_type_id.html}<br /><span class="description">{ts}Select the appropriate financial type for this payment.{/ts}</span></td>
</tr>
<tr class="crm-event-eventfees-form-block-total_amount"><td class="label">{$form.total_amount.label}</td><td>{$form.total_amount.html|crmMoney:$currency}</td></tr>
<tr class="crm-event-eventfees-form-block-total_amount"><td class="label">{$form.total_amount.label}</td><td>{$form.total_amount.html}</td></tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the warning I saw yesterday (two days ago). Again just no dollar sign.

In another locale the javascript when you choose the price formats it with en_US separators but it accepts it either way. And if you have mixed currencies the whole form gets confused.

<tr>
<td class="label" >{$form.receive_date.label}</td>
<td>{$form.receive_date.html}</td>
Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Event/Form/ManageEvent/Fee.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<tr class="columnheader"><td scope="column">{ts}Fee Label{/ts}</td><td scope="column">{ts}Amount{/ts}</td><td scope="column">{ts}Default?{/ts}<br />{$form.default.0.html}</td></tr>
{section name=loop start=1 loop=11}
{assign var=idx value=$smarty.section.loop.index}
<tr><td class="even-row crm-event-manage-fee-form-block-label_{$idx}">{$form.label.$idx.html}</td><td class="crm-event-manage-fee-form-block-value_{$idx}">{$form.value.$idx.html|crmMoney}</td><td class="even-row crm-event-manage-fee-form-block-default_{$idx}">{$form.default.$idx.html}</td></tr>
<tr><td class="even-row crm-event-manage-fee-form-block-label_{$idx}">{$form.label.$idx.html}</td><td class="crm-event-manage-fee-form-block-value_{$idx}">{$form.value.$idx.html}</td><td class="even-row crm-event-manage-fee-form-block-default_{$idx}">{$form.default.$idx.html}</td></tr>
{/section}
</table>
</fieldset>
Expand Down Expand Up @@ -208,7 +208,7 @@
{section name=loop1 start=1 loop=6}
{assign var=idy value=$smarty.section.loop1.index}
{if $form.discount_name.$idy.value}
<td>{$form.discounted_value.$idx.$idy.html|crmMoney}</td>
<td>{$form.discounted_value.$idx.$idy.html}</td>
{/if}
{/section}
<td class="even-row">{$form.discounted_default.$idx.html}</td>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Pledge/Form/Pledge.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<td>{$form.installments.html} {ts}installments of{/ts}
<span class='currency-symbol'>
{if $action eq 1 or $isPending}
{$form.eachPaymentAmount.html|crmMoney:$currency}
{$form.eachPaymentAmount.html}
{elseif $action eq 2 and !$isPending}
{$eachPaymentAmount|crmMoney:$currency}
{/if}
Expand Down