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
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

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: 84
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: 8869
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: 84
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: 8869
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: 84
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: 8869
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 8 guests