Commit 18393969 by Chamath

Edit job and Edit job template page changes.

parent 2c16d7f6
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/> <column name="company_user_id" type="Long" length="11" nullable="true"/>
<column name="job_title_id" type="Long" length="11" nullable="false"/> <column name="job_title_id" type="Long" length="11" nullable="false"/>
<column name="work_flow_template_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE>
......
...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -27,7 +27,8 @@ CREATE TABLE tl_assessment_template (
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL, company_user_id numeric(12) NULL,
job_title_id numeric(12) NOT NULL job_title_id numeric(12) NOT NULL,
work_flow_template_id numeric(12) NULL
); );
......
...@@ -28,7 +28,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -28,7 +28,8 @@ CREATE TABLE tl_assessment_template (
client_id number(12) NULL, client_id number(12) NULL,
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
company_user_id number(12) NULL, company_user_id number(12) NULL,
job_title_id number(12) NOT NULL job_title_id number(12) NOT NULL,
work_flow_template_id number(12) NULL
); );
......
...@@ -28,7 +28,8 @@ CREATE TABLE tl_assessment_template ( ...@@ -28,7 +28,8 @@ CREATE TABLE tl_assessment_template (
client_id numeric(12) NULL, client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL, company_user_id numeric(12) NULL,
job_title_id numeric(12) NOT NULL job_title_id numeric(12) NOT NULL,
work_flow_template_id numeric(12) NULL
); );
......
package performa.orm; package performa.orm;
import java.util.Collection; import java.util.*;
import java.util.Comparator; import oneit.objstore.rdbms.filters.*;
import java.util.List;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter;
import oneit.objstore.utils.ObjstoreUtils; import oneit.objstore.utils.ObjstoreUtils;
import oneit.utils.CollectionUtils; import oneit.utils.*;
import oneit.utils.ObjectTransform; import oneit.utils.filter.*;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
import performa.orm.types.AssessmentType; import performa.orm.types.*;
import performa.orm.types.CriteriaType;
import performa.orm.types.JobType;
public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
...@@ -34,20 +26,20 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate ...@@ -34,20 +26,20 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
return getTemplateName(); return getTemplateName();
} }
public List<WorkFlow> getSortedMiddleWorkFlows() public List<WorkFlowStage> getSortedMiddleWorkFlowStages()
{ {
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new LessThanFilter<>(9)).andSortOrder(new GreaterThanFilter<>(1)); Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andStageType(new NotInFilter<>(StageType.POST_INGEST, StageType.INCOMPLETE, StageType.UNSUITABLE, StageType.WITHDREW));
return ObjstoreUtils.sort(pipelineAssessmentCriteriaTemplate().toWorkFlows(filter).uniqueVals(), return ObjstoreUtils.sort(pipesAssessmentCriteriaTemplate().toWorkFlowTemplate().toWorkFlowStages(filter).uniqueVals(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()}, new ObjectTransform[]{WorkFlowStage.pipesWorkFlowStage().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST}); new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
} }
public WorkFlow getWorkFlowBySortOrder(int sortOrder) public WorkFlowStage getWorkFlowStageBySortOrder(int sortOrder)
{ {
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder)); Filter<WorkFlowStage> filter = WorkFlowStage.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder));
return pipelineAssessmentCriteriaTemplate().toWorkFlows(filter).val(); return pipelineAssessmentCriteriaTemplate().toWorkFlowTemplate().toWorkFlowStages(filter).val();
} }
public String getLevelClass(Level level) public String getLevelClass(Level level)
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/> <ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/>
<ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.TRUE"/> <ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.TRUE"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/> <SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/> <SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/>
<SINGLEREFERENCE name="JobOwner" type="CompanyUser" dbcol="job_owner_id" /> <SINGLEREFERENCE name="JobOwner" type="CompanyUser" dbcol="job_owner_id" />
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" /> <SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" />
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" /> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/> <SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" mandatory="true"/> <SINGLEREFERENCE name="ILOJobTitle" type="ILOJobTitle" dbcol="job_title_id" mandatory="true"/>
<SINGLEREFERENCE name="WorkFlowTemplate" type="WorkFlowTemplate" dbcol="work_flow_template_id" mandatory="false"/>
</TABLE> </TABLE>
......
...@@ -40,4 +40,10 @@ public class WorkFlowTemplate extends BaseWorkFlowTemplate ...@@ -40,4 +40,10 @@ public class WorkFlowTemplate extends BaseWorkFlowTemplate
{ {
return (WorkFlowTemplate) BusinessCopyHelper.copyRootBusinessObject (this, null, getCloneForCopy()); return (WorkFlowTemplate) BusinessCopyHelper.copyRootBusinessObject (this, null, getCloneForCopy());
} }
@Override
public String getToString()
{
return getTemplateName();
}
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package performa.search; ...@@ -2,6 +2,7 @@ package performa.search;
import oneit.objstore.*; import oneit.objstore.*;
import oneit.objstore.rdbms.filters.*; import oneit.objstore.rdbms.filters.*;
import oneit.security.SecUser;
import performa.orm.*; import performa.orm.*;
...@@ -18,13 +19,17 @@ public class SearchWorkFlowTemplate extends BaseSearchWorkFlowTemplate ...@@ -18,13 +19,17 @@ public class SearchWorkFlowTemplate extends BaseSearchWorkFlowTemplate
@Override @Override
public BaseBusinessClass[] doSearch() public BaseBusinessClass[] doSearch()
{ {
BaseWorkFlowTemplate.SearchAll searchByAll = WorkFlowTemplate.SearchByAll(); BaseWorkFlowTemplate.SearchAll searchByAll = WorkFlowTemplate.SearchByAll();
SecUser secUser = SecUser.getTXUser(getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if (isTrue(getOnlyGlobalTemplates())) if (isTrue(getOnlyGlobalTemplates()))
{ {
return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction()); return searchByAll.andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE)).search(getTransaction());
} }
return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>()).search(getTransaction()); return searchByAll.andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.search(getTransaction());
} }
} }
\ No newline at end of file
...@@ -29,6 +29,7 @@ import performa.form.LinkedInOAuthLoginFP; ...@@ -29,6 +29,7 @@ import performa.form.LinkedInOAuthLoginFP;
import performa.orm.*; import performa.orm.*;
import performa.orm.types.*; import performa.orm.types.*;
import performa.search.SearchApplicant; import performa.search.SearchApplicant;
import performa.search.SearchWorkFlowTemplate;
/** /**
* *
...@@ -788,4 +789,19 @@ public class Utils ...@@ -788,4 +789,19 @@ public class Utils
return sb.toString(); return sb.toString();
} }
public static WorkFlowTemplate[] getWorkFlowTemplatesForHiringTeam(ObjectTransaction objTran)
{
SecUser secUser = SecUser.getTXUser(objTran);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
WorkFlowTemplate[] hiringTeamTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new IsNotNullFilter<>())
.andHiringTeam(new EqualsFilter<>(companyUser.getSelectedTeam()))
.search(objTran);
WorkFlowTemplate[] globalTemplates = WorkFlowTemplate.SearchByAll().andIsGlobalTemplate(new EqualsFilter<>(Boolean.TRUE))
.search(objTran);
return CollectionUtils.addTo(globalTemplates, hiringTeamTemplates);
}
} }
\ No newline at end of file
<%@page import="performa.search.SearchWorkFlowTemplate"%>
<%@ page extends="oneit.servlets.jsp.JSPInclude" %> <%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%> <%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
...@@ -449,81 +450,16 @@ ...@@ -449,81 +450,16 @@
</div> </div>
</div> </div>
<div class="form-page-section darkbg"> <div class="form-page-section darkbg">
<div class="form-group row"> <div class="col-sm-6 col-xs-12">
<div class="col-md-12"> <label><oneit:label GUIName="Select Workflow "/></label>
<label class="label-16">Applicant Workflow</label> <div class="wider-select">
</div> <tagfile:ormsingleasso_select obj="<%= template %>" assocName="WorkFlowTemplate" options="<%= Utils.getWorkFlowTemplatesForHiringTeam(transaction) %>"/>
</div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-12">
Please define your applicant approval/refinement workflow and tabs below. We have nominated some defaults to help you get started. You are allowed up to 9 different steps, and can drag to re-order using the handle on the left. If you want to modify the existing workflow or create a new workflow, please save the job and click on the Workflow templates.
</div>
</div>
<div id="workflows">
<div>
<%
WorkFlow firstWorkflow = template.getWorkFlowBySortOrder(1);
%>
<div class="form-group row">
<div class="col-md-12">
<div class="workflow-row">
<span><%= firstWorkflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= firstWorkflow %>" type="text" attributeName="Name" cssClass="form-control" />
</div>
<div class="seperator-dots"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>
</div>
</div>
</div> </div>
<div id="middle-workflows">
<%
List<WorkFlowStage> sortedWorkflows = template.getSortedMiddleWorkFlows();
int index = 0;
for (WorkFlowStage workflow : sortedWorkflows)
{
index++;
%>
<div class="form-group row" id="<%= workflow.getID() %>">
<div class="col-md-12">
<div class="workflow-row">
<span><%= workflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= workflow %>" type="text" attributeName="Name" cssClass="form-control" />
<%
if(workflow.getApplicationStatus() != ApplicationStatus.SUBMITTED && workflow.getApplicationStatus() != ApplicationStatus.SHORTLISTED)
{
String deleteVarKey = FormTag.getVariableKey (request);
FormTag.setVariable (request, deleteVarKey, "objToDelete", workflow);
FormTag.setVariable (request, deleteVarKey, "jqToDelete", "#" + workflow.getID());
%>
<div class="remove-icon" onclick="return deleteWorkflow (<%= deleteVarKey %>)">_</div>
<%
}
%>
</div>
</div>
</div>
<%
}
%>
</div>
<div>
<%
WorkFlow lastWorkflow = template.getWorkFlowBySortOrder(9);
%>
<div class="form-group row">
<div class="col-md-12">
<div class="seperator-dots"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>
<div class="workflow-row">
<span><%= lastWorkflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= lastWorkflow %>" type="text" attributeName="Name" cssClass="form-control last-workflow" />
</div>
</div>
</div>
</div>
</div>
<div class="form-group row" style="text-align: center;" >
<a href="#" class="add-more-btn review-edit-btn" onclick="<%="addWorkflow(); return false;"%>" tabindex="32">Add Workflow Step</a>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -458,111 +458,32 @@ ...@@ -458,111 +458,32 @@
</div> </div>
<div class="form-page-section darkbg"> <div class="form-page-section darkbg">
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-sm-6 col-xs-12">
<label class="label-16">Applicant Workflow</label> <label><oneit:label GUIName="Select Workflow "/></label>
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= Utils.getWorkFlowTemplatesForHiringTeam(transaction) %>"/>
</div>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-sm-12 col-xs-12 text-center" style="background-color: #d9edf7;">
Please define your applicant approval/refinement workflow and tabs below. We have nominated some defaults to help you get started. You are allowed up to 9 different steps, and can drag to re-order using the handle on the left. <span style="color: #31708f; font-size: small">If you want to modify the existing workflow or create a new workflow, please save the job and click on the Workflow templates.</span>
</div>
</div>
<div id="workflows">
<div>
<%
WorkFlow firstWorkflow = job.getWorkFlowBySortOrder(1);
%>
<div class="form-group row">
<div class="col-md-12">
<div class="workflow-row">
<span><%= firstWorkflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= firstWorkflow %>" type="text" attributeName="Name" cssClass="form-control" />
</div>
<div class="seperator-dots"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>
</div>
</div>
</div>
<div id="middle-workflows">
<%
List<WorkFlowStage> sortedWorkflows = job.getSortedMiddleStages();
int index = 0;
for (WorkFlowStage workflow : sortedWorkflows)
{
index++;
%>
<div class="form-group row" id="<%= workflow.getID() %>">
<div class="col-md-12">
<div class="workflow-row">
<span><%= workflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= workflow %>" type="text" attributeName="Name" cssClass="form-control" />
<%
if(workflow.getStageType() != StageType.INTERVIEW && workflow.getStageType() != StageType.INTERVIEW)
{
String deleteVarKey = FormTag.getVariableKey (request);
FormTag.setVariable (request, deleteVarKey, "objToDelete", workflow);
FormTag.setVariable (request, deleteVarKey, "jqToDelete", "#" + workflow.getID());
%>
<div class="remove-icon" onclick="return deleteWorkflow (<%= deleteVarKey %>)">_</div>
<%
}
%>
</div>
</div>
</div>
<%
}
%>
</div> </div>
<div>
<%
WorkFlow lastWorkflow = job.getWorkFlowBySortOrder(9);
%>
<div class="form-group row">
<div class="col-md-12">
<div class="seperator-dots"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>
<div class="workflow-row">
<span><%= lastWorkflow.getSortOrder() %></span>
<oneit:ormInput obj="<%= lastWorkflow %>" type="text" attributeName="Name" cssClass="form-control last-workflow" />
</div>
</div>
</div>
</div>
</div>
<div class="form-group row" style="text-align: center;" >
<a href="#" class="add-more-btn review-edit-btn" onclick="<%="addWorkflow(); return false;"%>" tabindex="32">Add Workflow Step</a>
</div>
<div class="form-brack-line"></div>
<div class="text-center">
<%
if(false)
{
%>
<div class="form-group row">
<div class="col-md-12">
Job Templates include both Job Details and Requirements.
</div>
<div class="col-md-12">
Saving a new Job Template a can be completed on the next step.
</div>
</div>
<%
}
%>
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry("DraftLocation", DraftLocation.DETAILS)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<button class="btn btn-primary largeBtn" onclick="$('.processCulture').click();" tabindex="33">Proceed to Requirements</button>
<oneit:button value="Proceed to Requirements" name="processCulture" cssClass="processCulture hide"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("fromJobMatch", true)
.toMap() %>"/>
</div> </div>
</div> </div>
<div class="text-center">
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry("DraftLocation", DraftLocation.DETAILS)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<button class="btn btn-primary largeBtn" onclick="$('.processCulture').click();" tabindex="33">Proceed to Requirements</button>
<oneit:button value="Proceed to Requirements" name="processCulture" cssClass="processCulture hide"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("fromJobMatch", true)
.toMap() %>"/>
</div>
</div> </div>
</div> </div>
</div> </div>
......
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