Commit 72e97aae by chenith Committed by Harsh Shah

Section completed mark addeed.

parent 4b6cb83d
package performa.form; package performa.form;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.*; import oneit.logging.*;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.*; import oneit.servlets.forms.*;
import oneit.servlets.process.*; import oneit.servlets.process.*;
import oneit.utils.*; import oneit.utils.*;
...@@ -23,4 +25,16 @@ public class CompleteApplicationFP extends SaveFP ...@@ -23,4 +25,16 @@ public class CompleteApplicationFP extends SaveFP
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
JobApplication jobApplication = (JobApplication) process.getAttribute("JobApplication");
BusinessObjectParser.assertFieldCondition(jobApplication.getCultureCriteriaAnswersCount()>0, jobApplication, jobApplication.FIELD_ObjectID, "completeCulture", exceptions, true, request);
super.validate(process, submission, exceptions, params);
}
} }
\ No newline at end of file
...@@ -16,6 +16,19 @@ public class Answer extends BaseAnswer ...@@ -16,6 +16,19 @@ public class Answer extends BaseAnswer
{ {
// Do not add any code to this, always put it in initialiseNewObject // Do not add any code to this, always put it in initialiseNewObject
} }
@Override
public void preCommit(boolean willBeStored) throws Exception
{
super.preCommit(willBeStored);
if(this.getAnswerNo()==null)
{
this.delete();
}
}
@Override @Override
protected void postAnswerNoChange() throws FieldException protected void postAnswerNoChange() throws FieldException
......
...@@ -2,8 +2,11 @@ package performa.orm; ...@@ -2,8 +2,11 @@ package performa.orm;
import java.util.Collection; import java.util.Collection;
import oneit.logging.LoggingArea; import oneit.logging.LoggingArea;
import oneit.objstore.ObjectStatus;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.EqualsFilter; import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.utils.CollectionUtils;
import oneit.utils.filter.CollectionFilter; import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter; import oneit.utils.filter.Filter;
import oneit.utils.parsers.FieldException; import oneit.utils.parsers.FieldException;
...@@ -94,18 +97,38 @@ public class JobApplication extends BaseJobApplication ...@@ -94,18 +97,38 @@ public class JobApplication extends BaseJobApplication
public Boolean selectionCompleted() public Boolean selectionCompleted()
{ {
int all = this.getAssessmentCriteriaAnswersCount();
if(all>0)
{
Filter filter = AssessmentCriteriaAnswer.SearchByAll().andAnswer(new IsNotNullFilter<>());
Collection selected = this.pipelineJobApplication().toAssessmentCriteriaAnswers(filter).toAnswer().vals();
if(selected!=null && CollectionUtils.equals(selected.size(),all))
{
return Boolean.TRUE;
}
}
return Boolean.FALSE; return Boolean.FALSE;
} }
public Boolean cultureCompleted() public Boolean cultureCompleted()
{ {
return Boolean.FALSE; int all = this.getCultureCriteriaAnswersCount();
}
if(all>0)
{
public Boolean assessmentCompleted() Filter filter = CultureCriteriaAnswer.SearchByAll().andSelectedQuestion(new IsNotNullFilter<>());
{ Collection selected = this.pipelineJobApplication().toCultureCriteriaAnswers(filter).toSelectedQuestion().vals();
if(selected!=null && CollectionUtils.equals(selected.size(),all))
{
return Boolean.TRUE;
}
}
return Boolean.FALSE; return Boolean.FALSE;
} }
} }
\ No newline at end of file
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
String firstPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria"); String firstPage = WebUtils.getSamePageInRenderMode(request, "SelectionCriteria");
String secondPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture"); String secondPage = WebUtils.getSamePageInRenderMode(request, "WorkplaceCulture");
String thirdPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment"); String thirdPage = WebUtils.getSamePageInRenderMode(request, "JobMatchAssessment");
// String fourthPage = WebUtils.getSamePageInRenderMode(request, "SubmitApplication");
%> %>
<oneit:dynIncluded> <oneit:dynIncluded>
...@@ -35,12 +34,12 @@ ...@@ -35,12 +34,12 @@
<div class="mobile-hide">Workplace Culture</div> <div class="mobile-hide">Workplace Culture</div>
</oneit:button> </oneit:button>
</li> </li>
<li class="<%= pageNumber == "3" ? "active" : jobApplication.assessmentCompleted() ? "complate" : ""%>"> <li class="<%= pageNumber == "3" ? "active" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" <oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap()) .mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.toMap() %>"> .toMap() %>">
<span><%= jobApplication.assessmentCompleted() ? "<img src=\"images/right-mark.png\" />" : "3"%></span> <span><%= "3" %></span>
<div class="mobile-hide">Job Match Assessment</div> <div class="mobile-hide">Job Match Assessment</div>
</oneit:button> </oneit:button>
</li> </li>
......
...@@ -130,21 +130,16 @@ ...@@ -130,21 +130,16 @@
.toMap() %>"/> .toMap() %>"/>
<% <%
} }
else
{
%>
<oneit:button value="Complete" name="completeApplication" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry("restartProcess", Boolean.TRUE)
.toMap() %>"/>
<%
}
%> %>
</span> </span>
</div> </div>
<div class="auto-save"> <div class="auto-save">
<oneit:button value="Complete" name="completeApplication" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.mapEntry("restartProcess", Boolean.TRUE)
.toMap() %>"/>
<%-- <div>Autosaved 1 min ago.</div> --%> <%-- <div>Autosaved 1 min ago.</div> --%>
</div> </div>
</div> </div>
......
#completeCulture = Please complete the section 2.
\ No newline at end of file
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