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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can other Locations be displayed on Contact Summary page
Pages: [1]

Author Topic: Can other Locations be displayed on Contact Summary page  (Read 1051 times)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Can other Locations be displayed on Contact Summary page
June 25, 2008, 04:31:52 pm
Hi - wondering if we can have 'work' location display on the Contact Summary page in addition to 'home' (and I note that Billing shows on our set up - not sure if this can be turned off?)
I have looked in
- site preferences
- address settings
- location types

I know it is possible to cause Custom Data to show on the Contact Summary Page. Can locations be specified to show there?

reason being we want to be able to see 'Work Address' as well as 'Home Address' particularly for the phone numbers.

Other option is suppose is via a Profile.

Pete
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Can other Locations be displayed on Contact Summary page
June 26, 2008, 09:11:44 am
hey pete

so if you have the number of locations set to > 1 in Administer CiviCRM > Global Setting > Address Settings, then they should automatically show up on the view screen IF there is info in the additional locations.

so if you edit a contact and they have a work and home location, the primary one will show up (expanded) and the second one will show up underneath. The second one won't be expanded initially, but you just have to click the + sign.

am assuming your billing location is showing up because there is some data in that location (that's what it does on mine and the demo). if you remove the data it won't show up.

if you want it to be expanded (the second location), you should probably be able to edit the template file  templates/CRM/Contact/Page/View/Tabbed.tpl

I think you need to adjust this line:
Code: [Select]
    <a href="#" onclick="hide('location_{$locationIndex}'); show('location_{$locationIndex}'); return false;"><img src="{$config->resourceBase}i/TreeMinus.gif" class="action-icon" alt="{ts}close section{/ts}"/></a>{$loc.location_type}{if $loc.name} - {$loc.name}{/if}{if $locationIndex eq 1} {ts}(primary location){/ts}{/if}

but in my quick scan i couldn't get it work right. maybe someone can give the answer on that....

a dirty way to do it is to adjust the CiviCRM core file (which is not recommended). But if you really wanted to, you would need to edit
<civicrm_root>/CRM/Contact/Page/View/Tabbed.php

and change:
Code: [Select]
  if ( array_key_exists( 'location', $defaults ) ) {
            $numLocations = count( $defaults['location'] );
            if ( $numLocations > 0 ) {
                $showHide->addShow( 'location_1' );
                $showHide->addHide( 'location_1_show' );
            }
            for ( $i = 1; $i < $numLocations; $i++ ) {
                $locationIndex = $i + 1;
                $showHide->addShow( "location_{$locationIndex}_show" );
                $showHide->addHide( "location_{$locationIndex}" );
            }
       

to:
Code: [Select]
if ( array_key_exists( 'location', $defaults ) ) {
            $numLocations = count( $defaults['location'] );
            if ( $numLocations > 0 ) {
                $showHide->addShow( 'location_1' );
               // $showHide->addHide( 'location_1_show' );
            }
            for ( $i = 1; $i < $numLocations; $i++ ) {
                $locationIndex = $i + 1;
                $showHide->addShow( "location_{$locationIndex}" );
               // $showHide->addHide( "location_{$locationIndex}" );
            }

That might not be the best way to do it, so you should look at it a little further. I just know that it's dirty but appears to work ;)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Can other Locations be displayed on Contact Summary page
June 30, 2008, 01:51:27 pm
so it does! show as an expandable location item, bizarre i didn't spot that. may have to try the hack to force expand it will let you know how we go. pete
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Can other Locations be displayed on Contact Summary page

This forum was archived on 2017-11-26.