mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Fix misuse of previous button to avoid file upload when required (noted by lap82)
This commit is contained in:
@@ -151,16 +151,10 @@ public class UploadStep extends AbstractProcessingStep
|
||||
}
|
||||
}
|
||||
|
||||
if (buttonPressed.startsWith(PREVIOUS_BUTTON)
|
||||
|| buttonPressed.startsWith(CANCEL_BUTTON))
|
||||
{
|
||||
// always allow the user to go back or suspend the submission
|
||||
return STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
// if user pressed jump-to button in process bar,
|
||||
// return success (so that jump will occur)
|
||||
if (buttonPressed.startsWith(PROGRESS_BAR_PREFIX))
|
||||
if (buttonPressed.startsWith(PROGRESS_BAR_PREFIX) ||
|
||||
buttonPressed.startsWith(PREVIOUS_BUTTON))
|
||||
{
|
||||
// check if a file is required to be uploaded
|
||||
if (fileRequired && !item.hasUploadedFiles())
|
||||
|
@@ -19,7 +19,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.dspace.app.util.SubmissionInfo;
|
||||
import org.dspace.app.util.Util;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -116,16 +115,10 @@ public class UploadWithEmbargoStep extends UploadStep
|
||||
}
|
||||
}
|
||||
|
||||
if (buttonPressed.startsWith(PREVIOUS_BUTTON)
|
||||
|| buttonPressed.startsWith(CANCEL_BUTTON))
|
||||
{
|
||||
// always allow the user to go back or suspend the submission
|
||||
return STATUS_COMPLETE;
|
||||
}
|
||||
|
||||
// if user pressed jump-to button in process bar,
|
||||
// return success (so that jump will occur)
|
||||
if (buttonPressed.startsWith(PROGRESS_BAR_PREFIX))
|
||||
if (buttonPressed.startsWith(PROGRESS_BAR_PREFIX) ||
|
||||
buttonPressed.startsWith(PREVIOUS_BUTTON))
|
||||
{
|
||||
// check if a file is required to be uploaded
|
||||
if (fileRequired && !item.hasUploadedFiles())
|
||||
|
@@ -531,7 +531,7 @@ public class SubmissionController extends DSpaceServlet
|
||||
|
||||
if (!subInfo.isInWorkflow())
|
||||
{
|
||||
stepAndPageReached = Float.parseFloat(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo));
|
||||
stepAndPageReached = Double.parseDouble(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo));
|
||||
}
|
||||
|
||||
if (result != AbstractProcessingStep.STATUS_COMPLETE && currStepAndPage != stepAndPageReached)
|
||||
@@ -688,14 +688,13 @@ public class SubmissionController extends DSpaceServlet
|
||||
|
||||
int currStep = currentStepConfig.getStepNumber();
|
||||
int currPage = AbstractProcessingStep.getCurrentPage(request);
|
||||
double currStepAndPage = Float
|
||||
.parseFloat(currStep + "." + currPage);
|
||||
double currStepAndPage = Double.parseDouble(currStep + "." + currPage);
|
||||
// default value if we are in workflow
|
||||
double stepAndPageReached = -1;
|
||||
|
||||
if (!subInfo.isInWorkflow())
|
||||
{
|
||||
stepAndPageReached = Float.parseFloat(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo));
|
||||
stepAndPageReached = Double.parseDouble(getStepReached(subInfo)+"."+JSPStepManager.getPageReached(subInfo));
|
||||
}
|
||||
|
||||
if (result != AbstractProcessingStep.STATUS_COMPLETE
|
||||
|
@@ -171,11 +171,15 @@
|
||||
.on('click', function(e){
|
||||
if ($('#tfile').val() != null && $('#tfile').val() != '') {
|
||||
$('#uploadForm').attr('target','uploadFormIFrame');
|
||||
initProgressBar($);
|
||||
initProgressBar($);
|
||||
setTimeout(function() {
|
||||
monitorProgressJSON($);
|
||||
}, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ajaxUpload').val(false);
|
||||
}
|
||||
$('#uploadFormIFrame').on('load',function(){
|
||||
var resultFile = null;
|
||||
try {
|
||||
|
Reference in New Issue
Block a user