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) »
  • Help me get started: Small adjustment address page
Pages: [1]

Author Topic: Help me get started: Small adjustment address page  (Read 880 times)

Bert

  • Guest
Help me get started: Small adjustment address page
November 10, 2010, 05:37:22 am
Hello,

I want to change the address (sub)page (for Belgian post system!) from this

[ City ]    [ Zip ]

to

[ Zip ] [ Drop down of cities depending on zip ]

In words: First the zip code is filled in, then, depending on that code a (short list of) cities is displayed in a drop down and with a click the corresponding city is selected.

Actually, I can use any type of advice here. I am an experienced (database) programmer but new to CiviCRM as well as PHP (tutorial helped here). I have done some reading and looked in the code but I am somewhat clueless where to start. I *think* I should write a "hook" to do this, but I could not find any appropriate page to find more about that.

Help is welcome in any form like:
  • General advice (is a hook the way to go?)
  • Links of tutorials or help-files about hooks, or similar adjustments of CiviCRM
  • What are all the files that I might need to edit (I came as far as ..\CRM\Contact\form\edit\address.php)
  • Ready-to-use code - yes, I would accept that too ;)

Thanks, Bert.


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: Help me get started: Small adjustment address page
November 10, 2010, 06:26:38 am

Here is a blog post on converting a 'select' field to a 'text' field:

http://www.twomiceandastrawberry.com/blog/46/civicrm-individual-prefix-field-as-auto-complete-text-input

u'll need to do the reverse

for the zip -> city mapping and restriction, might be better to use javascript at the template page and have some zip/city info that you can use to eliminate cities from the select option. customizing templates is here:

http://wiki.civicrm.org/confluence/display/CRMDOC32/Customize+Built-in,+Profile,+Contribution+and+Event+Registration+Screens

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

Bert

  • Guest
Re: Help me get started: Small adjustment address page
November 12, 2010, 05:01:20 am
Thanks lobo,

The blog link is a good start. While I learn more questions pop up:
1. I can not seem to find "tmcivicrm.module" somewhere in the CiviCRM files, which makes me think it should be created from scratch?! But where?
2. Is there more documentation on hook_civicrm_buildForm() ? I only found a few lines...
3. Using javascript could be a good idea, however, database access will be needed (to find which cities have the given zipcode). Should I look into Ajax to do this?

The second link you gave me might be good for later (or, put differently, I did not really understood what I was reading there)

Regards, Bert.




Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Help me get started: Small adjustment address page

This forum was archived on 2017-11-26.