Commit b8d5855d by Nilu

J002 modifications

parent 0e51fe8b
......@@ -7,46 +7,75 @@
<%@ page import="oneit.utils.filter.*"%>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String shortlistPage = WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_SHORTLIST);
String homePage = WebUtils.getSamePageInRenderMode(request, "Page");
JobStatus jobStatus = process.getAttribute("JobStatus") != null ? (JobStatus) process.getAttribute("JobStatus") : (JobStatus) session.getAttribute("JobStatus");
JobSortOption jobSortOpt = (JobSortOption) process.getAttribute("JobSortOption");
Client selectedClient = null;
SecUser txUser = SecUser.getTXUser(objTran);
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
ObjectTransaction objTran = process.getTransaction ();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String shortlistPage = WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_SHORTLIST);
String homePage = WebUtils.getSamePageInRenderMode(request, "Page");
JobStatus jobStatus = null;
JobSortOption jobSortOpt = null;
Client selectedClient = null;
SecUser txUser = SecUser.getTXUser(objTran);
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
Map<String, String[]> parameterMap = request.getParameterMap();
if(process.getAttribute("JobStatus") != null)
{
session.setAttribute("JobStatus", jobStatus);
}
// handle job sort option
if( request.getParameter("JobSortOption") != null)
{
jobSortOpt = JobSortOption.forName((String) request.getParameter("JobSortOption"));
}
else if(process.getAttribute("JobSortOption") != null)
{
jobSortOpt = (JobSortOption) process.getAttribute("JobSortOption");
}
else
{
jobSortOpt = (JobSortOption) session.getAttribute("JobSortOption");
}
if(jobSortOpt == null)
{
jobSortOpt = JobSortOption.NEWEST;
}
jobStatus = JobStatus.forName((String) request.getParameter("JobStatus"));
session.setAttribute("JobStatus", jobStatus);
session.setAttribute("JobSortOption", jobSortOpt);
if(request.getParameter("Client") != null)
// handle job status
if( parameterMap.containsKey("JobStatus"))
{
if(!request.getParameter("JobStatus").isEmpty())
{
jobStatus = JobStatus.forName((String) request.getParameter("JobStatus"));
}
}
else if(process.getAttribute("JobStatus") != null)
{
selectedClient = Client.getClientByID(objTran, Long.valueOf(request.getParameter("Client")));
jobStatus = (JobStatus) process.getAttribute("JobStatus");
}
else
{
jobStatus = (JobStatus) session.getAttribute("JobStatus");
}
session.setAttribute("JobStatus", jobStatus);
if(jobSortOpt == null)
// handle client
if( parameterMap.containsKey("Client"))
{
jobSortOpt = JobSortOption.NEWEST;
if(!request.getParameter("Client").isEmpty())
{
selectedClient = Client.getClientByID(objTran, Long.valueOf(request.getParameter("Client")));
}
}
else
{
System.out.println("getting from session :: ");
selectedClient = (Client) session.getAttribute("Client");
System.out.println("getting from session selectedClient :: " + selectedClient);
}
session.setAttribute("Client", selectedClient);
String jobListName = "Job" + hiringTeam.getID() +jobStatus;
Job[] jobs = (Job[]) process.getAttribute(jobListName);
......@@ -68,9 +97,10 @@
jobList = new ArrayList<>(CollectionFilter.filter(jobList, filter));
}
List<Job> sortedJobs = Utils.getJobsSorted(jobList, jobSortOpt, jobStatus);
List<Job> sortedJobs = Utils.getJobsSorted(jobList, jobSortOpt, jobStatus);
process.setAttribute("JobSortOption", jobSortOpt);
process.setAttribute("JobStatus", jobStatus);
%>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
......@@ -133,7 +163,7 @@
<div class="shorting-dropdown">
<div class="order-label">showing</div>
<select class="form-control" onChange="location=this.value">
<option <%= (jobStatus == null ? "selected" : "" )%> value="<%= homePage %>">
<option <%= (jobStatus == null ? "selected" : "" )%> value="<%= homePage + "&JobStatus" %>">
<oneit:toString value="All Jobs" mode="EscapeHTML"/>
</option>
<%
......@@ -152,7 +182,7 @@
<div class="shorting-dropdown">
<div class="order-label">client</div>
<select class="form-control" onChange="location=this.value">
<option <%= (selectedClient == null ? "selected" : "" )%> value="<%= homePage %>">
<option <%= (selectedClient == null ? "selected" : "" )%> value="<%= homePage + "&Client"%>">
<oneit:toString value="All Clients" mode="EscapeHTML"/>
</option>
<%
......@@ -160,7 +190,7 @@
{
String optionLink = homePage + "&Client=" + client.getID().longID() ;
%>
<option <%= (client != null && client == selectedClient ? "selected" : "" )%> value="<%= optionLink %>">
<option <%= (client != null && selectedClient != null && client.equals(selectedClient) ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= client.getClientName() %>" mode="EscapeHTML"/>
</option>
<%
......
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