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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding new elements to forms.
Pages: [1]

Author Topic: Adding new elements to forms.  (Read 1193 times)

reekingofrandomness

  • Guest
Adding new elements to forms.
June 29, 2009, 12:44:03 pm
Hello, I'm trying to extend civiEvent's price set functionality to allow each ticket type to have a maximum availabiility and for the capacity of the event to be worked out from there. Most of the project is going well, however I'm having trouble adding field to the 'Edit Field' form. I've read through Form.php and thought it was all down to the add() and addRule() functions, however, nothing happened when I added the following lines into the buildQuickForm function in CRM/Price/Form/Field.php:
Code: [Select]

        // max_available
        $this->add('text', 'max_available', ts('Maximum Available'));
        $this->addRule('max_available', ts('Must be a whole number'), 'positiveInteger');

        // is_limited
        $this->add('checkbox', 'is_limited', ts('How many places?'));

Have I missed something obvious? Are there other changes I need to make?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Adding new elements to forms.
June 29, 2009, 04:37:31 pm
Have you added these fields to the associate smarty template?

templates/CRM/Price/Form/Field.tpl
Protect your investment in CiviCRM by  becoming a Member!

reekingofrandomness

  • Guest
Re: Adding new elements to forms.
June 30, 2009, 04:11:39 am
Thanks! That's one problem  down =)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding new elements to forms.

This forum was archived on 2017-11-26.