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

CRM-19549 : New pledge data entry page shows hard coded $ for installments #9408

Closed
wants to merge 3 commits into from
Closed

Conversation

sharique
Copy link
Contributor


…ments

----------------------------------------
* CRM-19549: New pledge data entry page shows hard coded $ for installments
  https://issues.civicrm.org/jira/browse/CRM-19549
@civicrm-builder
Copy link

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}&nbsp;{ts}every{/ts}&nbsp;{$form.frequency_interval.html}&nbsp;{$form.frequency_unit.html}</td></tr>
Copy link
Member

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?

Copy link
Contributor Author

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.

@colemanw
Copy link
Member

@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());
Copy link
Contributor Author

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.

Copy link
Contributor

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(...);

Copy link
Contributor

@jitendrapurohit jitendrapurohit left a 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!

@sharique
Copy link
Contributor Author

@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
@sharique
Copy link
Contributor Author

@jitendrapurohit check now, it is fixed.

@jitendrapurohit
Copy link
Contributor

@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
@sharique
Copy link
Contributor Author

@jitendrapurohit done.

@jitendrapurohit
Copy link
Contributor

jitendrapurohit commented Dec 1, 2016

I've cherry-picked the above commits and created a new PR #9475 which includes -

  • Display of the currency on page load should be handled on PHP instead of js.
  • Fix for missing amount text on Edit page when pledge status is being Completed.
    completed_status
  • Minor optimisation.
  • Display of currency without symbol is still a problem, I've raised a separate ticket for it at https://issues.civicrm.org/jira/browse/CRM-19701

@sharique Can you please verify if works for you too ?

Thanks.

@sharique
Copy link
Contributor Author

sharique commented Dec 5, 2016

@jitendrapurohit bit busy, will test and let you know.

@sharique
Copy link
Contributor Author

sharique commented Dec 5, 2016

@jitendrapurohit looks good,

@jitendrapurohit
Copy link
Contributor

closing in favor of #9475

@monishdeb monishdeb closed this Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants