Commit 0e51fe8b by Nilu

HT002

parent 645557b3
......@@ -103,7 +103,7 @@ public class Utils
}
//to sort jobs list
public static List<Job> getJobsSorted(Job[] jobs, JobSortOption jobSortOption, JobStatus jobStatus)
public static List<Job> getJobsSorted(List<Job> jobs, JobSortOption jobSortOption, JobStatus jobStatus)
{
ObjectTransform transform = Job.pipesJob().toObjectCreated();
Comparator comparator = CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST;
......@@ -143,7 +143,7 @@ public class Utils
comparator = CollectionUtils.reverse(CollectionUtils.CASE_INSENSITIVE_COMPARATOR_NULLS_FIRST);
}
return ObjstoreUtils.sort( Arrays.asList(jobs),
return ObjstoreUtils.sort( jobs,
new ObjectTransform[]{transform},
new Comparator[]{comparator});
}
......
......@@ -2679,6 +2679,7 @@ a.forgot-pass {
/*All Jobs Page*/
.shorting-dropdown {
float: right;
margin: 20px;
}
.all-jobs-title{
display: inline-block;
......@@ -4760,7 +4761,7 @@ img.alert-icon {float: left;}
.job-states{width: 33.2%;padding-top: 24px;padding-bottom: 24px;}
.job-filter > ul {padding-right: 0;}
.job-filter {display: inline-block;position: relative;top: 0;width: 100%;margin-bottom: 18px;margin-top: 8px;}
.shorting-dropdown {float: right;position: absolute;right: 0;top: 0;}
.shorting-dropdown {float: right;}
.applicant-sidebar {margin-bottom: 15px;width: 100%;}
.main-applicant-content {width: 100%;}
.off-name {font-size: 11px;}
......
......@@ -4,6 +4,7 @@
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<%@ page import="oneit.utils.filter.*"%>
<oneit:dynIncluded>
<%
ObjectTransaction objTran = process.getTransaction ();
......@@ -12,6 +13,10 @@
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();
if(process.getAttribute("JobStatus") != null)
{
......@@ -28,21 +33,42 @@
jobSortOpt = JobSortOption.NEWEST;
}
String jobListName = "Job" + jobStatus;
Job[] jobs = (Job[]) process.getAttribute(jobListName);
jobStatus = JobStatus.forName((String) request.getParameter("JobStatus"));
session.setAttribute("JobStatus", jobStatus);
if(jobs==null)
if(request.getParameter("Client") != null)
{
SecUser txUser = SecUser.getTXUser(objTran);
selectedClient = Client.getClientByID(objTran, Long.valueOf(request.getParameter("Client")));
}
jobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(jobStatus))
.byCompany(txUser.getExtension(CompanyUser.REFERENCE_CompanyUser).getCompany())
if(jobSortOpt == null)
{
jobSortOpt = JobSortOption.NEWEST;
}
String jobListName = "Job" + hiringTeam.getID() +jobStatus;
Job[] jobs = (Job[]) process.getAttribute(jobListName);
if(jobs == null)
{
jobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(jobStatus))
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.search(transaction);
process.setAttribute(jobListName, jobs);
}
List<Job> sortedJobs = Utils.getJobsSorted(jobs, jobSortOpt, jobStatus);
List<Job> jobList = Arrays.asList(jobs);
if(selectedClient != null)
{
oneit.utils.filter.Filter<Job> filter = Job.SearchByAll().andClient(new EqualsFilter<>(selectedClient));
jobList = new ArrayList<>(CollectionFilter.filter(jobList, filter));
}
List<Job> sortedJobs = Utils.getJobsSorted(jobList, jobSortOpt, jobStatus);
process.setAttribute("JobSortOption", jobSortOpt);
%>
......@@ -56,7 +82,7 @@
<div class="d-job-title all-jobs-title">
<%= jobStatus == null ? "All" : jobStatus.getDescription() %> Jobs
</div>
<div class="job-filter">
<%-- <div class="job-filter">
<ul class="">
<li class="lable-job-shorting">showing</li>
<li class="<%= (jobStatus == null ? "active" : "" )%>">
......@@ -80,12 +106,13 @@
%>
</ul>
</div>
--%>
<%
if(jobs.length > 1)
{
%>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<div class="order-label">order by</div>
<select class="form-control" onChange="location=this.value">
<%
for (JobSortOption sortOption : JobSortOption.getJobSortOptionArray())
......@@ -103,6 +130,45 @@
<%
}
%>
<div class="shorting-dropdown">
<div class="order-label">showing</div>
<select class="form-control" onChange="location=this.value">
<option <%= (jobStatus == null ? "selected" : "" )%> value="<%= homePage %>">
<oneit:toString value="All Jobs" mode="EscapeHTML"/>
</option>
<%
for (JobStatus sortOption : Utils.getJobStatusesForClient())
{
String optionLink = homePage + "&JobStatus=" + sortOption.getName() ;
%>
<option <%= (jobStatus != null && jobStatus == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
<div class="shorting-dropdown">
<div class="order-label">client</div>
<select class="form-control" onChange="location=this.value">
<option <%= (selectedClient == null ? "selected" : "" )%> value="<%= homePage %>">
<oneit:toString value="All Clients" mode="EscapeHTML"/>
</option>
<%
for (Client client : Utils.getClientsByHiringTeam(objTran))
{
String optionLink = homePage + "&Client=" + client.getID().longID() ;
%>
<option <%= (client != null && client == selectedClient ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= client.getClientName() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/job_list.jsp" data="<%= CollectionUtils.EMPTY_MAP%>" ShortlistPage="<%= shortlistPage %>"
......
......@@ -5,7 +5,7 @@
<NODE name="Script" factory="Vector">
<NODE name="insertOp" factory="Participant" class="oneit.sql.transfer.InsertOperation"
query="select distinct(tl_company.*) from tl_company, tl_hiring_team where tl_hiring_team.company_id != tl_company.object_id">
query="select distinct(tl_company.*) from tl_company, tl_hiring_team where tl_hiring_team.company_id != tl_company.object_id AND tl_company.object_id = 37986758">
<tableName factory="String">tl_hiring_team</tableName>
<value name='object_id' factory='Participant' class="oneit.sql.transfer.DBTransferer$ObjectID"/>
<value name='object_last_updated_date' class="oneit.sql.transfer.DBTransferer$Timestamp"/>
......
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