Commit 2846d33e by Harsh Shah

Finish Hotfix-20190410

parents c7008ee7 acbb5e4e
...@@ -3,7 +3,7 @@ package performa.form; ...@@ -3,7 +3,7 @@ package performa.form;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.CultureCriteria; import performa.orm.CultureCriteria;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails; import oneit.servlets.forms.SubmissionDetails;
...@@ -12,7 +12,6 @@ import performa.orm.Job; ...@@ -12,7 +12,6 @@ import performa.orm.Job;
import oneit.objstore.parser.BusinessObjectParser; import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.process.ProcessRedirectResult; import oneit.servlets.process.ProcessRedirectResult;
import oneit.servlets.process.SaveFP; import oneit.servlets.process.SaveFP;
import performa.orm.Occupation;
public class ProcessCultureFP extends SaveFP public class ProcessCultureFP extends SaveFP
{ {
...@@ -20,17 +19,6 @@ public class ProcessCultureFP extends SaveFP ...@@ -20,17 +19,6 @@ public class ProcessCultureFP extends SaveFP
@Override @Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{ {
Job job = (Job) process.getAttribute("Job");
if(job.getOccupationId() != null)
{
Occupation occupation = Occupation.getOccupationByID(process.getTransaction(), Long.valueOf(job.getOccupationId()));
job.setOccupation(occupation);
job.setLevel(occupation.getAssessmentLevel());
job.setAssessmentType(occupation.getAssessmentType());
}
return new ProcessRedirectResult((String) submission.getRequest().getAttribute("nextPage"), new String[0]); return new ProcessRedirectResult((String) submission.getRequest().getAttribute("nextPage"), new String[0]);
} }
...@@ -51,17 +39,7 @@ public class ProcessCultureFP extends SaveFP ...@@ -51,17 +39,7 @@ public class ProcessCultureFP extends SaveFP
if(fromJobMatch) if(fromJobMatch)
{ {
if(job.getOccupationId() == null || Occupation.getOccupationByID(process.getTransaction(), Long.valueOf(job.getOccupationId())) == null) BusinessObjectParser.assertFieldCondition(job.getILOJobTitle() != null, job , Job.SINGLEREFERENCE_ILOJobTitle, "mandatory", exceptions, true, request);
{
BusinessObjectParser.assertFieldCondition(job.getOccupation() != null, job , Job.SINGLEREFERENCE_Occupation, "mandatory", exceptions, true, request);
}
// BusinessObjectParser.assertFieldCondition(job.getLevel()!= null, job , Job.SINGLEREFERENCE_Level, "mandatory", exceptions, true, request);
//
// if(job.getLevel() != null)
// {
// BusinessObjectParser.assertFieldCondition(job.showLevelOption(job.getLevel()), job , Job.SINGLEREFERENCE_Level, "invalid", exceptions, true, request);
// }
} }
if(fromCulture) if(fromCulture)
......
...@@ -79,15 +79,6 @@ public class SaveJobFP extends SaveFP ...@@ -79,15 +79,6 @@ public class SaveJobFP extends SaveFP
job.setDraftLocation(draftLocation); job.setDraftLocation(draftLocation);
} }
if(job.getOccupationId() != null)
{
Occupation occupation = Occupation.getOccupationByID(process.getTransaction(), Long.valueOf(job.getOccupationId()));
job.setOccupation(occupation);
job.setLevel(occupation.getAssessmentLevel());
job.setAssessmentType(occupation.getAssessmentType());
}
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
......
...@@ -3,7 +3,6 @@ package performa.orm; ...@@ -3,7 +3,6 @@ package performa.orm;
import java.util.Collection; import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter; import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter; import oneit.objstore.rdbms.filters.LessThanFilter;
...@@ -99,7 +98,13 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate ...@@ -99,7 +98,13 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
protected void postILOJobTitleChange() throws FieldException protected void postILOJobTitleChange() throws FieldException
{ {
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null; Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
if(occupation != null)
{
setOccupation(occupation); setOccupation(occupation);
setLevel(occupation.getAssessmentLevel());
setAssessmentType(occupation.getAssessmentType());
}
super.postILOJobTitleChange(); super.postILOJobTitleChange();
} }
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
<IMPORT value="performa.orm.types.*"/> <IMPORT value="performa.orm.types.*"/>
<IMPORT value="oneit.security.*"/> <IMPORT value="oneit.security.*"/>
<TRANSIENT name="OccupationId" type="String" />
<MULTIPLEREFERENCE name="AssessmentCriterias" type="AssessmentCriteria" backreferenceName="Template" /> <MULTIPLEREFERENCE name="AssessmentCriterias" type="AssessmentCriteria" backreferenceName="Template" />
<MULTIPLEREFERENCE name="WorkFlows" type="WorkFlow" backreferenceName="Template" /> <MULTIPLEREFERENCE name="WorkFlows" type="WorkFlow" backreferenceName="Template" />
......
...@@ -724,7 +724,13 @@ public class Job extends BaseJob ...@@ -724,7 +724,13 @@ public class Job extends BaseJob
protected void postILOJobTitleChange() throws FieldException protected void postILOJobTitleChange() throws FieldException
{ {
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null; Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
if(occupation != null)
{
setOccupation(occupation); setOccupation(occupation);
setLevel(occupation.getAssessmentLevel());
setAssessmentType(occupation.getAssessmentType());
}
super.postILOJobTitleChange(); super.postILOJobTitleChange();
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<TRANSIENT name="CultureTemplateName" type="String"/> <TRANSIENT name="CultureTemplateName" type="String"/>
<TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/> <TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="RankingCompleted" type="Boolean" /> <TRANSIENT name="RankingCompleted" type="Boolean" />
<TRANSIENT name="OccupationId" type="String" />
<TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" /> <TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" />
<TRANSIENTSINGLE name="JobTemplate" type="Job" /> <TRANSIENTSINGLE name="JobTemplate" type="Job" />
......
...@@ -614,6 +614,7 @@ public class Utils ...@@ -614,6 +614,7 @@ public class Utils
job.setJobType(jobTemplate.getJobType()); job.setJobType(jobTemplate.getJobType());
job.setIndustry(jobTemplate.getIndustry()); job.setIndustry(jobTemplate.getIndustry());
job.setILOJobTitle(jobTemplate.getILOJobTitle());
job.setOccupation(jobTemplate.getOccupation()); job.setOccupation(jobTemplate.getOccupation());
job.setRequireCV(jobTemplate.getRequireCV()); job.setRequireCV(jobTemplate.getRequireCV());
......
update tl_assessment_template set assessment_type = (select COALESCE( assessment_type, 'COMPREHENSIVE') from tl_occupation where object_id = tl_assessment_template.occupation_id) where level_id is null and occupation_id is not null;
update tl_assessment_template set level_id = (select assessment_level_id from tl_occupation where object_id = tl_assessment_template.occupation_id) where level_id is null and occupation_id is not null;
update tl_job set assessment_type = (select COALESCE( assessment_type, 'COMPREHENSIVE') from tl_occupation where object_id = tl_job.occupation_id) where level_id is null and occupation_id is not null;
update tl_job set level_id = (select assessment_level_id from tl_occupation where object_id = tl_job.occupation_id) where level_id is null and occupation_id is not null;
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
Boolean isCultureComplete = jobApplication.cultureCompleted(); Boolean isCultureComplete = jobApplication.cultureCompleted();
Boolean isAssesmentComplete = jobApplication.assessmentCompleted(); Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
Article jobApplicationArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOB_APPLICATION); Article jobApplicationArticle = WebUtils.getArticleByShortCut(transaction, WebUtils.JOB_APPLICATION);
String nextPage = jobApplicationArticle.getLink(request); String nextPage = jobApplicationArticle.getLink(request) + "?JobID="+ job.getID().toString();;
if(!jobApplication.hasStartedApplication()) if(!jobApplication.hasStartedApplication())
{ {
......
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