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) »
  • Conditional pricing options and price set templates?
Pages: 1 [2]

Author Topic: Conditional pricing options and price set templates?  (Read 5364 times)

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Conditional pricing options and price set templates?
January 06, 2011, 10:21:33 am
A couple of questions about your two suggetions:

1) About auxiliary tables.  Is the general practice when creating a Drupal module to create the tables in Drupal's database, or in CiviCRM's database?

2) I am trying to get a handle on the appropriate Civi hooks to use, and I'm finding it's a very steep learning curve to understand the hook specification (http://wiki.civicrm.org/confluence/display/CRMDOC33/CiviCRM+hook+specification).  It's partially because the terminology is different (e.g. "page" in Civi doesn't refer to pages that contain forms).  Do you have any pointers that would make it easier for me to evaluate the hook specifications and determine if the hooks I need even exist?  Right now I'm plodding along, trying likely-looking ones out in a test module, but I imagine there might be a more thorough reference out there that would take some of the guesswork out.

To start out with, I need a hook that can either add a tab to the event configuration form (apparently not hook_civicrm_tabs because that is only for viewing contacts), and/or one that can inject form elements and other code into the "Fees" tab.  Do those things exist?
« Last Edit: January 06, 2011, 12:35:14 pm by jakecivi »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:06:08 pm
I think you want the build_form hook - I'm afraid quickform is quite hard to get to grips with.

We usually add tables to the drupal DB
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:12:51 pm
About the tables: will I be dealing with hook_civicrm_custom at all to deal with auxiliary tables built into to the Drupal database, or is that for a different kind of custom table?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:15:00 pm
That refers to the custom data tables - ie. those that extend entities with custom data
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:33:44 pm
Then it looks like I'll be using hook_civicrm_postProcess and hook_civicrm_buildForm to put new form elements in the Fees tab when editing events, and then to write the data collected to auxiliary tables.

More questions:
- Is there a hook I can use to present the user with more form elements as necessary, as is done if you add Discount Sets to the Fees tab? 
- Also, is there a hook that can add tabs to the Event editing form?  Looks like civicrm_tabs is only for viewing a contact.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:46:03 pm
 I'm not hugely sure on those questions but watch out for the fact that if you add an element using the build_form you may need to edit the relevant tpl to make it display. Adding tabs is possibly done through the tpl (ie. the hook assigns the element and then the tpl dictates how it is displayed)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:53:26 pm
Yikes.  So that means I'm not just talking about a Drupal module, I'm talking Drupal module plus hacks to the civicrm templates?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Conditional pricing options and price set templates?
January 06, 2011, 01:54:20 pm
yes - but put the custom templates outside core - check the floss manual developer section  if you don't know what I mean
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Conditional pricing options and price set templates?
January 06, 2011, 02:07:38 pm
Is there no way to at least keep the templates in my Drupal module's folder (as is standard practice for Drupal)?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Conditional pricing options and price set templates?
January 06, 2011, 02:11:39 pm
sort of - you will need to have only one custom templates folder for this and other any other modules you write later so it seems it shouldn't be within your module but you can include your module from it.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Conditional pricing options and price set templates?

This forum was archived on 2017-11-26.