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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Add several language custom fields
Pages: [1]

Author Topic: Add several language custom fields  (Read 1045 times)

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Add several language custom fields
March 29, 2011, 06:18:50 am
I would like to set up a custom profile to track the languages spoken and written by contacts :
spoken language 1
spoken language 2
spoken language 3
spoken language 4

written language 1
written language 2
written language 3
written language 4

There is a 'preferred language' field in communication preferences, but which only allows for a single entry.

How can I define new custom fields that use the dropdown 'languages' list ?
I can easily create new fields, but I couldn't find how to link them to the dropdown languages list.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Add several language custom fields
March 29, 2011, 06:35:05 pm
I think you'll need to implement the customFieldOptions hook and in your hook code grab the "pseudoconstant" used by the Preferred Language field.

CRM_Core_PseudoConstant::languages( )

http://wiki.civicrm.org/confluence/display/CRMDOC33/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmcustomFieldOptions
Protect your investment in CiviCRM by  becoming a Member!

ehanuise

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 2
  • CiviCRM version: 4.1.3
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.49-3
  • PHP version: 5.3.3-7+squeeze3
Re: Add several language custom fields
March 30, 2011, 01:16:55 am
Does that mean a developper is required or can this be done from within CiviCRM ?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Add several language custom fields
March 30, 2011, 02:20:56 am
Yes, you will need a developer if you don't want to re-type the name of all the languages as options.

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Add several language custom fields

This forum was archived on 2017-11-26.