Commit 9c7e7f3d by Nilu

added tabs in HT003 according to work flows added

parent c2c6d48d
......@@ -594,4 +594,37 @@ public class Job extends BaseJob
}
return !isTrue(level.getAppliedToExpress());
}
public List<WorkFlow> getSortedWorkFlows()
{
return ObjstoreUtils.sort(getWorkFlowsSet(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
public WorkFlow getFirstWorkFlow()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(1));
return pipelineJob().toWorkFlows(filter).val();
}
public WorkFlow getLastWorkFlow()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(9));
return pipelineJob().toWorkFlows(filter).val();
}
public List<WorkFlow> getSortedMiddleWorkFlows()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new LessThanFilter<>(9)).andSortOrder(new GreaterThanFilter<>(1));
return ObjstoreUtils.sort(pipelineJob().toWorkFlows(filter).uniqueVals(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
}
\ No newline at end of file
......@@ -6,13 +6,12 @@
<%
Job job = (Job) process.getAttribute("Job");
String tabNumber = (String) getData(request, "TabNumber");
String firstTab = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String secondTab = WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_SHORTLIST);
String thirdTab = WebUtils.getSamePageInRenderMode(request, WebUtils.UNSUITABLE_APPS);
int noOfShortlisted = job.getNoOfCandidatesShortlisted();
int noOfUnsuitable = job.getNoOfCandidatesUnsuitable();
int totalCandidates = job.getNoOfCandidatesApplied();
int tabNumber = (int) getData(request, "TabNumber");
String applicantsPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
// String secondTab = WebUtils.getSamePageInRenderMode(request, WebUtils.APPLICANTS_SHORTLIST);
// String thirdTab = WebUtils.getSamePageInRenderMode(request, WebUtils.UNSUITABLE_APPS);
int noOfIncomplete = job.getNoOfCandidatesFor(ApplicationStatus.DRAFT);
int noOfUnsuitable = job.getNoOfCandidatesFor(ApplicationStatus.UNSUITABLE);
%>
<oneit:dynIncluded>
......@@ -23,40 +22,48 @@
<oneit:dynInclude page="/extensions/adminportal/inc/job_title_bar.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="int-timeline">
<ul>
<li class="<%= totalCandidates > 0 ? "has-applicant" : "" %> <%= tabNumber == "1" ? "active" : "inactive" %>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
<li class="<%= noOfIncomplete > 0 ? "has-applicant" : "no-applicant" %> <%= tabNumber == 1 ? "active" : "inactive" %>">
<oneit:button id="unsuitableBtn" value=" " name="gotoPage" skin="link" disabled="<%= noOfUnsuitable > 0 ? "false" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicantsPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).mapEntry("TabNumber", 1).toMap())
.toMap() %>">
<span>
<oneit:toString value="<%= totalCandidates %>" mode="Integer" />
<oneit:toString value="<%= noOfIncomplete %>" mode="Integer" />
</span>
Applicants
<%= job.getFirstWorkFlow().getName() %>
</oneit:button>
</li>
<li class="<%= noOfShortlisted > 0 ? "has-applicant" : "no-applicant" %> <%= tabNumber == "2" ? "active" : "inactive" %>" style="margin-left: 1px;">
<oneit:button value=" " name="gotoPage" skin="link" disabled="<%= noOfShortlisted > 0 ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
<ul>
<%
for (WorkFlow workflow : job.getSortedMiddleWorkFlows())
{
int noOfCandidates = job.getNoOfCandidatesFor(workflow.getApplicationStatus());
%>
<li class="<%= noOfCandidates > 0 ? "has-applicant" : "" %> <%= (tabNumber == workflow.getSortOrder()) ? "active" : "inactive" %>">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicantsPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).mapEntry("TabNumber", workflow.getSortOrder()).toMap())
.toMap() %>">
<span>
<oneit:toString value="<%= noOfShortlisted %>" mode="Integer" />
<oneit:toString value="<%= noOfCandidates %>" mode="Integer" />
</span>
Shortlisted
<%= workflow.getName() %>
</oneit:button>
</li>
<%
}
%>
</ul>
</div>
<div class="unsutable <%= noOfUnsuitable > 0 ? "has-applicant" : "no-applicant" %> <%= tabNumber == "3" ? "active" : "inactive" %>">
<oneit:button id="unsuitableBtn" value=" " name="gotoPage" skin="link" disabled="<%= noOfUnsuitable > 0 ? "false" : "true" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdTab)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
<div class="unsutable <%= noOfUnsuitable > 0 ? "has-applicant" : "no-applicant" %> <%= tabNumber == 9 ? "active" : "inactive" %>">
<oneit:button id="unsuitableBtn" value=" " name="gotoPage" skin="link" disabled="<%= noOfUnsuitable > 0 ? "false" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", applicantsPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).mapEntry("TabNumber", 9).toMap())
.toMap() %>">
<span>
<oneit:toString value="<%= noOfUnsuitable %>" mode="Integer" />
</span>
Unsuitable
<%= job.getFirstWorkFlow().getName() %>
</oneit:button>
</div>
</div>
......
......@@ -308,9 +308,7 @@
</div>
<div id="workflows">
<%
List<WorkFlow> sortedWorkflows = ObjstoreUtils.sort(job.getWorkFlowsSet(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
List<WorkFlow> sortedWorkflows = job.getSortedWorkFlows();
for (WorkFlow workflow : sortedWorkflows)
{
......
......@@ -9,7 +9,7 @@
<%
Job job = (Job) process.getAttribute("Job");
if(job==null && request.getParameter("JobID")!=null)
if(job == null && request.getParameter("JobID") != null)
{
job = Job.getJobByID(transaction, Long.parseLong(request.getParameter("JobID")));
......@@ -21,6 +21,7 @@
String currentPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICANTS);
String applicationPage = WebUtils.getSamePageInRenderMode(request, WebUtils.VIEW_APPLICATION);
AppSortOption appSortOpt = (AppSortOption) process.getAttribute("AppSortOption");
int tabNumber = process.getAttribute("TabNumber") != null ? (int) process.getAttribute("TabNumber") : 1;
if(request.getParameter("AppSortOption") != null)
{
......@@ -34,7 +35,7 @@
JobApplication[] applications = (JobApplication[]) process.getAttribute("JobApplications");
if(applications==null)
if(applications == null)
{
applications = JobApplication.SearchByAll()
.andJob(new EqualsFilter<>(job))
......@@ -47,13 +48,14 @@
List<JobApplication> sortedApplications = applications!=null ? Utils.getApplicationsSorted(applications, appSortOpt) : new ArrayList<JobApplication>();
process.setAttribute("AppSortOption", appSortOpt);
process.setAttribute("TabNumber", tabNumber);
%>
<oneit:form name="viewApplicants" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area">
<oneit:dynInclude page="/extensions/adminportal/inc/applicant_view_tabs.jsp"
TabNumber="1"
TabNumber="<%= tabNumber %>"
data="<%= CollectionUtils.EMPTY_MAP%>"/>
......
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