CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Change the order of first and last name
Pages: [1]

Author Topic: Change the order of first and last name  (Read 4859 times)

Pal ur

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
Change the order of first and last name
February 27, 2009, 12:45:23 am
Hi,

I'm quite new in CiviCRM, but I have to use is for a project. I like it very much, but I have some questions. First of all is, how or where to  change something to display the user's name in the order as we use it in Hungarian: the "Last name" is the first, and "First name" is the last. (Some .tpl files I found, but in some of files there are only {$displayName}...)

Thank you for some help.

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Change the order of first and last name
February 27, 2009, 02:00:44 am
hi

Quote
how or where to  change something to display the user's name in the order as we use it in Hungarian: the "Last name" is the first, and "First name" is the last.

IMO there is no such setting available which will change the sequence for $displayName
If you are interesting only in last name and first name,  You might want to take a look for $sortName ( ie civicrm_contact.sort_name )

To change name sequence for display name  you need to change in core code
go to CRM/Contact/BAO/Individual.php line around 149
Code: [Select]
$display_name = trim( "$prefix $firstName $middleName $lastName $suffix" );
Here you can give your name sequence which will reflect for display name when you create/edit contact record.

kiran
You Are Designed To Choose... Defined By Choice.

Pal ur

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
Re: Change the order of first and last name
February 27, 2009, 02:31:43 am
Quote

To change name sequence for display name  you need to change in core code
go to CRM/Contact/BAO/Individual.php line around 149
Code: [Select]
$display_name = trim( "$prefix $firstName $middleName $lastName $suffix" );
Here you can give your name sequence which will reflect for display name when you create/edit contact record.


Thank you, that's I looking for. Thank you for your help!

-----------------

A bit later I've tried out, but it seems not to work on CiviCRM 2.2 beta 2. Eg. "Recently Viewed" is not OK, search result page is not OK... So I'm looking for a solution...
« Last Edit: February 27, 2009, 05:25:46 am by pal_ur »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Change the order of first and last name
February 27, 2009, 09:54:15 am

you will need to run an update query on the DB to store all display_names in the new format. All new contacts will store it in the new format since u made the code change

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Change the order of first and last name

This forum was archived on 2017-11-26.