Commit 9c7e7f3d by Nilu

added tabs in HT003 according to work flows added

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