Commit e35809c3 by Nilu

fix issue job created without level

parent 2944cd44
......@@ -3,7 +3,7 @@ package performa.form;
import oneit.servlets.forms.*;
import oneit.utils.*;
import performa.orm.CultureCriteria;
import java.util.Map;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.objstore.StorageException;
import oneit.servlets.forms.SubmissionDetails;
......@@ -12,7 +12,6 @@ import performa.orm.Job;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.process.ProcessRedirectResult;
import oneit.servlets.process.SaveFP;
import performa.orm.Occupation;
public class ProcessCultureFP extends SaveFP
{
......@@ -20,17 +19,6 @@ public class ProcessCultureFP extends SaveFP
@Override
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]);
}
......@@ -51,17 +39,7 @@ public class ProcessCultureFP extends SaveFP
if(fromJobMatch)
{
if(job.getOccupationId() == null || Occupation.getOccupationByID(process.getTransaction(), Long.valueOf(job.getOccupationId())) == null)
{
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);
// }
BusinessObjectParser.assertFieldCondition(job.getILOJobTitle() != null, job , Job.SINGLEREFERENCE_ILOJobTitle, "mandatory", exceptions, true, request);
}
if(fromCulture)
......
......@@ -79,15 +79,6 @@ public class SaveJobFP extends SaveFP
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);
}
......
......@@ -3,7 +3,6 @@ package performa.orm;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter;
......@@ -99,7 +98,13 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
if(occupation != null)
{
setOccupation(occupation);
setLevel(occupation.getAssessmentLevel());
setAssessmentType(occupation.getAssessmentType());
}
super.postILOJobTitleChange();
}
......
......@@ -7,8 +7,6 @@
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="oneit.security.*"/>
<TRANSIENT name="OccupationId" type="String" />
<MULTIPLEREFERENCE name="AssessmentCriterias" type="AssessmentCriteria" backreferenceName="Template" />
<MULTIPLEREFERENCE name="WorkFlows" type="WorkFlow" backreferenceName="Template" />
......
......@@ -724,7 +724,13 @@ public class Job extends BaseJob
protected void postILOJobTitleChange() throws FieldException
{
Occupation occupation = getILOJobTitle() != null ? getILOJobTitle().getOccupation() : null;
setOccupation(occupation);
if(occupation != null)
{
setOccupation(occupation);
setLevel(occupation.getAssessmentLevel());
setAssessmentType(occupation.getAssessmentType());
}
super.postILOJobTitleChange();
}
......
......@@ -25,7 +25,6 @@
<TRANSIENT name="CultureTemplateName" type="String"/>
<TRANSIENT name="AppProcessOption" type="AppProcessOption" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="RankingCompleted" type="Boolean" />
<TRANSIENT name="OccupationId" type="String" />
<TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" />
<TRANSIENTSINGLE name="JobTemplate" type="Job" />
......
......@@ -614,6 +614,7 @@ public class Utils
job.setJobType(jobTemplate.getJobType());
job.setIndustry(jobTemplate.getIndustry());
job.setILOJobTitle(jobTemplate.getILOJobTitle());
job.setOccupation(jobTemplate.getOccupation());
job.setRequireCV(jobTemplate.getRequireCV());
......
......@@ -31,7 +31,7 @@
Boolean isCultureComplete = jobApplication.cultureCompleted();
Boolean isAssesmentComplete = jobApplication.assessmentCompleted();
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())
{
......
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