Commit 179841e5 by chenith

Fix Job open function.

parent 56444420
...@@ -14,7 +14,6 @@ import oneit.servlets.process.SaveFP; ...@@ -14,7 +14,6 @@ import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
import oneit.utils.DateDiff; import oneit.utils.DateDiff;
import performa.orm.Job; import performa.orm.Job;
import performa.orm.ShortenedURL;
import performa.orm.types.JobStatus; import performa.orm.types.JobStatus;
...@@ -25,6 +24,7 @@ public class SaveJobFP extends SaveFP ...@@ -25,6 +24,7 @@ public class SaveJobFP extends SaveFP
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job"); Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob");
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In SaveJobFP saving job : ", job ); LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In SaveJobFP saving job : ", job );
...@@ -36,6 +36,12 @@ public class SaveJobFP extends SaveFP ...@@ -36,6 +36,12 @@ public class SaveJobFP extends SaveFP
job.setOpenDate(new Date()); job.setOpenDate(new Date());
} }
if(openJob==Boolean.TRUE)
{
job.setJobStatus(JobStatus.OPEN);
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"Job status changed as Open. ", job );
}
if(job.getJobStatus() == JobStatus.OPEN && job.getShortenedURL() == null) if(job.getJobStatus() == JobStatus.OPEN && job.getShortenedURL() == null)
{ {
job.createShortenedURL(); job.createShortenedURL();
......
...@@ -215,6 +215,7 @@ ...@@ -215,6 +215,7 @@
<oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn" <oneit:button value="Open this job" name="saveJob" cssClass="btn btn-primary btn-green top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("fromPage", fifthPage) .mapEntry ("fromPage", fifthPage)
.mapEntry ("openJob", Boolean.TRUE)
.mapEntry ("restartProcess", Boolean.TRUE) .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("Job")) .mapEntry ("attribNamesToRestore", Collections.singleton("Job"))
.toMap() %>" /> .toMap() %>" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment