OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



How to make salutation field a dropdown list

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

How to make salutation field a dropdown list

Postby newbies » Sat Sep 14, 2013 11:23 am

I wish to make the current text filed for salutation a dropdown list so that a predefined value must be selected. Currently, it can be left blank, in that case, prepared emails would often greet the recipient with ones full name which is very impolite.

Can anyone shed light on how to modify the code 1) to make a dropdown list for salutation, 2) to just use last name in prepared emails?

Thank you in advance.
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: How to make salutation field a dropdown list

Postby asmecher » Mon Sep 16, 2013 11:37 am

Hi newbies,

The easiest of the two options is probably #2. See the implementation of the getFullName() function in lib/pkp/classes/user/PKPUser.inc.php and lib/pkp/classes/submission/PKPAuthor.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: How to make salutation field a dropdown list

Postby newbies » Mon Sep 16, 2013 3:58 pm

Thanks Alec!

Indeed, that is very easy to implement. If I change the getFullName function to just pull out last name, will it has an effect on other places where full name is necessary, since I only want to modify the name format in emails.
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: How to make salutation field a dropdown list

Postby asmecher » Mon Sep 16, 2013 4:04 pm

Hi newbies,

That will affect everywhere a full name is used. If you want to impact only specific cases, you'll have to track those down -- e.g. for the reviewer assignment notification email, see classes/submission/sectionEditor/SectionEditorAction.inc.php in the notifyReviewer function:
Code: Select all
$paramArray = array(
    'reviewerName' => $reviewer->getFullName(),
    ...
);
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: How to make salutation field a dropdown list

Postby newbies » Mon Sep 16, 2013 6:17 pm

Thank you.

Another question: I want to edit all email templates directly on the template file. I guessed that the file to be edited is locale/en_US/emailTemplates.xml. After I have edited the file and saved it, I found the changes do not show up in web interface ->Journal manager ->prepared emails. Am I doing right?
newbies
 
Posts: 87
Joined: Sat Feb 23, 2013 9:15 pm

Re: How to make salutation field a dropdown list

Postby asmecher » Tue Sep 17, 2013 2:54 pm

Hi newbies,

See http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=8849#p34407.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests