Commit b8d5855d by Nilu

J002 modifications

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