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) »
  • Custom field to calculate
Pages: [1]

Author Topic: Custom field to calculate  (Read 1960 times)

ginga

  • Guest
Custom field to calculate
September 18, 2008, 06:41:04 am
I am very new to CiviCRM but what I would like to do is have a field in the events tab under the profile page that would total all the hours a user has attended events such as workshops.

Is this doable?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field to calculate
September 18, 2008, 07:22:41 am

In 2.1 there is a hook for calculated custom fields that you can use: http://civicrm.org/node/356

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ginga

  • Guest
Re: Custom field to calculate
September 18, 2008, 07:39:50 am
Thanks Lobo, To which file would I implement this. I am really new to this and not really knowing where to start. I feel a little overwhelmed.

ginga

  • Guest
Re: Custom field to calculate
September 18, 2008, 07:55:34 am
now I am starting to wonder do I add it to a PHP file or is it something accomplished through the administration of CiviCRM

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field to calculate
September 18, 2008, 08:59:51 am

Yes you do. You might want to wander over to the drupal developer docs area and read about hooks. CiviCRM hooks are exactly the same as drupal hooks (and u need a module to implement these hooks etc)

There is a sample module: drupal/civitest.module.sample which shows a few simple implementations of a few hooks

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ginga

  • Guest
Re: Custom field to calculate
September 18, 2008, 11:01:50 am
Thanks Lobo, where would I find the drupal/civitest.module.sample. Is it part of the CiviCRM install or is in the Drupal docs somewhere

ginga

  • Guest
Re: Custom field to calculate
September 18, 2008, 12:00:25 pm
I found it Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom field to calculate

This forum was archived on 2017-11-26.