Currently, vtiger 503 displays names as: lastname firstname.
A better option might be:
lastname, firstname
(for double names or foreign names, it is clearer where the firstname begins).
We preferred the order
firstname lastname.
If anybody is interested, to get this, change: \vtigercrm (root)\include\utils\Commanutil.php
The comment (//) is the vtiger setting, the following line the replacement
/**
* Function to get the Contact Name when a contact id is given
* Takes the input as $contact_id - contact id
* returns the Contact Name in string format.
*/
function getContactName($contact_id)
{
global $log;
$log->debug("Entering getContactName(".$contact_id.") method ...");
$log->info("in getContactName ".$contact_id);
global $adb;
$contact_name = '';
if($contact_id != '')
{
$sql = "select * from vtiger_contactdetails where contactid=".$contact_id;
$result = $adb->query($sql);
$firstname = $adb->query_result($result,0,"firstname");
$lastname = $adb->query_result($result,0,"lastname");
// $contact_name = $lastname.' '.$firstname;
$contact_name = $firstname.' '.$lastname;
}
$log->debug("Exiting getContactName method ...");
return $contact_name;
}
maybe this helps someone,
Klaus <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>
Comments
i have tried to fix it by my self but i couldn't find out where the function getcontactname is.
thank you.
for example,
smith, joe
smith, sally
smith, zoe
right now it only puts lastname in alphabetical order.
lastname should be ascending (and it is) and then firstname should be ascending.
do you know how to make this change?
<!-- m --><a class="postlink" href="http://forums.vtiger.com/viewtopic.php?t=20664">http://forums.vtiger.com/viewtopic.php?t=20664</a><!-- m -->
i was wondering if you can tell me how to chane the entire layout, not only the firstname & lastname.
or when you load a lead into a campaign is possible to have it displayed the way i want with extra info?
thanks
after refering to the above posts i was still not able to get it to work for me however i made a change or 3 and got it working <!-- s:d --><img src="{smilies_path}/icon_biggrin.gif" alt=":d" title="very happy" /><!-- s:d -->
this is in version 5.2.1.
do the following in \include\utils\commonutils.php (you need to swop arround the code in 3 places.)
firstly located around line 629
default code (take note of $lastname; and ' '.$firstname; possitions below)
$contact_name = $lastname;
// asha: check added for ticket 4788
if (getfieldvisibilitypermission("contacts", $current_user->id,'firstname') == '0') {
$contact_name .= ' '.$firstname;
my change ( simply swopped around)
$contact_name = $firstname;
// asha: check added for ticket 4788
if (getfieldvisibilitypermission("contacts", $current_user->id,'firstname') == '0') {
$contact_name .= ' '.$lastname;
you will need to change it on line 659 ("leads") and line 687 ("module")
hope this helps someone.
thanks for the great product guys.
after refering to the above posts i was still not able to get it to work for me however i made a change or 3 and got it working <!-- s:d --><img src="{smilies_path}/icon_biggrin.gif" alt=":d" title="very happy" /><!-- s:d -->
this is in version 5.2.1.
do the following in \include\utils\commonutils.php (you need to swop arround the code in 3 places.)
firstly located around line 629
default code (take note of $lastname; and ' '.$firstname; possitions below)
$contact_name = $lastname;
// asha: check added for ticket 4788
if (getfieldvisibilitypermission("contacts", $current_user->id,'firstname') == '0') {
$contact_name .= ' '.$firstname;
my change ( simply swopped around)
$contact_name = $firstname;
// asha: check added for ticket 4788
if (getfieldvisibilitypermission("contacts", $current_user->id,'firstname') == '0') {
$contact_name .= ' '.$lastname;
you will need to change it on line 659 ("leads") and line 687 ("module")
hope this helps someone.
thanks for the great product guys.