vtiger Forum Index vtiger
The Honest Open Source CRM
 

Patch to enable Salutation field in Reports
Click here to go to the original topic

 
       vtiger Forum Index -> Code Contributions - 4.x
Previous topic :: Next topic  
Author Message
jimbo22



Joined: 23 Nov 2005
Posts: 17
Location: UK

Posted: Mon Jun 19, 2006 9:16 am    Post subject: Patch to enable Salutation field in Reports  

Hello,

I created a workaround that allows the Salutation field to be used in reports. It works with reports using the Contacts database and should also work with Leads database, though as I don't use Leads I can't test this.

As the language file does not seem to contain Salutation lookup, I've hard coded the field name in to the patch. Also I've abbreviated the field name to 'Sal' so that the field is not too wide in the report.

To add the patch (in Version 4.2.3) edit the file \modules\reports\reportcolumns.php (after taking a backup)!:



In the function getPrimaryColumnsHTML($module) insert the change shown in red:

if(isset($ogReport->pri_module_columnslist[$module][$key]))

{
// jws added jun06 to allow salutation field in reports when using contacts or leads as primary module

if ($key=="Information" && $module=="Contacts")
{
$shtml .= "<option value=\"contactdetails:salutation:Sal:salutation:V\">Sal</option>";
}
if ($key=="Information" && $module=="Leads")
{
$shtml .= "<option value=\"leaddetails:salutation:Sal:salutation:V\">Sal</option>";
}
//jws end of change

foreach($ogReport->pri_module_columnslist[$module][$key] as $field=>$fieldlabel)


{

Then in the function getSecondaryColumnsHTML($module)
insert the change shown in red:

if(isset($ogReport->sec_module_columnslist[$secmodule[$i]][$key]))
{
// jws added jun06 to allow salutation field in reports when using contacts as secondary module
if ($key=="Information" && $secmodule[$i]=="Contacts")
{
$shtml .= "<option value=\"contactdetails:salutation:Sal:salutation:V\">Sal</option>";
}
// jws end of change

foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel)
{


Hope this helps,

Jim
Back to top  
 
       vtiger Forum Index -> Code Contributions - 4.x
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group