[Vtigercrm-commits] [vtiger-commits] r5774 - in /vtigercrm/branches/4.2: ./ include/ modules/Users/ modules/Users/language/ schema/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 9 01:23:21 EDT 2006


Author: allanbush
Date: Mon May  8 23:22:59 2006
New Revision: 5774

Log:
Turns address information into a link to google maps as per http://forums.vtiger.com/viewtopic.php?t=3143

This is user configurable to either give directions from the users address, the company address or just give the location of the target address.

I'm uncertain how this handles international location, we may wish to make the google url configurable at least (maps.google.com vs. maps.google.ca, etc).

Refs #750.

Added:
    vtigercrm/branches/4.2/mapme.php
Modified:
    vtigercrm/branches/4.2/include/utils.php
    vtigercrm/branches/4.2/modules/Users/DetailView.html
    vtigercrm/branches/4.2/modules/Users/DetailView.php
    vtigercrm/branches/4.2/modules/Users/EditView.html
    vtigercrm/branches/4.2/modules/Users/EditView.php
    vtigercrm/branches/4.2/modules/Users/User.php
    vtigercrm/branches/4.2/modules/Users/language/en_us.lang.php
    vtigercrm/branches/4.2/schema/DatabaseSchema.xml

Modified: vtigercrm/branches/4.2/include/utils.php
==============================================================================
--- vtigercrm/branches/4.2/include/utils.php (original)
+++ vtigercrm/branches/4.2/include/utils.php Mon May  8 23:22:59 2006
@@ -1768,7 +1768,7 @@
 	{
 		$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?id='.$col_fields['record_id'].'" 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)
 	{

Modified: vtigercrm/branches/4.2/modules/Users/DetailView.html
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/DetailView.html (original)
+++ vtigercrm/branches/4.2/modules/Users/DetailView.html Mon May  8 23:22:59 2006
@@ -123,6 +123,12 @@
 	<td width="20%" valign="top" class="dataLabel">{MOD.LBL_USER_ROLE} :</td>
 	<td width="30%" valign="top" class="dataField">{ROLEASSIGNED}</td>
 	</tr><tr>
+	<td width="20%" valign="top" class="dataLabel">{MOD.LBL_GROUP_NAME}:</td>
+	<td width="30%" valign="top" class="dataField">{GROUPASSIGNED}</td>
+	<td width="20%" class="dataLabel" valign="top">{MOD.LBL_MAP_START}:</td>
+        <td width="30%" class="dataField">{MAP_START}</td>
+	</tr>
+<tr>
 	<td width="20%" valign="top" class="dataLabel">{MOD.LBL_ADDRESS}</td>
 	<td width="30%" valign="top"  class="dataField">{ADDRESS_STREET}<br>
 	{ADDRESS_CITY} {ADDRESS_STATE}&nbsp;&nbsp;{ADDRESS_POSTALCODE}<br>
@@ -130,10 +136,6 @@
 	<td class="dataLabel" valign="top">{MOD.LBL_SIGNATURE}:</td>
         <td class="dataField">{SIGNATURE}</td>
 	</tr><tr>
-<tr>
-	<td width="20%" valign="top" class="dataLabel">{MOD.LBL_GROUP_NAME}:</td>
-	<td width="30%" valign="top" class="dataField">{GROUPASSIGNED}</td>
-	</tr>
 
 	<td width="20%" valign="top" valign="top" class="dataLabel">{MOD.LBL_NOTES}:</td>
 	<td colspan="3" class="dataField">{DESCRIPTION}</td>

Modified: vtigercrm/branches/4.2/modules/Users/DetailView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/DetailView.php (original)
+++ vtigercrm/branches/4.2/modules/Users/DetailView.php Mon May  8 23:22:59 2006
@@ -168,6 +168,7 @@
 $xtpl->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
 $xtpl->assign("ADDRESS_COUNTRY", $focus->address_country);
 $xtpl->assign("SIGNATURE", nl2br($focus->signature));
+$xtpl->assign("MAP_START", nl2br($focus->map_source));
 $xtpl->parse("user_info");
 $xtpl->out("user_info");
 

Modified: vtigercrm/branches/4.2/modules/Users/EditView.html
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/EditView.html (original)
+++ vtigercrm/branches/4.2/modules/Users/EditView.html Mon May  8 23:22:59 2006
@@ -162,6 +162,8 @@
 	</tr><tr>
 	<td width="20%" class="dataLabel">{MOD.LBL_COUNTRY}</td>
 	<td width="30%"><input name='address_country' tabindex='8' size='10' maxlength='20' value='{ADDRESS_COUNTRY}'></td>
+	<td width="20%" class="dataLabel">{MOD.LBL_MAP_START}:</td>
+	<td width="30%">{MAP_START_OPTIONS}</td>
 </tr></table>
 </td></tr></table>
 <table width="100%" cellpadding="2" cellspacing="0" border="0"><tr>

Modified: vtigercrm/branches/4.2/modules/Users/EditView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/EditView.php (original)
+++ vtigercrm/branches/4.2/modules/Users/EditView.php Mon May  8 23:22:59 2006
@@ -98,6 +98,15 @@
 $xtpl->assign("ADDRESS_COUNTRY", $focus->address_country);
 $xtpl->assign("SIGNATURE", $focus->signature);
 $xtpl->assign("DESCRIPTION", $focus->description);
+
+$map_options = array('--None--', 'Home', 'Work');
+$map_start_options = '<select name="map_source">';
+foreach($map_options as $option) {
+	$selected = $focus->map_source == $option ? 'selected="selected"' : '';
+	$map_start_options .= '<option value="'.$option.'" '.$selected.'>'.$option.'</option>';
+}
+$map_start_options .= '</select>';
+$xtpl->assign("MAP_START_OPTIONS", $map_start_options);
 
 $DATE_FORMAT_SELECT_OPTION = '<select name="date_format">';
 		

Modified: vtigercrm/branches/4.2/modules/Users/User.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/User.php (original)
+++ vtigercrm/branches/4.2/modules/Users/User.php Mon May  8 23:22:59 2006
@@ -94,6 +94,7 @@
 		,"email1"
 		,"email2"
 		,"signature"
+		,"map_source"
 		,"yahoo_id"
 		,"address_street"
 		,"address_city"

Modified: vtigercrm/branches/4.2/modules/Users/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/language/en_us.lang.php (original)
+++ vtigercrm/branches/4.2/modules/Users/language/en_us.lang.php Mon May  8 23:22:59 2006
@@ -287,6 +287,9 @@
 
 //Added for patch2
 'LBL_FILE_INFORMATION'=>'File Information',
+
+
+'LBL_MAP_START'=>'Map Start',
 );
 
 ?>

Modified: vtigercrm/branches/4.2/schema/DatabaseSchema.xml
==============================================================================
--- vtigercrm/branches/4.2/schema/DatabaseSchema.xml (original)
+++ vtigercrm/branches/4.2/schema/DatabaseSchema.xml Mon May  8 23:22:59 2006
@@ -49,6 +49,7 @@
 		<field name="workdays" type="C" size="30" />
 		<field name="weekstart" type="I" size="11" />
 		<field name="date_format" type="C" size="30" />
+		<field name="map_source" type="C" size="10" />
 		<field name="deleted" type="I" size="1">
 			<notnull />
 			<default value="0" />





More information about the vtigercrm-commits mailing list