Commit 6c3d0057 by Nilu

In Create Job, IF using a Job Template is selected AND- IF the HT is using…

In Create Job, IF using a Job Template is selected AND- IF the HT is using Clients then we need to first select the Client (i.e. Client drop-down as part of the “Create from template” box)
THEN only the set of templates for that client are in the second drop-down list (of templates).

Next, the Client is selected on the Job Detail page.
 … when the user gets to the Culture page they can only select a Culture template for the Client that is selected on the Job Details page.
parent d476699b
......@@ -27,6 +27,11 @@ public class NavigateToCreateJobFP extends ORMProcessFormProcessor
if(job != null && job.isTrue(job.getFromTemplate()))
{
if(job.getHiringTeam().showHasClientSupport())
{
BusinessObjectParser.assertFieldCondition(job.getClient() != null , job, Job.SINGLEREFERENCE_Client, "mandatory", exceptions, true, request);
}
BusinessObjectParser.assertFieldCondition(job.getAssessmentTemplate() != null , job, Job.SINGLEREFERENCE_AssessmentTemplate, "mandatory", exceptions, true, request);
}
......
......@@ -309,14 +309,23 @@ public class Job extends BaseJob
}
public AssessmentCriteriaTemplate[] getAssessmentTemplates()
public List<AssessmentCriteriaTemplate> getAssessmentTemplates()
{
CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser);
return AssessmentCriteriaTemplate.SearchByAll()
AssessmentCriteriaTemplate.SearchAll search = AssessmentCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(getHiringTeam()))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(getTransaction());
.andCompanyUser(new EqualsFilter<>(companyUser));
if(getHiringTeam().showHasClientSupport() && getClient() != null)
{
search = search.andClient(new EqualsFilter<>(getClient()));
}
else
{
search = search.andClient(new IsNullFilter<>());
}
return Arrays.asList(search.search(getTransaction()));
}
......@@ -324,10 +333,20 @@ public class Job extends BaseJob
{
CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser);
return CultureCriteriaTemplate.SearchByAll()
CultureCriteriaTemplate.SearchAll search = CultureCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(getHiringTeam()))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(getTransaction());
.andCompanyUser(new EqualsFilter<>(companyUser));
if(getHiringTeam().showHasClientSupport() && getClient() != null)
{
search = search.andClient(new EqualsFilter<>(getClient()));
}
else
{
search = search.andClient(new IsNullFilter<>());
}
return search.search(getTransaction());
}
......@@ -686,10 +705,13 @@ public class Job extends BaseJob
return filteredList;
}
// templates disabled for sprint 1
@Override
public FieldWriteability getWriteability_JobTemplate()
public String getTemplateClass(boolean isTeamplate)
{
return FieldWriteability.NOT_IN_GUI;
StringBuilder sb = new StringBuilder("create-job-selector rectangle-4");
sb.append(getHiringTeam().showHasClientSupport() && getClient() != null ? " special" : "");
sb.append((isTeamplate && isTrue(getFromTemplate())) || (!isTeamplate && isFalse(getFromTemplate())) ? " checked" : "");
return sb.toString();
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@
SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
AssessmentCriteriaTemplate[] templates = job.getAssessmentTemplates();
List<AssessmentCriteriaTemplate> templates = job.getAssessmentTemplates();
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
%>
......@@ -256,7 +256,7 @@
<div class="create-job">
<div class="form-page-section">
<%
if(templates.length > 0)
if(templates.size() > 0)
{
%>
<oneit:button value=" " name="loadJobFromTemplate" cssClass="hide"
......@@ -265,7 +265,7 @@
.toMap() %>" />
<div class="form-group wider-select">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= templates %>"
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= templates.toArray(new AssessmentCriteriaTemplate[0]) %>"
blankValue="Optional: Use another Job as a starting point"/>
</div>
<%
......
......@@ -30,7 +30,11 @@
job.setIndustry(hiringTeam.getIndustry());
job.setGoogleAddressText(hiringTeam.getGoogleAddressText());
%>
<style>
.rectangle-4.special{
height: 260px;
}
</style>
<script type="text/javascript">
$(document).ready(function()
{
......@@ -81,21 +85,27 @@
<div class="form-group row">
<div class="col-md-6">
<div class="oneit-radio">
<label class="create-job-selector rectangle-4">
<oneit:recalcClass htmlTag="label" classScript="job.getTemplateClass(isTeamplate)" job="<%= job %>" isTeamplate="<%= true %>">
<span class="create-job-icon from-template"></span>
<!--<img src="images/create_from_template.png">-->
<h3>Create from template</h3>
<oneit:ormInput obj="<%= job %>" type="radio" attributeName="FromTemplate" value="true"/>
<div>
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= job.getAssessmentTemplates() %>"
blankValue="Select your template" disabled='true'/>
<oneit:recalcClass htmlTag="div" classScript="hiringTeam.showHasClientSupport() ? 'show': 'hide'" hiringTeam="<%= hiringTeam %>">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="Client" options="<%= Utils.getClientsByHiringTeam(transaction) %>"
blankValue="Select your client" />
</oneit:recalcClass>
<div style="padding-top:10px;">
<oneit:recalcClass htmlTag="div" classScript="hiringTeam.showHasClientSupport() && job.getClient() != null ? 'show': 'hide'" hiringTeam="<%= hiringTeam %>" job="<%= job %>">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" optionsScript="job.getAssessmentTemplates()" job="<%= job%>"
blankValue="Select your template"/>
</oneit:recalcClass>
</div>
</label>
</oneit:recalcClass>
</div>
</div>
<div class="col-md-6">
<div class="oneit-radio" >
<label class="create-job-selector rectangle-4">
<div class="oneit-radio">
<oneit:recalcClass htmlTag="label" classScript="job.getTemplateClass(isTeamplate)" job="<%= job %>" isTeamplate="<%= false %>">
<span class="create-job-icon new-job"></span>
<!--<img src="images/create_new_job.png">-->
<h3>Create a new job</h3>
......@@ -103,7 +113,7 @@
<div>
New jobs can be saved as a template to be used in future.
</div>
</label>
</oneit:recalcClass>
</div>
</div>
</div>
......
......@@ -12,6 +12,7 @@ Job.State = State or Province
Job.JobTemplate = Job Template
Job.Occupation = Job Occupation Classification
Job.ExpectedCandidateRadius = Expected Candidate Radius
Job.AssessmentTemplate = Template
CultureCriteria.Importance = Rate Importance
CultureCriteria.CultureElementRating = Rating
......
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