CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Other amount $ needed
Pages: [1]

Author Topic: Other amount $ needed  (Read 364 times)

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Other amount $ needed
March 13, 2013, 04:16:48 am
Hi,

How can I place a dollar sign,  $  , infront of the other amount box so contributors will not put a $ in the box. If they enter a $, it gives an invalid amount error.

Thanks,
Helen
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Other amount $ needed
March 14, 2013, 06:24:01 am
Hi.

You could customize a template, either by actually customizing it, or by using an "extra" file an a few lines of JS code.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: Other amount $ needed
March 14, 2013, 07:41:36 am
Thanks Hershel. I think maybe I would be better editing the error message. Perhaps you can steer me to the correct file.

I have made a change in the administrator/components/com_civicrm/civicrm/CRM/Core/Form.php line 1153 from
'Please enter a valid amount.'
to
'Please enter a valid amount (numbers and decimal point only).'
but this did not change it on my form on the front-end.

Where else should I look?

Thanks,
Helen
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Other amount $ needed
March 14, 2013, 07:46:21 am
You should not edit CiviCRM files. You should use a customized PHP file if necessary, as per http://wiki.civicrm.org/confluence/display/CRMDOC42/Directories

Regarding where this is, I don't know, but here is a list of possibilities:

Code: [Select]
$ grep -r 'Please enter a valid amount' *
CRM/Contribute/Form/Task/Status.php:      $this->addRule("fee_amount_{$row['contribution_id']}", ts('Please enter a valid amount.'), 'money');
CRM/Contribute/Form/Contribution/Main.php:      $this->addRule('amount_other', ts('Please enter a valid amount (numbers and decimal point only).'), 'money');
CRM/Member/Form/Membership.php:      $this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
CRM/Member/Form/MembershipRenewal.php:      $this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
CRM/Member/Form/MembershipRenewal.php:      $this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
CRM/Core/Form.php:    $this->addRule($name, ts('Please enter a valid amount.'), 'money');
CRM/Core/BAO/UFGroup.php:      $form->addRule($name, ts('Please enter a valid amount.'), 'money');
CRM/Grant/Form/Task/Update.php:    $this->addRule('amount_granted', ts('Please enter a valid amount.'), 'money');
CRM/Grant/Form/Grant.php:    $this->addRule('amount_total', ts('Please enter a valid amount.'), 'money');
CRM/Grant/Form/Grant.php:    $this->addRule('amount_granted', ts('Please enter a valid amount.'), 'money');
CRM/Grant/Form/Grant.php:    $this->addRule('amount_requested', ts('Please enter a valid amount.'), 'money');
CRM/Contact/Form/Search/Custom/ContributionAggregate.php:    $form->addRule('min_amount', ts('Please enter a valid amount (numbers and decimal point only).'), 'money');
CRM/Contact/Form/Search/Custom/ContributionAggregate.php:    $form->addRule('max_amount', ts('Please enter a valid amount (numbers and decimal point only).'), 'money');
CRM/Price/Form/Field.php:      $this->addRule('option_amount[' . $i . ']', ts('Please enter a valid amount for this field.'), 'money');
CRM/Price/BAO/Field.php:          $message = ts("Please enter a valid amount.");

However this should be a last resort. Perhaps the Word Replacements feature will work for this:

http://wiki.civicrm.org/confluence/display/CRMDOC40/Word+Replacement
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

helenbn

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 2
    • Pretty Good Designs
  • CiviCRM version: 4.5.x
  • CMS version: Joomla 2.5.x, 3.x
  • MySQL version: 5.x.x
  • PHP version: 5.x.x
Re: Other amount $ needed
March 14, 2013, 07:56:27 am
Word replacement did it!!

Thanks again!  ;D
Pretty Good Designs | http://prettygooddesigns.com | Hey, that's pretty good!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Other amount $ needed

This forum was archived on 2017-11-26.