Commit ad689c4b by Nilu

Workflow not correct:

Create Job;
Enter Title and Description, click Save as Draft;
Return to Job from Drafts list = Role + Culture + Requirements ticked but not actually entered
Needs to return to point that process was at and resume.
See Streamline of Job Create to ensure that this is aligned to new workflow.
parent a741e3fc
......@@ -31,6 +31,7 @@
<column name="is_ppj" type="Boolean" nullable="true"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="culture_statement" type="String" nullable="true" length="2000"/>
<column name="draft_location" type="String" nullable="true" length="200"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="job_owner_id" type="Long" length="11" nullable="true"/>
......
......@@ -31,6 +31,7 @@ CREATE TABLE tl_job (
is_ppj char(1) NULL,
industry varchar(200) NULL,
culture_statement varchar(2000) NULL,
draft_location varchar(200) NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
job_owner_id numeric(12) NULL,
......
......@@ -32,6 +32,7 @@ CREATE TABLE tl_job (
is_ppj char(1) NULL,
industry varchar2(200) NULL,
culture_statement varchar2(2000) NULL,
draft_location varchar2(200) NULL,
level_id number(12) NULL,
client_id number(12) NULL,
job_owner_id number(12) NULL,
......
......@@ -32,6 +32,7 @@ CREATE TABLE tl_job (
is_ppj char(1) NULL,
industry varchar(200) NULL,
culture_statement varchar(2000) NULL,
draft_location varchar(200) NULL,
level_id numeric(12) NULL,
client_id numeric(12) NULL,
job_owner_id numeric(12) NULL,
......
......@@ -19,7 +19,7 @@ import oneit.utils.MultiException;
import oneit.utils.math.NullArith;
import performa.intercom.utils.IntercomUtils;
import performa.orm.*;
import performa.orm.types.JobStatus;
import performa.orm.types.*;
public class SaveJobFP extends SaveFP
......@@ -30,6 +30,7 @@ public class SaveJobFP extends SaveFP
HttpServletRequest request = submission.getRequest();
Job job = request.getAttribute("Job") != null ? (Job) request.getAttribute("Job") : (Job) process.getAttribute("Job");
JobStatus status = (JobStatus) request.getAttribute("JobStatus");
DraftLocation draftLocation = (DraftLocation) request.getAttribute("DraftLocation");
SecUser secUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
......@@ -79,6 +80,11 @@ public class SaveJobFP extends SaveFP
job.setLastEdited(new Date());
if(draftLocation != null)
{
job.setDraftLocation(draftLocation);
}
// restarting process as custom attributes needs to be updated to intercom
completeProcessRestartAndRestoreAttribs(process, request);
......
......@@ -145,7 +145,19 @@ public class Job extends BaseJob
public Boolean jobDetailsCompleted()
{
return getJobTitle() != null && getJobDescription() != null;
return getJobTitle() != null && getJobDescription() != null && getLevel() != null;
}
public Boolean jobAssessmentCompleted()
{
return cultureCriteriaCompleted() || getAssessmentCriteriasCount() > 0;
}
public Boolean cultureCriteriaCompleted()
{
Filter<CultureCriteria> filter = CultureCriteria.SearchByAll().andIsApplicable(new EqualsFilter<>(Boolean.TRUE));
return pipelineJob().toCultureCriterias(filter).uniqueVals().size() > 0;
}
......
......@@ -54,6 +54,7 @@
<ATTRIB name="IsPPJ" type="Boolean" dbcol="is_ppj" defaultValue="Boolean.FALSE"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="CultureStatement" type="String" dbcol="culture_statement" length="2000"/>
<ATTRIB name="DraftLocation" type="DraftLocation" dbcol="draft_location" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" backreferenceName="Jobs"/>
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class DraftLocation extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_DraftLocation = new DraftLocationFactory();
public static final DraftLocation DETAILS = new DraftLocation ("DETAILS", "DETAILS", "Details", false);
public static final DraftLocation ASSESSMENT = new DraftLocation ("ASSESSMENT", "ASSESSMENT", "Assessment", false);
public static final DraftLocation CULTURE = new DraftLocation ("CULTURE", "CULTURE", "Culture", false);
private static final DraftLocation[] allDraftLocations =
new DraftLocation[] { DETAILS,ASSESSMENT,CULTURE};
private static DraftLocation[] getAllDraftLocations ()
{
return allDraftLocations;
}
private DraftLocation (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allDraftLocations);
static
{
defineAdditionalData ();
}
public boolean isEqual (DraftLocation other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return DraftLocation.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return DraftLocation.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_DraftLocation;
}
public static DraftLocation forName (String name)
{
if (name == null) { return null; }
DraftLocation[] all = getAllDraftLocations();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static DraftLocation forValue (String value)
{
if (value == null) { return null; }
DraftLocation[] all = getAllDraftLocations();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllDraftLocations (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllDraftLocations());
}
public static DraftLocation[] getDraftLocationArray ()
{
return (DraftLocation[])getAllDraftLocations().clone ();
}
public static void defineAdditionalData ()
{
}
static class DraftLocationFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return DraftLocation.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return DraftLocation.forValue (name);
}
public Enumeration getAll ()
{
return DraftLocation.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="DraftLocation">
<VALUE name="DETAILS" description="Details" />
<VALUE name="ASSESSMENT" description="Assessment" />
<VALUE name="CULTURE" description="Culture" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -200,6 +200,7 @@
<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("DraftLocation", DraftLocation.ASSESSMENT)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Proceed to Culture" name="gotoPage" cssClass="btn btn-primary top-margin-25 largeBtn"
......
......@@ -15,37 +15,38 @@
boolean fromJobMatch = pageNumber == "1";
%>
<oneit:dynIncluded>
<div class="main-tab-form job-main-tabs">
<ul class="nav nav-pills nav-justified">
<li class="<%= pageNumber == "1" ? "active" : CollectionUtils.equals(job.getCompletedDetails(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<li class="<%= pageNumber == "1" ? "active" : job.jobDetailsCompleted() ? "complate" : ""%>">
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", firstPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("fromJobMatch", fromJobMatch)
.toMap() %>">
<span><%= CollectionUtils.equals(job.getCompletedDetails(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
<span><%= job.jobDetailsCompleted() ? "<img src=\"images/right-mark.png\" />" : "1"%></span>
Job Detail
</oneit:button>
</li>
<li class="<%= pageNumber == "2" ? "active" : CollectionUtils.equals(job.getCompletedRequirements(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<li class="<%= pageNumber == "2" ? "active" : job.jobAssessmentCompleted() ? "complate" : ""%>">
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("fromJobMatch", fromJobMatch)
.toMap() %>">
<span><%= CollectionUtils.equals(job.getCompletedRequirements(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "2"%></span>
<span><%= job.jobAssessmentCompleted() ? "<img src=\"images/right-mark.png\" />" : "2"%></span>
Requirements
</oneit:button>
</li>
<li class="<%= pageNumber == "3" ? "active" : CollectionUtils.equals(job.getCompletedCulture(), Boolean.TRUE) || savedJob ? "complate" : ""%>">
<li class="<%= pageNumber == "3" ? "active" : job.cultureCriteriaCompleted() ? "complate" : ""%>">
<oneit:button value=" " name="processCulture" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("fromJobMatch", fromJobMatch)
.toMap() %>">
<span><%= CollectionUtils.equals(job.getCompletedCulture(), Boolean.TRUE) || savedJob ? "<img src=\"images/right-mark.png\" />" : "3"%></span>
<span><%= job.cultureCriteriaCompleted() ? "<img src=\"images/right-mark.png\" />" : "3"%></span>
Culture
</oneit:button>
</li>
......
......@@ -8,9 +8,28 @@
Job job = (Job) process.getAttribute("Job");
int shortlisted = job.getNoOfCandidatesShortlisted();
String editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB);
String reviewPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_REVIEW);
String sharePage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATED_JOB);
String jobPage = WebUtils.getSamePageInRenderMode(request, (shortlisted > 0 ? WebUtils.APPLICANTS_SHORTLIST : WebUtils.VIEW_APPLICANTS));
if(job.getJobStatus() == JobStatus.DRAFT)
{
if(job.getDraftLocation() == null)
{
editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.JOB_REVIEW);
}
else if(job.getDraftLocation() == DraftLocation.DETAILS)
{
editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.CREATE_JOB);
}
else if(job.getDraftLocation() == DraftLocation.ASSESSMENT)
{
editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
}
else if(job.getDraftLocation() == DraftLocation.CULTURE)
{
editJobPage = WebUtils.getSamePageInRenderMode(request, WebUtils.WORKPLACE_CULTURE);
}
}
%>
<oneit:dynIncluded>
......@@ -86,11 +105,13 @@
<oneit:button value="Share" cssClass="<%= job.getJobStatus() != JobStatus.OPEN ? "leftbtn disabled" : "leftbtn"%>" name="gotoPage" skin="link"
disabled="<%= job.getJobStatus() != JobStatus.OPEN ? "true" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", sharePage + "&JobID=" + job.getObjectID())
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
.mapEntry("cancelProcess", true)
.toMap() %>"/>
<oneit:button value=" " cssClass="rightbtn" name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", (job.getJobStatus() == JobStatus.DRAFT ? reviewPage : editJobPage) + "&JobID=" + job.getObjectID())
.mapEntry("cancelProcess", true)
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", editJobPage + "&JobID=" + job.getObjectID())
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).toMap())
// .mapEntry("cancelProcess", true)
.toMap() %>">
EDIT
<span><img src="images/edit-dropdown-arrow.svg" /></span>
......
......@@ -276,6 +276,7 @@
</div>
<oneit:button value="Save as draft" name="saveJob" cssClass="btn btn-primary largeBtn greyBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", jobPage)
.mapEntry("DraftLocation", DraftLocation.DETAILS)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Proceed to Requirements" name="processCulture" cssClass="btn btn-primary largeBtn"
......
......@@ -69,9 +69,7 @@
}
else
{
System.out.println("getting from session :: ");
selectedClient = (Client) session.getAttribute("Client");
System.out.println("getting from session selectedClient :: " + selectedClient);
}
session.setAttribute("Client", selectedClient);
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS name="" xmlns:oneit="http://www.1iT.com.au">
<NODE name="Script" factory="Vector">
<NODE name="DDL" factory="Participant" class="oneit.sql.transfer.RedefineTableOperation">
<tableName factory="String">tl_job</tableName>
<column name="draft_location" type="String" nullable="true" length="200"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -239,6 +239,7 @@
<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("DraftLocation", DraftLocation.CULTURE)
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<oneit:button value="Review Job Details" name="processCulture" cssClass="btn btn-primary top-margin-25 largeBtn"
......
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