-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
CRM-19549 : New pledge data entry page shows hard coded $ for installments #9408
Conversation
…ments ---------------------------------------- * CRM-19549: New pledge data entry page shows hard coded $ for installments https://issues.civicrm.org/jira/browse/CRM-19549
Can one of the admins verify this patch? |
<span class="currency-symbol">{$form.eachPaymentAmount.html|crmMoney:$currency}</span> | ||
{elseif $action eq 2 and !$isPending} | ||
<span class="currency-symbol">{$eachPaymentAmount|crmMoney:$currency} </span> | ||
{/if} {ts}every{/ts} {$form.frequency_interval.html} {$form.frequency_unit.html}</td></tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear - is this just a whitespace change or are you altering anything here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I added span with class <span class="currency-symbol">
, so that I can change it when currency drop down changes.
@civicrm-builder add to whitelist |
cj('#currency').closest('tr').next('tr').find('.currency-symbol').text(cj('#currency option:selected').text()); | ||
// if there are more than one currency enabled. | ||
cj('#currency').change(function(){ | ||
cj('#currency').closest('tr').next('tr').find('.currency-symbol').text(cj(this).find(':selected').text()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm changing whole text instead of just currency symbol as many currencies does not have symbol, let me know if you think other way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a display of whole text (USD ($) 100
) looks little unusual than only symbols ($ 100
). IMO, it should only display a symbol before the amount on the form. @colemanw Any suggestions ?
Also, instead of navigating to the currency-symbol
class through different methods, I think we should directly select the element from the starting point as we don't have the class name used anywhere else in the form. Something like -
cj('.currency-symbol').text(...);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worked on this for QA and noticed that the readonly amount
textfield eachPaymentAmount
seems to be missing from the form. @sharique Can you please take a look at it ?
This may be because the span tag added also includes the text field onto it, which we should append it after the currency change event.
Thanks!
@jitendrapurohit looking into it. |
… if any ---------------------------------------- * CRM-19549: New pledge data entry page shows hard coded $ for installments https://issues.civicrm.org/jira/browse/CRM-19549
@jitendrapurohit check now, it is fixed. |
@sharique This is working much better now. Thanks for the update :-). Just wondering if it could be possible to do the indentation fixes to your js part. CiviCRM mainly uses a 2 space policy for most part of the code(PHP, js etc). More about this - https://wiki.civicrm.org/confluence/display/CRMDOC/Javascript+Reference#JavascriptReference-CodingStandards Thanks! |
---------------------------------------- * CRM-19549: New pledge data entry page shows hard coded $ for installments https://issues.civicrm.org/jira/browse/CRM-19549
@jitendrapurohit done. |
I've cherry-picked the above commits and created a new PR #9475 which includes -
@sharique Can you please verify if works for you too ? Thanks. |
@jitendrapurohit bit busy, will test and let you know. |
@jitendrapurohit looks good, |
closing in favor of #9475 |
https://issues.civicrm.org/jira/browse/CRM-19549