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) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to change default greeting in profile
Pages: [1]

Author Topic: how to change default greeting in profile  (Read 1742 times)

mtndan

  • Guest
how to change default greeting in profile
July 13, 2007, 02:42:20 pm
Hi folks,

How would we change the default greeting (for all contacts, and new contacts) to "dear first name" instead of "dear firstname lastname"?

Thanks!
Dan

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: how to change default greeting in profile
July 13, 2007, 08:45:47 pm
Dan,

Unfortunately, this is not possible without hacking the code and the database at the moment. You might want to file an issue for CiviCRM 2.0 in our issue tracker (http://issues.civicrm.org/), since it's a thing that would be good to have fixed for next version.

Thx,
m

P.S. If you are brave and want to use a dirty hack (definitely not recommended), you can go to <civicrm_home>/CRM/Contact/Form/Individual.php and change line 79 from

Code: [Select]
$form->addElement('select', 'greeting_type', ts('Greeting'), CRM_Core_SelectValues::greeting());

to

Code: [Select]
$form->addElement('select', 'greeting_type', ts('Greeting'), CRM_Core_SelectValues::greeting(), 'Informal');

This will work only for the newly created contacts added through new contact form. It won't work for any other place where Individual is created (like quick add block in Drupal for example, or import).

To update greeting_type for existing contacts, you need to perform below on your database:

Code: [Select]
update civicrm_individual set greeting_type = 'Informal';

It will change the greeting type for all the contacts of type Individual to "Dear [name]".

However, as said - although relatively simple, this is a quick, dirty and inconsistent hack - it can solve part of your problems, but can also create additional ones, so if you can avoid applying it, please do.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

mtndan

  • Guest
Re: how to change default greeting in profile
July 13, 2007, 08:55:37 pm
Thank you very much! I will file a request for the version 2.0

mtndan

  • Guest
Re: how to change default greeting in profile
July 13, 2007, 09:05:31 pm
Hello once more.

So, the query worked fine.  But hacking individual.php doesn't seem to have had any effect. I am trying to add a contact via "new individual".

Thanks

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: how to change default greeting in profile
July 13, 2007, 11:24:56 pm
Ahhh, sorry about that. I wanted to help quickly and didn't think enough. :(

The fix for default value in new contact form is much more complicated than what I proposed, it might involve modifying more than one file. I really don't recommend introducing it, so I'll skip posting it here, especially that I'm not able to check all the implications of such change (the piece of code handling it is shared between adding and editing contact, so it might break things in unexpected places if changes don't get well tested).

Hope the query that I proposed will be enough to help you until this feature is implemented correctly.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • how to change default greeting in profile

This forum was archived on 2017-11-26.