To make this happen, you’ll have to change more than what you’re trying to do here. It’s not a trivial change, and you should have some PHP skills.
If you willing to do this, I recommend you to take a look at the form object that handles this template. Check the file lib/pkp/classes/submission/PKPSubmissionMetadataFormImplementation.inc.php. You will have to change the initData(), readInputData() and execute() methods so the form can:
1 - initiate your select list with keywords;
2 - read the user selected keywords;
3 - execute the form and save them as controlled vocabularies associated with the submission;
You’ll have to create a list with possible selectable keywords also. That can be done manually inside the database, with a query, or you can create an interface to allow editors controlling what’s in the list. In both cases you might want to use the controlled vocabularies structure.
Let me know if you have more questions on this and I’ll try to help.
Hi @beghelli, thank you for advice. I have successfully added new fields to submission form, which are saved in submission_settings, I just thought subjects field is handled by OMP, as it is already there and I just want to change its HTML type (representation) - text field to select field, but it seems like it’s no case.
Another try:
In PKPSubmissionMetadataFormImplementation.inc.php in initData I added to $formData array:
Keywords and subjects are actually handled by the controlled vocabularies structure. You can see that happening at line 93 of the PKPSubmissionMetadataFormImplementation.inc.php file.
I recommend you to keep using that, because other parts of the system will be able to track down your subjects and keywords (search for example) if you do so.
But, if you’re willing to save the new subjects (as you call) into the submission settings page, you will have to add the setting name into the getLocaleFieldNames() method, in classes/monograph/MonographDAO.inc.php file.
I replicated what I did with other field I save in submission_settings, and also listened to you (added setting name in getLocaleFieldNames method in MonographDAO), but it is not saved again. The only difference is in template file. For first data I used
and everything is fine with it - it is saved in submission settings, and for newSubjects I used code in previous post. I am guessing that plain HTML elements are not handled properly and maybe I should use fbvElement of type “select”. Could this be the case? Do you know syntax for that, as I failed to find it though I am searhing for it for 3 days :S
The HTML should work. I think that your list is not a localized setting. I got confused and that’s why I said to you to add the setting name into the getLocaleFieldNames(), but for a setting that’s not localized, you should use getAdditionalFieldNames() instead.