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) »
  • supplemental_address_3 addition
Pages: [1]

Author Topic: supplemental_address_3 addition  (Read 3500 times)

brazeej

  • Guest
supplemental_address_3 addition
March 22, 2008, 02:00:53 pm
Can anyone out there walk me through exposing the supplemental_address_3 field?  I need a fourth address line, and when I found that it exists in the database, I was very happy.  However, it's still not showing up, even after I've added it in as many places as I could find.

I've looked all over, and found a mention from lobo that it's fairly easy (http://forum.joomla.org/viewtopic.php?f=294&t=77752).  Any help will be appreciated!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: supplemental_address_3 addition
March 23, 2008, 10:48:09 am
I'm pretty sure you'll need to hack a few files in the codebase to make this happen. Adding it to the form would involve adding it to the elements array in CRM/Contact/Form/Address.php AND creating a copy of templates/CRM/Contact/Form/Address/supplemental_address_1.tpl AS templates/CRM/Contact/Form/Address/supplemental_address_2.tpl and editing it to reference supplemental_address_3.

To include it in the Contact Summary, you'll need to edit CRM/Core/BAO/Address.php addDisplay() function. I think that will do it, but you may need to make other changes as I haven't tried that.

Protect your investment in CiviCRM by  becoming a Member!

brazeej

  • Guest
Re: supplemental_address_3 addition
March 23, 2008, 09:32:19 pm
Mr. Greenberg, thanks for your response.  I've given those suggestions a shot, and supplemental_address_3 still doesn't show up.  I also did a site-wide find for "supplemental_address", and added 'supplemental_address_3' to any file where there was already a supplemental_address_1 and 2.  Still no dice.  I'm not sure why that's not working, as it seems like any file where the address fields are referenced have been altered to include supplemental_address_3 - any other suggestions?  Thanks again.

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: supplemental_address_3 addition
March 23, 2008, 10:43:26 pm

can u give us the following information:

1. what url are you trying to add this to (for now, lets just focus on fixing one url)

2. what php files did you change

3. what tpl files did you change

4. did you check the mysql query log and see if we retrieve supplemental_address_3 from the db?

thanx

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

brazeej

  • Guest
Re: supplemental_address_3 addition
March 25, 2008, 12:38:44 am
Hello Mr. Lobo, thanks for your response.  Below is further information.  Hopefully this will be helpful...

1. http://www.decadentphilistine.com/crm/

2. api/Location.php, api/utils.php, v2/Location.php, Preferences/Address.php, BAO/Query.php, Form/Address.php, View/Vcard.php, CRM/Contribute/Form/Task/Export.php, Core/Form.php, BAO/Address.php, BAO/Mapping.php, BAO/Preferences.php, BAO/UFGroup.php, BAO/Event.php, CRM/Event/Form/Task/Export.php, CRM/Member/Form/Task/Export.php, Form/Field.php, Form/Preview.php, Utils/Address.php
(supplemental_address_3 was already in DAO/Address.php, but edited beginning with line 374 to mimic code for supplemental_address_2)

3. Added supplemental_address_3.tpl in sites/all/modules/civicrm/templates/CRM/contact/form/address/ and modified code to reflect addt'l address 3.

4. I've got the Trace module running off and on within Drupal, set to capture  SELECT, INSERT, UPDATE, DELETE, and "Other" queries.  No mention of any of the supplemental addresses - just street_address.  Is there a better way to watch for retrieval?

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: supplemental_address_3 addition
March 25, 2008, 10:47:54 am

1. i recommend you focus on working on one url, like:

http://drupal.demo.civicrm.org/civicrm/contact/add?reset=1&action=update&cid=105
http://drupal.demo.civicrm.org/civicrm/contact/view?reset=1&cid=105

The view url might be easier to begin with, manually tweak the database and add a supp_..._3 value

2. enable mysql query logging to see what queries are being issued. The drupal Trace module will not show civicrm queries

address involves a fair amount of formatting and preferences (as u've discovered), so it is indeed a bit complicated to get this working

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

brazeej

  • Guest
Re: supplemental_address_3 addition
April 03, 2008, 04:03:40 pm
Ok, I had to put this on a shelf for a little while, as it was driving me crazy.  However, a friend looked into it, and realized there was a record missing in the civicrm_option_value table.  Although supplemental_address_3 exists in the civicrm_address table, the code is looking for it in the civicrm_option_value table.  This table is also a place to modify the labels for the address fields (which was also tripping me up). 

Here's the sql command to insert the Address 3 record into the civicrm_option_value table:

insert into civicrm_option_value (option_group_id,label,value,weight,is_active) values (19,'Address 3', 12,12,1)

So, it seems like doing everything already discussed in this thread, plus adding the right record to the right table will work.  At least it did for me.  Thanks for the ideas!

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

This forum was archived on 2017-11-26.