You are on page 1of 3

More Create Blog Sign In

Your preferred Vtiger cookbook

Sunday, 21 October 2012

Extending and customize Organization details


In this tutorial I would like to explain you how you can simply add some fields in the organization
detail module.

Remember that this part of VTiger CRM does not allow custom field features but you need to
modify database table and source code related.

Suppose we want add the taxcode field.

First of all you need to alter table vtiger_organizationdetails and add field taxcode like this
Preferred link
sample:
• Vtiger Official site
alter table vtiger_organizationdetails add column `taxcode`
• The Official Vtiger CRM Blog
VARCHAR(50) NULL DEFAULT NULL
• Vtiger Wiki

Search This Blog


Edit file /modules/Settings/OrganizationConfig.php and add this piece of code
Search

Blog Archive
$organization_taxcode = decode_html($adb-
>query_result($result,0,'taxcode')); 2012 (4)
November (3)

Some row below October (1)


Extending and customize Organization
details
if (isset($organization_taxcode))
$smarty-
>assign("ORGANIZATIONTAXCODE",$organization_taxcode); Popular Posts

Customize Vtiger footer


If you want customize Vtiger footer open
index.php and search for the following lines
Edit file /modules/Settings/EditCompanyDetails.php
of code echo "<script language = 'Java...

$organization_taxcode = decode_html($adb- Extending and customize Organization


>query_result($result,0,'taxcode')); details
In this tutorial I would like to explain you
how you can simply add some fields in the
Some row below organization detail module. Remember that
this part...
if (isset($organization_taxcode))
Configure incoming Server Config With
$smarty->assign("ORGANIZATIONTAXCODE",$organization_taxcode);
Gmail (IMAP)
Use this configuration for getting incoming
mail from your google[apps] account. Mail
Edit file /modules/Settings/SaveCompany.php Server: imap.gmail.com Username:
user@do...

// get from request Change Page Title


$organization_taxcode = $_REQUEST['organization_taxcode']; In this article you can understand how
Edit and add piece of code in this insert query change page title. For customizing the page
//insert data title you have to change the value of the
string "...
$organizationId = $this->db->getUniqueID('vtiger_organizationdetails');
$sql="insert into
vtiger_organizationdetails(organization_id,organizationname, address, Please, support the
city, state, code, country, phone, fax, website, taxcode) vTiger Cookbook
blog by clicking on
values(?,?,?,?,?,?,?,?,?,?,?)"; our sponsors ad!
$params = array($organizationId, $organization_name,
$organization_address, $organization_city, $organization_state,
$organization_code, $organization_country, $organization_phone,
$organization_fax, $organization_website, $organization_taxcode);

//Handling update
else
{
$sql="update vtiger_organizationdetails set organizationname = ?,
address = ?, city = ?, state = ?, code = ?, country = ?, phone = ?,
fax = ?, website = ?, taxcode = ? where organizationname = ?";
$params = array($organization_name, $organization_address,
$organization_city, $organization_state, $organization_code,
$organization_country, $organization_phone, $organization_fax,
$organization_website, $organization_taxcode, $org_name);
}

5)vtigercrm/modules/Settings/add2db.php

if($saveflag=="true")
{
...
$organization_logo=from_html($_REQUEST['organization_logo']);
$organization_taxcode=from_html($_REQUEST['organization_taxcode']);
...

if($org_name=='')
{
$organizationId = $this->db->getUniqueID('vtiger_organizationdetails');
$sql="INSERT INTO vtiger_organizationdetails
(organization_id,organizationname, address, city,
state, code, country, phone, fax, website, logoname, taxcode) values
(?,?,?,?,?,?,?,?,?,?,?)";
$params = array($organizationId,$organization_name,
$organization_address, $organization_city, $organization_state,
$organization_code,
$organization_country, $organization_phone,
$organization_fax, $organization_website, $organization_logoname,
$taxcode);
}

....
Some row below

$sql = "UPDATE vtiger_organizationdetails


SET organizationname = ?, address = ?, city = ?, state
= ?, code = ?, country = ?,
phone = ?, fax = ?, website = ?, logoname = ?,
taxcode=? WHERE organizationname = ?";
$params = array($organization_name, $organization_address,
$organization_city, $organization_state, $organization_code,
$organization_country, $organization_phone,
$organization_fax, $organization_website,
decode_html($organization_logoname), $taxcode, $org_name);
}

Edit template /Smarty/templates/Settings/CompanyInfo.tpl

Add this line of code for inserting this new field


<tr>
<td width="20%" class="small cellLabel"><strong>{$MOD.LBL_ORGANIZATION_TAXCODE}
</strong></td>
<td width="80%" class="small cellText">{$ORGANIZATIONTAXCODE}</td>
</tr>

Edit template /Smarty/templates/Settings/EditCompanyInfo.tpl

<tr>
<td class="small cellLabel"><strong>{$MOD.LBL_ORGANIZATION_TAXCODE}
</strong></td>
<td class="small cellText">
<input type="text" name="organization_taxcode"
class="detailedViewTextBox small" value="{$ORGANIZATIONTAXCODE}">
</td>
</tr>

Add custom language translation in file vtigercrm/modules/Settings/language/XXXXXXX

'LBL_ORGANIZATION_TAXCODE' => 'Tax code',

Setting header report


/include/InventoryPDFController.php

find function buildHeaderModelColumnLeft


and add this line

$modelColumnLeft = array(
'logo' => "test/logo/".$resultrow['logoname'],
'summary' =>
decode_html($resultrow['organizationname']) .
"\n".getTranslatedString("LBL_ORGANIZATION_TAXCODE", "Settings")." ".
$resultrow['taxcode']
,'content' => $this->joinValues($addressValues, ' ').
$this->joinValues($additionalCompanyInfo, ' ')
);

Posted by estevan at 13:54

1 comment:

anandan r 6 January 2014 at 01:15

dear sir please help me how create google adsense blog and how to add adds

Reply

Enter your comment...

Comment as: Google Account

Publish Preview

Newer Post Home

Subscribe to: Post Comments (Atom)

Simple theme. Powered by Blogger.

You might also like