Commit 5b37086b by chenith Committed by Harsh Shah

Set jobs in process based on current status.

Modify sorting option for closing soon.
parent f9979cea
......@@ -97,7 +97,7 @@ public class Utils
else if(jobSortOption==JobSortOption.CLOSING_SOON)
{
transform = Job.pipesJob().toApplyBy();
comparator = CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST);
comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
}
else if(jobSortOption==JobSortOption.ALPHA_A_Z)
{
......
......@@ -27,11 +27,17 @@
jobSortOpt = JobSortOption.NEWEST;
}
Job[] jobs = (Job[]) process.getAttribute("Jobs");
String jobListName = "Job" + jobStatus;
Job[] jobs = (Job[]) process.getAttribute(jobListName);
if(jobs==null)
{
jobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(jobStatus))
.andSecUser(new EqualsFilter(SecUser.getTXUser(transaction)))
.search(transaction);
process.setAttribute("Jobs", jobs);
process.setAttribute(jobListName, jobs);
}
List<Job> sortedJobs = Utils.getJobsSorted(jobs, jobSortOpt);
......
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