OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Remove "Gender" from registration and profile forms

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

Moderators: jmacgreg, michael, asmecher

Forum rules
What to do if you have a technical problem with OMP:

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 OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Remove "Gender" from registration and profile forms

Postby rootl » Fri Mar 07, 2014 4:06 pm

Greetings,

I have successfully upgraded a dev server instance of OMP to version 1.1. This includes all our template, class file, and individual press style modifications. (On a Windows server, which has its additional challenges :)

Request:

What is needed to remove "Gender" field from OMP 1.1 user registration and user profile forms?

I successfully removed this field with version 1.0 for multiple presses under our instance of OMP . Among many other customizations in our 1.0 instance, I made some registration and profile fields required, made some required fields optional, changed order of countries, and created separate required role groups and optional role groups.

However, there are many file, router, and Smarty template changes with version 1.1 regarding user registration and profile related files. so I am hesitant to 'jump into the code' this time.

Thank you.
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am

Re: Remove "Gender" from registration and profile forms

Postby asmecher » Fri Mar 07, 2014 4:44 pm

Hi rootl,

As you'll notice, a large percentage of the OMP 1.1 code has moved around compared with OMP 1.0. In many cases it's just been moved into a subdirectory of lib/pkp; this reflects the ongoing alignment of OMP 1.x with what will become OJS 3.x. This will unfortunately make migration of modifications from 1.0 to 1.1 a little more painful than normal but this should be a one-time situation. Code will continue to live where it currently sits for the future.

The various user forms have been reconciled -- the Manager's "create user" form, the profile form, the registration form, etc. If you're OK with hiding this field from all of those forms, you can comment out the part of lib/pkp/templates/common/userDetails.tpl that deals with the "gender" field.

Glad to hear you've made it through the upgrade!

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

Additional Form Field Validation Re: Remove "Gender" from fo

Postby rootl » Tue Mar 11, 2014 5:16 am

Thank you very much! I was able to comment out some other fields, create new fieldsets, and rearrange certain fields for our needs.

Next request: How to add form field required validation for the Affiliation and Phone fields. I was able to do this in 1.0.

In 1.1, so far I have gotten as far as having the "required' span for the red asterisk show under the description for both fields.
I worked with lib/pkp/templates/common/userDetails.tpl and lib/pkp/templates/user/register.tpl

I need to have "This field is required" validation message appear for those fields upon submission if a user does not fill them out.

I can help document this as well. There may be other OMP users who want to customize registration and profile forms.

Thanks!
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am

Re: Remove "Gender" from registration and profile forms

Postby asmecher » Tue Mar 11, 2014 8:24 am

Hi rootl,

The form validation needs to go into the form class; the required="true" attributes in the templates are informational. Have a look at the calls to $this->addCheck(...) in lib/pkp/classes/user/form/PKPRegistrationForm.inc.php, lib/pkp/classes/user/form/PKPProfileForm.inc.php, and lib/pkp/controllers/grid/settings/user/form/UserDetailsForm.inc.php.

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

Re: Remove "Gender" from registration and profile forms

Postby rootl » Tue Mar 11, 2014 8:57 am

Excellent. Thank you!

That validation check code was exactly I was looking for. I found it in version 1.0 ProfileForm.inc.php and RegistrationForm.inc.php but was not able to find it in 1.1 despite several "find in files" searches. I also went through the changelogs but apparently missed this.

Thanks again.
rootl
 
Posts: 62
Joined: Wed Feb 20, 2013 7:17 am


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest