You are viewing the PKP Support Forum | PKP Home Wiki

Require authors to submit a file

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.

Require authors to submit a file

Postby bdm » Tue Jan 21, 2014 10:10 pm

Version 2.3.6.

Our submission step 2 has just an upload field with "Browse.." and "Upload" buttons, then the "Save and Continue" and "Cancel" buttons as usual.

What we would like to do is force authors to submit a file at this step before going on to the next step. All too often they select a file then forget to click "Upload".

Is there a nice way to do that?

If checking that a file is actually uploaded is too hard, can we at least require that the "Upload" button is clicked before "Save and Continue" works?

Posts: 20
Joined: Sun Oct 11, 2009 10:30 pm

Re: Require authors to submit a file

Postby asmecher » Wed Jan 22, 2014 5:48 am

Hi Brendan,

Have a look at templates/author/submit/step2.tpl (the step 2 template for the author submission process). The submit button code looks like this (with a little extra formatting for readability)...
Code: Select all
    <input type="submit"{if !$submissionFile} onclick="return confirm('{translate|escape:"jsparam" key="author.submit.noSubmissionConfirm"}')"{/if} value="{translate key="common.saveAndContinue"}" class="button defaultButton" />
    <input type="button" value="{translate key="common.cancel"}" class="button" onclick="confirmAction('{url page="author"}', '{translate|escape:"jsparam" key="author.submit.cancelSubmission"}')" />
The onclick="..." pops up a confirmation modal checking if the user is sure they want to submit without uploading. It's still possible to continue, but authors need to confirm.

If you want to force an upload, you can remove the onclick="..." entirely and disable the "submit" button if no file is uploaded, e.g. for that element...
Code: Select all
    <input type="submit"{if !$submissionFile} disabled="disabled"{/if} value="{translate key="common.saveAndContinue"}" class="button defaultButton" />
Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Require authors to submit a file

Postby bdm » Wed Jan 22, 2014 11:43 pm

That's very helpful, thank you.
Posts: 20
Joined: Sun Oct 11, 2009 10:30 pm

Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 2 guests