Commit f754236d by Nilu

adding partial save to all job creation screens. Create a Job nav - Support…

adding partial save to all job creation screens. Create a Job nav - Support going _back_ to this step from **any** other step for all job creation screens
parent 1ac00115
......@@ -23,7 +23,7 @@
<column name="city" type="String" nullable="true" length="100"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="level_id" type="Long" length="11" nullable="false"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
<column name="shortened_url_id" type="Long" length="11" nullable="true"/>
......
......@@ -23,7 +23,7 @@ CREATE TABLE tl_job (
city varchar(100) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
level_id numeric(12) NOT NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
company_user_id numeric(12) NULL,
shortened_url_id numeric(12) NULL
......
......@@ -24,7 +24,7 @@ CREATE TABLE tl_job (
city varchar2(100) NULL,
state varchar2(200) NULL,
country varchar2(200) NULL,
level_id number(12) NOT NULL,
level_id number(12) NULL,
client_id number(12) NULL,
company_user_id number(12) NULL,
shortened_url_id number(12) NULL
......
......@@ -24,7 +24,7 @@ CREATE TABLE tl_job (
city varchar(100) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
level_id numeric(12) NOT NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
company_user_id numeric(12) NULL,
shortened_url_id numeric(12) NULL
......
......@@ -7,6 +7,7 @@ import java.util.Map;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
......@@ -14,6 +15,7 @@ import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.DateDiff;
import oneit.utils.MultiException;
import performa.intercom.utils.IntercomUtils;
import performa.orm.CompanyUser;
import performa.orm.Job;
......@@ -65,4 +67,19 @@ public class SaveJobFP extends SaveFP
return super.processForm(process, submission, params);
}
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = process.getAttribute("Job") != null ? (Job) process.getAttribute("Job") : (Job) request.getAttribute("Job");
Boolean openJob = (Boolean) request.getAttribute("openJob");
if(job.getJobStatus() != JobStatus.DRAFT || openJob == Boolean.TRUE)
{
BusinessObjectParser.assertFieldCondition(job.getLevel() != null, job , Job.SINGLEREFERENCE_Level, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
}
\ No newline at end of file
......@@ -359,7 +359,7 @@ public abstract class BaseJob extends BaseBusinessClass
Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "level_id");
metaInfo.put ("mandatory", "true");
metaInfo.put ("mandatory", "false");
metaInfo.put ("name", "Level");
metaInfo.put ("type", "Level");
......@@ -4373,7 +4373,6 @@ public abstract class BaseJob extends BaseBusinessClass
*/
public void setLevel (Level newLevel) throws StorageException, FieldException
{
BusinessObjectParser.assertFieldCondition (newLevel != null, this, SINGLEREFERENCE_Level, "mandatory");
if (_Level.wouldReferencedChange (newLevel))
......@@ -5518,8 +5517,6 @@ public abstract class BaseJob extends BaseBusinessClass
super.validate (context);
context.check (getLevelID() != null, this, SINGLEREFERENCE_Level, "mandatory");
}
......
......@@ -47,7 +47,7 @@
<ATTRIB name="State" type="State" dbcol="state" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="true"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" />
<SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" />
......
......@@ -849,6 +849,13 @@ span.checkbox.checked + .slider:before {-webkit-transform: translateX(18px);-ms-
margin-top: 10px;
font-weight: 500;
}
.btn.btn-primary.largeBtn.greyBtn, .btn.btn-primary.largeBtn.greyBtn:hover
{
background-color: rgba(255, 255, 255, 0.5);
border: solid 1px #dfdfdf;
color: #9b9b9b;
width: 200px;
}
.btn.btn-primary.largeBtn.grey{
background-color: #667281;
border-color: #667281;
......
......@@ -8,6 +8,7 @@
Job job = (Job) process.getAttribute("Job");
String samePage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_REVIEW);
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job");
......@@ -184,6 +185,10 @@
</oneit:recalcClass>
</div>
<div class="text-center">
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary top-margin-25 largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Review Details" name="gotoPage" cssClass="btn btn-primary top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
......
......@@ -8,6 +8,7 @@
<%
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job");
......@@ -101,6 +102,10 @@
</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(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Proceed to Role" name="gotoPage" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
......
......@@ -7,7 +7,8 @@
<%
Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job");
%>
<script>
......@@ -103,6 +104,10 @@
}
%>
<div class="text-center">
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary top-margin-37 largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Proceed to Culture" name="gotoPage" cssClass="btn btn-primary top-margin-37 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
......
......@@ -7,6 +7,7 @@
<%
Job job = (Job) process.getAttribute("Job");
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job");
......@@ -241,6 +242,10 @@
</div>
</oneit:recalcClass>
<div class="text-center">
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary top-margin-25 largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Proceed to Requirements" name="processCulture" cssClass="btn btn-primary top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("Job", job)
......
-- @AutoRun
ALTER TABLE tl_job ALTER COLUMN level_id DROP NOT NULL;
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