Commit 9ec2a80e by Nilu

adding job templates and culture templates

parent 30c3c027
...@@ -9,10 +9,29 @@ ...@@ -9,10 +9,29 @@
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="template_name" type="String" nullable="true" length="100"/> <column name="template_name" type="String" nullable="true" length="100"/>
<column name="user_id" type="Long" length="11" nullable="true"/> <column name="job_title" type="String" nullable="false" length="30"/>
<column name="job_description" type="CLOB" nullable="false"/>
<column name="ref_number" type="String" nullable="true" length="10"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="location_radius" type="String" nullable="false" length="200"/>
<column name="remote" type="Boolean" nullable="true"/>
<column name="job_type" type="String" nullable="false" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="require_cv" type="Boolean" nullable="true"/>
<column name="assessment_type" type="String" nullable="false" length="200"/>
<column name="include_assessment_criteria" type="Boolean" nullable="false"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="occupation_id" type="Long" length="11" nullable="false"/>
<column name="job_owner_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateName" isUnique="true"><column name="template_name"/><column name="user_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE>
......
...@@ -9,10 +9,15 @@ ...@@ -9,10 +9,15 @@
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/> <column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/> <column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="template_name" type="String" nullable="true" length="100"/> <column name="template_name" type="String" nullable="true" length="100"/>
<column name="user_id" type="Long" length="11" nullable="true"/> <column name="culture_statement" type="String" nullable="true" length="2000"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_template" indexName="idx_tl_culture_template_TemplateName" isUnique="true"><column name="template_name"/><column name="user_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_template" indexName="idx_tl_culture_template_TemplateID" isUnique="true"><column name="template_name"/><column name="hiring_team_id"/><column name="company_user_id"/></NODE>
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<column name="hiring_team_id" type="Long" length="11" nullable="true"/> <column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="occupation_id" type="Long" length="11" nullable="false"/> <column name="occupation_id" type="Long" length="11" nullable="false"/>
<column name="shortened_url_id" type="Long" length="11" nullable="true"/> <column name="shortened_url_id" type="Long" length="11" nullable="true"/>
<column name="template_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_job" indexName="idx_tl_job_client_id" isUnique="false"><column name="client_id"/></NODE>
......
...@@ -11,9 +11,12 @@ ...@@ -11,9 +11,12 @@
<column name="name" type="String" nullable="false" length="20"/> <column name="name" type="String" nullable="false" length="20"/>
<column name="sort_order" type="Long" nullable="false"/> <column name="sort_order" type="Long" nullable="false"/>
<column name="application_status" type="String" nullable="false" length="200"/> <column name="application_status" type="String" nullable="false" length="200"/>
<column name="job_id" type="Long" length="11" nullable="false"/> <column name="job_id" type="Long" length="11" nullable="true"/>
<column name="template_id" type="Long" length="11" nullable="true"/>
</NODE> </NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_work_flow" indexName="idx_tl_work_flow_job_id" isUnique="false"><column name="job_id"/></NODE> <NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_work_flow" indexName="idx_tl_work_flow_job_id" isUnique="false"><column name="job_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_work_flow" indexName="idx_tl_work_flow_template_id" isUnique="false"><column name="template_id"/></NODE>
</NODE></OBJECTS> </NODE></OBJECTS>
\ No newline at end of file
...@@ -9,7 +9,24 @@ CREATE TABLE tl_assessment_template ( ...@@ -9,7 +9,24 @@ CREATE TABLE tl_assessment_template (
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
template_name varchar(100) NULL, template_name varchar(100) NULL,
user_id numeric(12) NULL job_title varchar(30) NOT NULL,
job_description text NOT NULL,
ref_number varchar(10) NULL,
google_address_text varchar(300) NULL,
location_radius varchar(200) NOT NULL,
remote char(1) NULL,
job_type varchar(200) NOT NULL,
industry varchar(200) NULL,
require_cv char(1) NULL,
assessment_type varchar(200) NOT NULL,
include_assessment_criteria char(1) NOT NULL,
level_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL,
job_owner_id numeric(12) NULL,
job_id numeric(12) NULL,
client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -22,6 +39,6 @@ ALTER TABLE tl_assessment_template ADD ...@@ -22,6 +39,6 @@ ALTER TABLE tl_assessment_template ADD
CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateID ON
tl_assessment_template (template_name, user_id); tl_assessment_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -9,7 +9,10 @@ CREATE TABLE tl_culture_template ( ...@@ -9,7 +9,10 @@ CREATE TABLE tl_culture_template (
object_created_date datetime DEFAULT getdate() NOT NULL object_created_date datetime DEFAULT getdate() NOT NULL
, ,
template_name varchar(100) NULL, template_name varchar(100) NULL,
user_id numeric(12) NULL culture_statement varchar(2000) NULL,
client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -22,6 +25,6 @@ ALTER TABLE tl_culture_template ADD ...@@ -22,6 +25,6 @@ ALTER TABLE tl_culture_template ADD
CREATE UNIQUE INDEX idx_tl_culture_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_culture_template_TemplateID ON
tl_culture_template (template_name, user_id); tl_culture_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -39,7 +39,8 @@ CREATE TABLE tl_job ( ...@@ -39,7 +39,8 @@ CREATE TABLE tl_job (
company_user_id numeric(12) NULL, company_user_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL
); );
......
...@@ -11,7 +11,8 @@ CREATE TABLE tl_work_flow ( ...@@ -11,7 +11,8 @@ CREATE TABLE tl_work_flow (
name varchar(20) NOT NULL, name varchar(20) NOT NULL,
sort_order numeric(12) NOT NULL, sort_order numeric(12) NOT NULL,
application_status varchar(200) NOT NULL, application_status varchar(200) NOT NULL,
job_id numeric(12) NOT NULL job_id numeric(12) NULL,
template_id numeric(12) NULL
); );
...@@ -26,3 +27,6 @@ ALTER TABLE tl_work_flow ADD ...@@ -26,3 +27,6 @@ ALTER TABLE tl_work_flow ADD
CREATE INDEX idx_tl_work_flow_job_id CREATE INDEX idx_tl_work_flow_job_id
ON tl_work_flow (job_id); ON tl_work_flow (job_id);
CREATE INDEX idx_tl_work_flow_template_id
ON tl_work_flow (template_id);
...@@ -10,7 +10,24 @@ CREATE TABLE tl_assessment_template ( ...@@ -10,7 +10,24 @@ CREATE TABLE tl_assessment_template (
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
template_name varchar2(100) NULL, template_name varchar2(100) NULL,
user_id number(12) NULL job_title varchar2(30) NOT NULL,
job_description clob NOT NULL,
ref_number varchar2(10) NULL,
google_address_text varchar2(300) NULL,
location_radius varchar2(200) NOT NULL,
remote char(1) NULL,
job_type varchar2(200) NOT NULL,
industry varchar2(200) NULL,
require_cv char(1) NULL,
assessment_type varchar2(200) NOT NULL,
include_assessment_criteria char(1) NOT NULL,
level_id number(12) NULL,
occupation_id number(12) NOT NULL,
job_owner_id number(12) NULL,
job_id number(12) NULL,
client_id number(12) NULL,
hiring_team_id number(12) NULL,
company_user_id number(12) NULL
); );
...@@ -23,6 +40,6 @@ ALTER TABLE tl_assessment_template ADD ...@@ -23,6 +40,6 @@ ALTER TABLE tl_assessment_template ADD
CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateID ON
tl_assessment_template (template_name, user_id); tl_assessment_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -10,7 +10,10 @@ CREATE TABLE tl_culture_template ( ...@@ -10,7 +10,10 @@ CREATE TABLE tl_culture_template (
object_created_date date DEFAULT SYSDATE NOT NULL object_created_date date DEFAULT SYSDATE NOT NULL
, ,
template_name varchar2(100) NULL, template_name varchar2(100) NULL,
user_id number(12) NULL culture_statement varchar2(2000) NULL,
client_id number(12) NULL,
hiring_team_id number(12) NULL,
company_user_id number(12) NULL
); );
...@@ -23,6 +26,6 @@ ALTER TABLE tl_culture_template ADD ...@@ -23,6 +26,6 @@ ALTER TABLE tl_culture_template ADD
CREATE UNIQUE INDEX idx_tl_culture_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_culture_template_TemplateID ON
tl_culture_template (template_name, user_id); tl_culture_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -40,7 +40,8 @@ CREATE TABLE tl_job ( ...@@ -40,7 +40,8 @@ CREATE TABLE tl_job (
company_user_id number(12) NULL, company_user_id number(12) NULL,
hiring_team_id number(12) NULL, hiring_team_id number(12) NULL,
occupation_id number(12) NOT NULL, occupation_id number(12) NOT NULL,
shortened_url_id number(12) NULL shortened_url_id number(12) NULL,
template_id number(12) NULL
); );
......
...@@ -12,7 +12,8 @@ CREATE TABLE tl_work_flow ( ...@@ -12,7 +12,8 @@ CREATE TABLE tl_work_flow (
name varchar2(20) NOT NULL, name varchar2(20) NOT NULL,
sort_order number(12) NOT NULL, sort_order number(12) NOT NULL,
application_status varchar2(200) NOT NULL, application_status varchar2(200) NOT NULL,
job_id number(12) NOT NULL job_id number(12) NULL,
template_id number(12) NULL
); );
...@@ -27,3 +28,6 @@ ALTER TABLE tl_work_flow ADD ...@@ -27,3 +28,6 @@ ALTER TABLE tl_work_flow ADD
CREATE INDEX idx_tl_work_flow_job_id CREATE INDEX idx_tl_work_flow_job_id
ON tl_work_flow (job_id); ON tl_work_flow (job_id);
CREATE INDEX idx_tl_work_flow_template_id
ON tl_work_flow (template_id);
...@@ -10,7 +10,24 @@ CREATE TABLE tl_assessment_template ( ...@@ -10,7 +10,24 @@ CREATE TABLE tl_assessment_template (
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
template_name varchar(100) NULL, template_name varchar(100) NULL,
user_id numeric(12) NULL job_title varchar(30) NOT NULL,
job_description text NOT NULL,
ref_number varchar(10) NULL,
google_address_text varchar(300) NULL,
location_radius varchar(200) NOT NULL,
remote char(1) NULL,
job_type varchar(200) NOT NULL,
industry varchar(200) NULL,
require_cv char(1) NULL,
assessment_type varchar(200) NOT NULL,
include_assessment_criteria char(1) NOT NULL,
level_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL,
job_owner_id numeric(12) NULL,
job_id numeric(12) NULL,
client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -23,6 +40,6 @@ ALTER TABLE tl_assessment_template ADD ...@@ -23,6 +40,6 @@ ALTER TABLE tl_assessment_template ADD
CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_assessment_template_TemplateID ON
tl_assessment_template (template_name, user_id); tl_assessment_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -10,7 +10,10 @@ CREATE TABLE tl_culture_template ( ...@@ -10,7 +10,10 @@ CREATE TABLE tl_culture_template (
object_created_date timestamp DEFAULT NOW() NOT NULL object_created_date timestamp DEFAULT NOW() NOT NULL
, ,
template_name varchar(100) NULL, template_name varchar(100) NULL,
user_id numeric(12) NULL culture_statement varchar(2000) NULL,
client_id numeric(12) NULL,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
); );
...@@ -23,6 +26,6 @@ ALTER TABLE tl_culture_template ADD ...@@ -23,6 +26,6 @@ ALTER TABLE tl_culture_template ADD
CREATE UNIQUE INDEX idx_tl_culture_template_TemplateName ON CREATE UNIQUE INDEX idx_tl_culture_template_TemplateID ON
tl_culture_template (template_name, user_id); tl_culture_template (template_name, hiring_team_id, company_user_id);
\ No newline at end of file
...@@ -40,7 +40,8 @@ CREATE TABLE tl_job ( ...@@ -40,7 +40,8 @@ CREATE TABLE tl_job (
company_user_id numeric(12) NULL, company_user_id numeric(12) NULL,
hiring_team_id numeric(12) NULL, hiring_team_id numeric(12) NULL,
occupation_id numeric(12) NOT NULL, occupation_id numeric(12) NOT NULL,
shortened_url_id numeric(12) NULL shortened_url_id numeric(12) NULL,
template_id numeric(12) NULL
); );
......
...@@ -12,7 +12,8 @@ CREATE TABLE tl_work_flow ( ...@@ -12,7 +12,8 @@ CREATE TABLE tl_work_flow (
name varchar(20) NOT NULL, name varchar(20) NOT NULL,
sort_order numeric(12) NOT NULL, sort_order numeric(12) NOT NULL,
application_status varchar(200) NOT NULL, application_status varchar(200) NOT NULL,
job_id numeric(12) NOT NULL job_id numeric(12) NULL,
template_id numeric(12) NULL
); );
...@@ -27,3 +28,6 @@ ALTER TABLE tl_work_flow ADD ...@@ -27,3 +28,6 @@ ALTER TABLE tl_work_flow ADD
CREATE INDEX idx_tl_work_flow_job_id CREATE INDEX idx_tl_work_flow_job_id
ON tl_work_flow (job_id); ON tl_work_flow (job_id);
CREATE INDEX idx_tl_work_flow_template_id
ON tl_work_flow (template_id);
...@@ -20,18 +20,19 @@ public class ChangeAssessmentCriteriaFP extends ORMProcessFormProcessor ...@@ -20,18 +20,19 @@ public class ChangeAssessmentCriteriaFP extends ORMProcessFormProcessor
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
AssessmentCriteriaTemplate template = (AssessmentCriteriaTemplate) request.getAttribute("AssessmentCriteriaTemplate");
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside ChangeAssessmentCriteriaFP for ", job, " Include Assessment:", job.getIncludeAssessmentCriteria()); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside ChangeAssessmentCriteriaFP for ", job != null ? job : template , " Include Assessment:", job != null ? job.getIncludeAssessmentCriteria() : template.getIncludeAssessmentCriteria());
if(!job.isTrue(job.getIncludeAssessmentCriteria())) if(job != null ? !job.isTrue(job.getIncludeAssessmentCriteria()) : !template.isTrue(template.getIncludeAssessmentCriteria()))
{ {
for(AssessmentCriteria assessmentCriteria : job.getAssessmentCriteriasSet()) for(AssessmentCriteria assessmentCriteria : job != null ? job.getAssessmentCriteriasSet() : template.getAssessmentCriteriasSet())
{ {
assessmentCriteria.delete(); assessmentCriteria.delete();
} }
} }
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "ChangeAssessmentCriteriaFP completed for ", job); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "ChangeAssessmentCriteriaFP completed for ", job != null ? job : template);
return RedisplayResult.getInstance(); return RedisplayResult.getInstance();
} }
......
...@@ -25,13 +25,16 @@ public class LoadJobFromTemplateFP extends ORMProcessFormProcessor ...@@ -25,13 +25,16 @@ public class LoadJobFromTemplateFP extends ORMProcessFormProcessor
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job"); Job job = (Job) request.getAttribute("Job");
Job jobTemplate = job.getJobTemplate(); AssessmentCriteriaTemplate jobTemplate = job.getAssessmentTemplate();
if(jobTemplate != null)
{
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside LoadJobFromTemplateFP for ", job, " load from template:", jobTemplate); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside LoadJobFromTemplateFP for ", job, " load from template:", jobTemplate);
Utils.setupJobFromTemplate(job, jobTemplate); Utils.setupJobFromTemplate(job, jobTemplate, process.getTransaction());
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadJobFromTemplateFP completed for ", job); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "LoadJobFromTemplateFP completed for ", job);
}
return RedisplayResult.getInstance(); return RedisplayResult.getInstance();
} }
......
...@@ -4,58 +4,58 @@ import java.util.Map; ...@@ -4,58 +4,58 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel; import oneit.logging.LogLevel;
import oneit.logging.LogMgr; import oneit.logging.LogMgr;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser; import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.NavigationFP;
import oneit.servlets.forms.SubmissionDetails; import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult; import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessFormProcessor;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.ProcessRedirectResult;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
import oneit.utils.MultiException; import oneit.utils.MultiException;
import performa.orm.Job; import performa.orm.Job;
import performa.utils.Utils; import performa.utils.Utils;
public class NavigateToCreateJobFP extends NavigationFP public class NavigateToCreateJobFP extends ORMProcessFormProcessor
{ {
@Override @Override
public SuccessfulResult processForm(SubmissionDetails submission) throws BusinessException protected Map validate(SubmissionDetails submission, MultiException exceptions)
{ {
HttpServletRequest request = submission.getRequest(); HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute ("Job"); Job job = (Job) request.getAttribute ("Job");
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In NavigateToCreateJobFP navigating to create job with from template : ", job.getFromTemplate()); if(job != null && job.isTrue(job.getFromTemplate()))
if(job.isTrue(job.getFromTemplate()))
{ {
BusinessObjectParser.assertFieldCondition(job.getAssessmentTemplate() != null , job, Job.SINGLEREFERENCE_AssessmentTemplate, "mandatory", exceptions, true, request);
}
return super.validate(submission, exceptions);
} }
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map map) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute ("Job");
String nextPage = (String) request.getAttribute("nextPage");
LogMgr.log(Job.LOG, LogLevel.PROCESSING1,"In NavigateToCreateJobFP navigating to create job with from template : ", job.getFromTemplate());
if(job.isTrue(job.getFromTemplate())) if(job.isTrue(job.getFromTemplate()))
{ {
if(job.getJobTemplate() == null) if(job.getAssessmentTemplate() == null)
{ {
throw new BusinessException("Please select a template before starting the job"); throw new BusinessException("Please select a template before starting the job");
} }
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside NavigateToCreateJobFP for ", job, " load from template:", job.getJobTemplate()); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "Inside NavigateToCreateJobFP for ", job, " load from template:", job.getAssessmentTemplate());
Utils.setupJobFromTemplate(job, job.getJobTemplate()); Utils.setupJobFromTemplate(job, job.getAssessmentTemplate(), process.getTransaction());
LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "NavigateToCreateJobFP completed for ", job); LogMgr.log(Job.LOG, LogLevel.PROCESSING1, "NavigateToCreateJobFP completed for ", job);
} }
return super.processForm(submission); return new ProcessRedirectResult (nextPage, new String[]{});
}
@Override
protected Map validate(SubmissionDetails submission, MultiException exceptions)
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute ("Job");
if(job != null && job.isTrue(job.getFromTemplate()))
{
BusinessObjectParser.assertFieldCondition(job.getJobTemplate() != null , job, Job.SINGLEREFERENCE_JobTemplate, "mandatory", exceptions, true, request);
}
return super.validate(submission, exceptions);
} }
} }
...@@ -15,6 +15,7 @@ import oneit.servlets.process.ORMProcessFormProcessor; ...@@ -15,6 +15,7 @@ import oneit.servlets.process.ORMProcessFormProcessor;
import oneit.servlets.process.ORMProcessState; import oneit.servlets.process.ORMProcessState;
import oneit.servlets.utils.NotificationUtils; import oneit.servlets.utils.NotificationUtils;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.CompanyUser;
import performa.orm.CultureCriteria; import performa.orm.CultureCriteria;
import performa.orm.CultureCriteriaTemplate; import performa.orm.CultureCriteriaTemplate;
import performa.orm.Job; import performa.orm.Job;
...@@ -39,8 +40,12 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor ...@@ -39,8 +40,12 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor
objTran.runInNewTX((ObjectTransaction newObjTran) -> { objTran.runInNewTX((ObjectTransaction newObjTran) -> {
CultureCriteriaTemplate newTemplate = CultureCriteriaTemplate.createCultureCriteriaTemplate(newObjTran); CultureCriteriaTemplate newTemplate = CultureCriteriaTemplate.createCultureCriteriaTemplate(newObjTran);
SecUser secUser = SecUser.getTXUser(newObjTran);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
newTemplate.setUser(SecUser.getTXUser(newObjTran)); newTemplate.setCompanyUser(companyUser);
newTemplate.setClient(job.getClient().getInTransaction(newObjTran));
newTemplate.setHiringTeam(job.getHiringTeam().getInTransaction(newObjTran));
newTemplate.setTemplateName(job.getCultureTemplateName()); newTemplate.setTemplateName(job.getCultureTemplateName());
for(CultureCriteria criteria : job.getCultureCriteriasSet()) for(CultureCriteria criteria : job.getCultureCriteriasSet())
...@@ -77,9 +82,10 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor ...@@ -77,9 +82,10 @@ public class SaveCultureTemplateFP extends ORMProcessFormProcessor
for(CultureCriteria criteria: job.getCultureCriteriasSet()) for(CultureCriteria criteria: job.getCultureCriteriasSet())
{ {
if(criteria.isRatingRequired()) if(criteria.getIsApplicable())
{ {
BusinessObjectParser.assertFieldCondition(criteria.getCultureElementRating() != null, criteria , CultureCriteria.SINGLEREFERENCE_CultureElementRating, "mandatory", exceptions, true, request); BusinessObjectParser.assertFieldCondition(criteria.getCultureElementRating() != null, criteria , CultureCriteria.SINGLEREFERENCE_CultureElementRating, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(criteria.getImportance() != null, criteria , CultureCriteria.FIELD_Importance, "mandatory", exceptions, true, request);
} }
} }
......
...@@ -16,7 +16,9 @@ import oneit.servlets.process.ORMProcessState; ...@@ -16,7 +16,9 @@ import oneit.servlets.process.ORMProcessState;
import oneit.utils.*; import oneit.utils.*;
import performa.orm.AssessmentCriteria; import performa.orm.AssessmentCriteria;
import performa.orm.AssessmentCriteriaTemplate; import performa.orm.AssessmentCriteriaTemplate;
import performa.orm.CompanyUser;
import performa.orm.Job; import performa.orm.Job;
import performa.orm.WorkFlow;
/** /**
* *
...@@ -36,9 +38,38 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor ...@@ -36,9 +38,38 @@ public class SaveRequirementsTemplateFP extends ORMProcessFormProcessor
objTran.runInNewTX((ObjectTransaction newObjTran) -> { objTran.runInNewTX((ObjectTransaction newObjTran) -> {
AssessmentCriteriaTemplate newTemplate = AssessmentCriteriaTemplate.createAssessmentCriteriaTemplate(newObjTran); AssessmentCriteriaTemplate newTemplate = AssessmentCriteriaTemplate.createAssessmentCriteriaTemplate(newObjTran);
SecUser secUser = SecUser.getTXUser(newObjTran);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
newTemplate.setUser(SecUser.getTXUser(newObjTran)); newTemplate.setCompanyUser(companyUser);
newTemplate.setTemplateName(job.getAssessmentTemplateName()); newTemplate.setTemplateName(job.getAssessmentTemplateName());
newTemplate.setHiringTeam(job.getHiringTeam().getInTransaction(newObjTran));
newTemplate.setJobTitle(job.getJobTitle());
newTemplate.setReferenceNumber(job.getReferenceNumber());
newTemplate.setJobDescription(job.getJobDescription());
newTemplate.setJobOwner(job.getJobOwner().getInTransaction(newObjTran));
newTemplate.setClient(job.getClient().getInTransaction(newObjTran));
newTemplate.setGoogleAddressText(job.getGoogleAddressText());
newTemplate.setExpectedCandidateRadius(job.getExpectedCandidateRadius());
newTemplate.setRemote(job.getRemote());
newTemplate.setJobType(job.getJobType());
newTemplate.setIndustry(job.getIndustry());
newTemplate.setOccupation(job.getOccupation().getInTransaction(newObjTran));
newTemplate.setRequireCV(job.getRequireCV());
newTemplate.setAssessmentType(job.getAssessmentType());
newTemplate.setLevel(job.getLevel().getInTransaction(newObjTran));
for (WorkFlow workflow : job.getWorkFlowsSet())
{
WorkFlow workflowCopy = WorkFlow.createWorkFlow(newObjTran);
workflowCopy.copyAttributesFrom(workflow);
newTemplate.addToWorkFlows(workflowCopy);
}
for (AssessmentCriteria criteria : job.getAssessmentCriteriasSet()) for (AssessmentCriteria criteria : job.getAssessmentCriteriasSet())
{ {
......
package performa.orm; package performa.orm;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.GreaterThanFilter;
import oneit.objstore.rdbms.filters.LessThanFilter;
import oneit.objstore.utils.ObjstoreUtils;
import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform;
import oneit.utils.filter.CollectionFilter;
import oneit.utils.filter.Filter;
import performa.orm.types.AssessmentType;
import performa.orm.types.CriteriaType;
public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
{ {
...@@ -17,4 +31,65 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate ...@@ -17,4 +31,65 @@ public class AssessmentCriteriaTemplate extends BaseAssessmentCriteriaTemplate
{ {
return getTemplateName(); return getTemplateName();
} }
public List<WorkFlow> getSortedMiddleWorkFlows()
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new LessThanFilter<>(9)).andSortOrder(new GreaterThanFilter<>(1));
return ObjstoreUtils.sort(pipelineAssessmentCriteriaTemplate().toWorkFlows(filter).uniqueVals(),
new ObjectTransform[]{WorkFlow.pipesWorkFlow().toSortOrder()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
public WorkFlow getWorkFlowBySortOrder(int sortOrder)
{
Filter<WorkFlow> filter = WorkFlow.SearchByAll().andSortOrder(new EqualsFilter<>(sortOrder));
return pipelineAssessmentCriteriaTemplate().toWorkFlows(filter).val();
}
public String getLevelClass(Level level)
{
if(!showLevelOption(level))
{
return "hide";
}
if(CollectionUtils.equals(level, getLevel()))
{
return "active";
}
return "";
}
public boolean showLevelOption(Level level)
{
if(isExpressJob())
{
return isTrue(level.getAppliedToExpress());
}
return !isTrue(level.getAppliedToExpress());
}
public boolean isExpressJob()
{
return getAssessmentType() == AssessmentType.EXPRESS;
}
public boolean showAssessmentCriteriaSection()
{
return isTrue(getIncludeAssessmentCriteria());
}
public Collection<AssessmentCriteria> getAssessmentCriteraByType(CriteriaType criteria)
{
Filter filter = AssessmentCriteria.SearchByAll().andCriteriaType(new EqualsFilter<>(criteria));
return CollectionFilter.filter(getAssessmentCriteriasSet(), filter);
}
public int getAssessmentCriteraCountByType(CriteriaType criteria)
{
return getAssessmentCriteraByType(criteria).size();
}
} }
\ No newline at end of file
...@@ -4,26 +4,41 @@ ...@@ -4,26 +4,41 @@
<BUSINESSCLASS name="AssessmentCriteriaTemplate" package="performa.orm"> <BUSINESSCLASS name="AssessmentCriteriaTemplate" package="performa.orm">
<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" />
<TABLE name="tl_assessment_template" tablePrefix="object" polymorphic="FALSE"> <TABLE name="tl_assessment_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="TemplateName" type="String" dbcol="template_name" length="100" uniqueGroup="TemplateName"/> <ATTRIB name="TemplateName" type="String" dbcol="template_name" length="100" uniqueGroup="TemplateID"/>
<ATTRIB name="JobTitle" type="String" dbcol="job_title" length="30" mandatory="true"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" uniqueGroup="TemplateName"/> <ATTRIB name="JobDescription" type="String" dbcol="job_description" mandatory="true"/>
<ATTRIB name="ReferenceNumber" type="String" dbcol="ref_number" length="10"/>
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300" />
<ATTRIB name="ExpectedCandidateRadius" type="LocationRadius" dbcol="location_radius" defaultValue="LocationRadius.KM100" attribHelper="EnumeratedAttributeHelper" mandatory="true"/>
<ATTRIB name="Remote" type="Boolean" dbcol="remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="JobType" type="JobType" dbcol="job_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="JobType.FULL_TIME"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="RequireCV" type="Boolean" dbcol="require_cv" defaultValue="Boolean.FALSE"/>
<ATTRIB name="AssessmentType" type="AssessmentType" dbcol="assessment_type" attribHelper="EnumeratedAttributeHelper" mandatory="true" defaultValue="AssessmentType.COMPREHENSIVE"/>
<ATTRIB name="IncludeAssessmentCriteria" type="Boolean" dbcol="include_assessment_criteria" mandatory="true" defaultValue="Boolean.TRUE"/>
<SINGLEREFERENCE name="Level" type="Level" dbcol="level_id" mandatory="false"/>
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/>
<SINGLEREFERENCE name="JobOwner" type="CompanyUser" dbcol="job_owner_id" />
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" />
<SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/>
</TABLE> </TABLE>
<SEARCH type="All" paramFilter="tl_assessment_template.object_id is not null" orderBy="tl_assessment_template.object_id" /> <SEARCH type="All" paramFilter="tl_assessment_template.object_id is not null" orderBy="tl_assessment_template.object_id" />
<SEARCH type="Company" paramFilter="tl_assessment_template.object_id is not null" orderBy="tl_assessment_template.object_id">
<TABLE name="oneit_sec_user_extension" join="oneit_sec_user_extension.user_id = tl_assessment_template.user_id"/>
<TABLE name="tl_company" join="tl_company.object_id = oneit_sec_user_extension.company_id"/>
<PARAM name="Company" type="Company" transform="Company.getObjectID ()" paramFilter="tl_company.object_id = ${Company}"/>
</SEARCH>
</BUSINESSCLASS> </BUSINESSCLASS>
</ROOT> </ROOT>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -886,7 +886,6 @@ public abstract class BaseHiringTeam extends BaseBusinessClass ...@@ -886,7 +886,6 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
Map metaInfo = new HashMap (); Map metaInfo = new HashMap ();
metaInfo.put ("dbcol", "is_ppj"); metaInfo.put ("dbcol", "is_ppj");
metaInfo.put ("defaultValue", "Boolean.TRUE");
metaInfo.put ("name", "IsPPJ"); metaInfo.put ("name", "IsPPJ");
metaInfo.put ("type", "Boolean"); metaInfo.put ("type", "Boolean");
...@@ -1039,7 +1038,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass ...@@ -1039,7 +1038,7 @@ public abstract class BaseHiringTeam extends BaseBusinessClass
_PlanRenewedOn = (Date)(HELPER_PlanRenewedOn.initialise (_PlanRenewedOn)); _PlanRenewedOn = (Date)(HELPER_PlanRenewedOn.initialise (_PlanRenewedOn));
_UsedCredits = (Integer)(HELPER_UsedCredits.initialise (_UsedCredits)); _UsedCredits = (Integer)(HELPER_UsedCredits.initialise (_UsedCredits));
_AvailableCredits = (Integer)(HELPER_AvailableCredits.initialise (_AvailableCredits)); _AvailableCredits = (Integer)(HELPER_AvailableCredits.initialise (_AvailableCredits));
_IsPPJ = (Boolean)(Boolean.TRUE); _IsPPJ = (Boolean)(HELPER_IsPPJ.initialise (_IsPPJ));
_HasCap = (Boolean)(Boolean.FALSE); _HasCap = (Boolean)(Boolean.FALSE);
_MaxCap = (Integer)(HELPER_MaxCap.initialise (_MaxCap)); _MaxCap = (Integer)(HELPER_MaxCap.initialise (_MaxCap));
_CouponExpiryDate = (Date)(HELPER_CouponExpiryDate.initialise (_CouponExpiryDate)); _CouponExpiryDate = (Date)(HELPER_CouponExpiryDate.initialise (_CouponExpiryDate));
......
package performa.orm; package performa.orm;
import java.util.Collection;
import java.util.Comparator;
import java.util.Set;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.InFilter;
import oneit.objstore.utils.ObjstoreUtils;
import oneit.utils.CollectionUtils;
import oneit.utils.ObjectTransform;
import oneit.utils.filter.Filter;
import performa.orm.types.CultureClass;
public class CultureCriteriaTemplate extends BaseCultureCriteriaTemplate public class CultureCriteriaTemplate extends BaseCultureCriteriaTemplate
{ {
...@@ -17,4 +28,18 @@ public class CultureCriteriaTemplate extends BaseCultureCriteriaTemplate ...@@ -17,4 +28,18 @@ public class CultureCriteriaTemplate extends BaseCultureCriteriaTemplate
{ {
return getTemplateName(); return getTemplateName();
} }
public Collection<CultureCriteria> getCultureCriteriasForClass(CultureClass cultureClass)
{
Filter elementFilter = CultureElement.SearchByAll().andCultureClass(new EqualsFilter(cultureClass));
Set<CultureElement> cultureElements = pipelineCultureCriteriaTemplate().toCultureCriterias().toCultureElement(elementFilter).uniqueVals();
Filter criteriaFilter = CultureCriteria.SearchByAll().andCultureElement(new InFilter(cultureElements));
return ObjstoreUtils.sort(pipelineCultureCriteriaTemplate().toCultureCriterias(criteriaFilter).vals(),
new ObjectTransform[]{CultureCriteria.pipesCultureCriteria().toObjectID()},
new Comparator[]{CollectionUtils.DEFAULT_COMPARATOR_NULLS_FIRST});
}
} }
\ No newline at end of file
...@@ -10,20 +10,17 @@ ...@@ -10,20 +10,17 @@
<TABLE name="tl_culture_template" tablePrefix="object" polymorphic="FALSE"> <TABLE name="tl_culture_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="TemplateName" type="String" dbcol="template_name" length="100" uniqueGroup="TemplateName"/> <ATTRIB name="TemplateName" type="String" dbcol="template_name" length="100" uniqueGroup="TemplateID"/>
<ATTRIB name="CultureStatement" type="String" dbcol="culture_statement" length="2000"/>
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" uniqueGroup="TemplateName"/> <SINGLEREFERENCE name="Client" type="Client" dbcol="client_id" />
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" uniqueGroup="TemplateID"/>
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" uniqueGroup="TemplateID"/>
</TABLE> </TABLE>
<SEARCH type="All" paramFilter="tl_culture_template.object_id is not null" orderBy="tl_culture_template.object_id" /> <SEARCH type="All" paramFilter="tl_culture_template.object_id is not null" orderBy="tl_culture_template.object_id" />
<SEARCH type="Company" paramFilter="tl_culture_template.object_id is not null" orderBy="tl_culture_template.object_id">
<TABLE name="oneit_sec_user_extension" join="oneit_sec_user_extension.user_id = tl_culture_template.user_id"/>
<TABLE name="tl_company" join="tl_company.object_id = oneit_sec_user_extension.company_id"/>
<PARAM name="Company" type="Company" transform="Company.getObjectID ()" paramFilter="tl_company.object_id = ${Company}"/>
</SEARCH>
</BUSINESSCLASS> </BUSINESSCLASS>
</ROOT> </ROOT>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<ATTRIB name="PlanRenewedOn" type="Date" dbcol="plan_renewed_on" mandatory="false" /> <ATTRIB name="PlanRenewedOn" type="Date" dbcol="plan_renewed_on" mandatory="false" />
<ATTRIB name="UsedCredits" type="Integer" dbcol="used_credits" /> <ATTRIB name="UsedCredits" type="Integer" dbcol="used_credits" />
<ATTRIB name="AvailableCredits" type="Integer" dbcol="available_credits" /> <ATTRIB name="AvailableCredits" type="Integer" dbcol="available_credits" />
<ATTRIB name="IsPPJ" type="Boolean" dbcol="is_ppj" defaultValue="Boolean.TRUE"/> <ATTRIB name="IsPPJ" type="Boolean" dbcol="is_ppj" />
<ATTRIB name="HasCap" type="Boolean" dbcol="has_cap" defaultValue="Boolean.FALSE"/> <ATTRIB name="HasCap" type="Boolean" dbcol="has_cap" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MaxCap" type="Integer" dbcol="max_cap" /> <ATTRIB name="MaxCap" type="Integer" dbcol="max_cap" />
<ATTRIB name="CouponExpiryDate" type="Date" dbcol="coupon_expiry_date" /> <ATTRIB name="CouponExpiryDate" type="Date" dbcol="coupon_expiry_date" />
......
...@@ -313,8 +313,9 @@ public class Job extends BaseJob ...@@ -313,8 +313,9 @@ public class Job extends BaseJob
{ {
CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser);
return AssessmentCriteriaTemplate.SearchByCompany() return AssessmentCriteriaTemplate.SearchByAll()
.byCompany(companyUser.getCompany()) .andHiringTeam(new EqualsFilter<>(getHiringTeam()))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(getTransaction()); .search(getTransaction());
} }
...@@ -323,8 +324,9 @@ public class Job extends BaseJob ...@@ -323,8 +324,9 @@ public class Job extends BaseJob
{ {
CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = SecUser.getTXUser(getTransaction()).getExtension(CompanyUser.REFERENCE_CompanyUser);
return CultureCriteriaTemplate.SearchByCompany() return CultureCriteriaTemplate.SearchByAll()
.byCompany(companyUser.getCompany()) .andHiringTeam(new EqualsFilter<>(getHiringTeam()))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(getTransaction()); .search(getTransaction());
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
<TRANSIENT name="RankingCompleted" type="Boolean" /> <TRANSIENT name="RankingCompleted" type="Boolean" />
<TRANSIENT name="OccupationId" type="String" /> <TRANSIENT name="OccupationId" type="String" />
<TRANSIENTSINGLE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" />
<TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" /> <TRANSIENTSINGLE name="CultureTemplate" type="CultureCriteriaTemplate" />
<TRANSIENTSINGLE name="JobTemplate" type="Job" /> <TRANSIENTSINGLE name="JobTemplate" type="Job" />
<TRANSIENTSINGLE name="AppStatusWorkFlow" type="WorkFlow" /> <TRANSIENTSINGLE name="AppStatusWorkFlow" type="WorkFlow" />
...@@ -67,6 +66,7 @@ ...@@ -67,6 +66,7 @@
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" /> <SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" />
<SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/> <SINGLEREFERENCE name="Occupation" type="Occupation" dbcol="occupation_id" mandatory="true"/>
<SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" /> <SINGLEREFERENCE name="ShortenedURL" type="ShortenedURL" dbcol="shortened_url_id" />
<SINGLEREFERENCE name="AssessmentTemplate" type="AssessmentCriteriaTemplate" dbcol="template_id" />
</TABLE> </TABLE>
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true" /> <ATTRIB name="SortOrder" type="Integer" dbcol="sort_order" mandatory="true" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" attribHelper="EnumeratedAttributeHelper"/> <ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" attribHelper="EnumeratedAttributeHelper"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="WorkFlows" mandatory="true"/> <SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="WorkFlows"/>
<SINGLEREFERENCE name="Template" type="AssessmentCriteriaTemplate" dbcol="template_id" backreferenceName="WorkFlows"/>
</TABLE> </TABLE>
......
...@@ -48,7 +48,7 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -48,7 +48,7 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
} }
private String SELECT_COLUMNS = "{PREFIX}tl_work_flow.object_id as id, {PREFIX}tl_work_flow.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow.name, {PREFIX}tl_work_flow.sort_order, {PREFIX}tl_work_flow.application_status, {PREFIX}tl_work_flow.job_id, 1 AS commasafe "; private String SELECT_COLUMNS = "{PREFIX}tl_work_flow.object_id as id, {PREFIX}tl_work_flow.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_work_flow.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_work_flow.name, {PREFIX}tl_work_flow.sort_order, {PREFIX}tl_work_flow.application_status, {PREFIX}tl_work_flow.job_id, {PREFIX}tl_work_flow.template_id, 1 AS commasafe ";
private String SELECT_JOINS = ""; private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
...@@ -102,7 +102,8 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -102,7 +102,8 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
!tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_Name)|| !tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_Name)||
!tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_SortOrder)|| !tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_SortOrder)||
!tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_ApplicationStatus)|| !tl_work_flowPSet.containsAttrib(WorkFlow.FIELD_ApplicationStatus)||
!tl_work_flowPSet.containsAttrib(WorkFlow.SINGLEREFERENCE_Job)) !tl_work_flowPSet.containsAttrib(WorkFlow.SINGLEREFERENCE_Job)||
!tl_work_flowPSet.containsAttrib(WorkFlow.SINGLEREFERENCE_Template))
{ {
// We will need to retrieve it // We will need to retrieve it
idsToFetch.add (id.longValue()); idsToFetch.add (id.longValue());
...@@ -158,6 +159,16 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -158,6 +159,16 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
return results; return results;
} }
else if (refName.equals (WorkFlow.SINGLEREFERENCE_Template))
{
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_work_flow " +
"WHERE " + SELECT_JOINS + "template_id = ?";
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, new Object[] { _objectID.longID () }, null, false);
return results;
}
else else
{ {
throw new IllegalArgumentException ("Illegal reference type:" + refName); throw new IllegalArgumentException ("Illegal reference type:" + refName);
...@@ -182,10 +193,10 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -182,10 +193,10 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
{ {
int rowsUpdated = executeStatement (sqlMgr, int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_work_flow " + "UPDATE {PREFIX}tl_work_flow " +
"SET name = ?, sort_order = ?, application_status = ?, job_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " + "SET name = ?, sort_order = ?, application_status = ?, job_id = ? , template_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_work_flow.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ", "WHERE tl_work_flow.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_Name))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_SortOrder))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_ApplicationStatus))).listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Job)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_Name))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_SortOrder))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_ApplicationStatus))).listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Template)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1) if (rowsUpdated != 1)
{ {
...@@ -446,6 +457,7 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -446,6 +457,7 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
tl_work_flowPSet.setAttrib(WorkFlow.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status")); tl_work_flowPSet.setAttrib(WorkFlow.FIELD_ApplicationStatus, HELPER_ApplicationStatus.getFromRS(dummyApplicationStatus, r, "application_status"));
tl_work_flowPSet.setAttrib(WorkFlow.SINGLEREFERENCE_Job, r.getObject ("job_id")); tl_work_flowPSet.setAttrib(WorkFlow.SINGLEREFERENCE_Job, r.getObject ("job_id"));
tl_work_flowPSet.setAttrib(WorkFlow.SINGLEREFERENCE_Template, r.getObject ("template_id"));
} }
...@@ -462,10 +474,10 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr ...@@ -462,10 +474,10 @@ public class WorkFlowPersistenceMgr extends ObjectPersistenceMgr
{ {
executeStatement (sqlMgr, executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_work_flow " + "INSERT INTO {PREFIX}tl_work_flow " +
" (name, sort_order, application_status, job_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " + " (name, sort_order, application_status, job_id, template_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " + "VALUES " +
" (?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")", " (?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_Name))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_SortOrder))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_ApplicationStatus))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Job)))) .listEntry (objectID.longID ()).toList().toArray()); CollectionUtils.listEntry (HELPER_Name.getForSQL(dummyName, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_Name))).listEntry (HELPER_SortOrder.getForSQL(dummySortOrder, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_SortOrder))).listEntry (HELPER_ApplicationStatus.getForSQL(dummyApplicationStatus, tl_work_flowPSet.getAttrib (WorkFlow.FIELD_ApplicationStatus))) .listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Job)))).listEntry (SQLManager.CheckNull((Long)(tl_work_flowPSet.getAttrib (WorkFlow.SINGLEREFERENCE_Template)))) .listEntry (objectID.longID ()).toList().toArray());
tl_work_flowPSet.setStatus (PersistentSetStatus.PROCESSED); tl_work_flowPSet.setStatus (PersistentSetStatus.PROCESSED);
} }
......
...@@ -587,31 +587,53 @@ public class Utils ...@@ -587,31 +587,53 @@ public class Utils
return hiringTeam.pipelineHiringTeam().toCompany().toHiringTeams(filter).uniqueVals().toArray(new HiringTeam[0]); return hiringTeam.pipelineHiringTeam().toCompany().toHiringTeams(filter).uniqueVals().toArray(new HiringTeam[0]);
} }
public static void setupJobFromTemplate(Job job, Job jobTemplate) throws FieldException, StorageException, BusinessException public static void setupJobFromTemplate(Job job, AssessmentCriteriaTemplate jobTemplate, ObjectTransaction objTran) throws FieldException, StorageException, BusinessException
{ {
for(CultureCriteria criteria : job.getCultureCriteriasSet()) for(AssessmentCriteria criteria : job.getAssessmentCriteriasSet())
{ {
criteria.delete(); criteria.delete();
} }
for(AssessmentCriteria criteria : job.getAssessmentCriteriasSet()) for(WorkFlow workflow : job.getWorkFlowsSet())
{ {
criteria.delete(); workflow.delete();
}
job.setJobTitle(jobTemplate.getJobTitle());
job.setReferenceNumber(jobTemplate.getReferenceNumber());
job.setJobDescription(jobTemplate.getJobDescription());
job.setJobOwner(jobTemplate.getJobOwner());
job.setClient(jobTemplate.getClient());
job.setGoogleAddressText(jobTemplate.getGoogleAddressText());
job.setExpectedCandidateRadius(jobTemplate.getExpectedCandidateRadius());
job.setRemote(jobTemplate.getRemote());
job.setJobType(jobTemplate.getJobType());
job.setIndustry(jobTemplate.getIndustry());
job.setOccupation(jobTemplate.getOccupation());
job.setRequireCV(jobTemplate.getRequireCV());
job.setAssessmentType(jobTemplate.getAssessmentType());
job.setLevel(jobTemplate.getLevel());
for(AssessmentCriteria criteria : jobTemplate.getAssessmentCriteriasSet())
{
AssessmentCriteria criteriaCopy = AssessmentCriteria.createAssessmentCriteria(objTran);
criteriaCopy.copyAttributesFrom(criteria);
job.addToAssessmentCriterias(criteriaCopy);
} }
jobTemplate.cloneJob(job); for (WorkFlow workflow : jobTemplate.getWorkFlowsSet())
{
WorkFlow workflowCopy = WorkFlow.createWorkFlow(objTran);
workflowCopy.copyAttributesFrom(workflow);
job.initAttribs(); job.addToWorkFlows(workflowCopy);
job.setJobStatus(JobStatus.DRAFT); }
job.setApplyBy(null);
job.setOpenDate(null);
job.setReferenceNumber(null);
job.setCompletedDetails(Boolean.TRUE);
job.setCompletedAssessmentType(Boolean.TRUE);
job.setCompletedRequirements(Boolean.TRUE);
job.setCompletedCulture(Boolean.TRUE);
job.setShortenedURL(null);
job.setDraftLocation(null);
} }
public static ApplicationStatus getApplicationStatus(int sortOrder) public static ApplicationStatus getApplicationStatus(int sortOrder)
...@@ -692,4 +714,9 @@ public class Utils ...@@ -692,4 +714,9 @@ public class Utils
return Arrays.asList(new RoleType[]{RoleType.STANDARD}); return Arrays.asList(new RoleType[]{RoleType.STANDARD});
} }
public static boolean isAssumedUser (HttpServletRequest request)
{
return request.getSession ().getAttribute (oneit.security.jsp.AssumeUserFP.UNASSUME_SEC_USER_ID) != null;
}
} }
\ No newline at end of file
...@@ -18,6 +18,8 @@ public class WebUtils ...@@ -18,6 +18,8 @@ public class WebUtils
public static final String APPLICANT_PORTAL = "ApplicantPortal"; public static final String APPLICANT_PORTAL = "ApplicantPortal";
public static final String ADMIN_HOME = "AdminHome"; public static final String ADMIN_HOME = "AdminHome";
public static final String APPLICANT_HOME = "ApplicantHome"; public static final String APPLICANT_HOME = "ApplicantHome";
public static final String EDIT_CULTURE = "EditCulture";
public static final String EDIT_JOB_TEMP = "EditJobTemplate";
public static final String CREATE_JOB = "CreateJob"; public static final String CREATE_JOB = "CreateJob";
public static final String START_JOB = "StartJob"; public static final String START_JOB = "StartJob";
public static final String OCCUPATION = "Occupation"; public static final String OCCUPATION = "Occupation";
...@@ -160,6 +162,8 @@ public class WebUtils ...@@ -160,6 +162,8 @@ public class WebUtils
renderMode.equals(EDIT_CARD) || renderMode.equals(EDIT_CARD) ||
renderMode.equals(OCCUPATION) || renderMode.equals(OCCUPATION) ||
renderMode.equals(START_JOB) || renderMode.equals(START_JOB) ||
renderMode.equals(EDIT_CULTURE) ||
renderMode.equals(EDIT_JOB_TEMP) ||
renderMode.equals(CREATED_JOB); renderMode.equals(CREATED_JOB);
} }
......
...@@ -331,15 +331,15 @@ ul.profile-dropdown { ...@@ -331,15 +331,15 @@ ul.profile-dropdown {
float: left; float: left;
margin-right: 22px; margin-right: 22px;
} }
/*.template-icon{ .template-icon{
background-image: url('../images/my-company-icon.svg'); background-image: url('../images/icon-reuse-sml.svg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center;
width: 24px; width: 24px;
height: 24px; height: 24px;
float: left; float: left;
margin-right: 22px; margin-right: 22px;
}*/ }
.billing-icon{ .billing-icon{
background-image: url('../images/billing.png'); background-image: url('../images/billing.png');
background-repeat: no-repeat; background-repeat: no-repeat;
...@@ -385,9 +385,9 @@ ul.profile-dropdown { ...@@ -385,9 +385,9 @@ ul.profile-dropdown {
.main-menu li:hover .client-icon,.main-menu li.active .client-icon{ .main-menu li:hover .client-icon,.main-menu li.active .client-icon{
background-image: url('../images/clients-icon-hover.png'); background-image: url('../images/clients-icon-hover.png');
} }
/*.main-menu li:hover .template-icon,.main-menu li.active .template-icon{ .main-menu li:hover .template-icon,.main-menu li.active .template-icon{
background-image: url('../images/my-company-hover.png'); background-image: url('../images/icon-reuse-sml.svg');
}*/ }
.main-menu li:hover .manage-icon,.main-menu li.active .manage-icon{ .main-menu li:hover .manage-icon,.main-menu li.active .manage-icon{
background-image: url('../images/manage-user-hover.png'); background-image: url('../images/manage-user-hover.png');
} }
...@@ -6022,7 +6022,140 @@ label, label .label-title span { ...@@ -6022,7 +6022,140 @@ label, label .label-title span {
.job-main-tabs { .job-main-tabs {
max-width: 1300px; max-width: 1300px;
} }
/* Start of Templates MT001 */
.edit-template{
padding-left: 50px;
}
.form-group.row.box-border{
height: 120px;
border: 1px solid #CED2D6;
border-radius: 5px;
padding: 35px 50px;
margin: 30px 10px;
}
.template-row {
display: flex;
}
.main-tab-template{
height: 90px;
border-radius: 5px 5px 0 0;
background-color: #4E5258;
}
.main-tab-template span.job-details{
color: #FFFFFF;
font-size: 20px;
}
.main-tab-template span.job-details.culture{
padding-left: 50px;
}
.job-template-left .grey-span, .template-name-left .grey-span {
color: #8E97A0;
font-size: 11px;
font-family: Usual-Medium;
}
.job-template-left.job-template-cl1 {
width: 30%;
border-right: 1px solid #efefef;
display: flex;
align-items: center;
}
.job-template-left.job-template-cl2 {
width: 25%;
border-right: 1px solid #efefef;
}
.job-template-left.job-template-cl3 {
width: 20%;
border-right: 1px solid #efefef;
}
.job-template-left.job-template-cl4 {
width: 25%;
}
.job-template-left.job-template-cl1.culture {
width: 49%;
}
.job-template-left.job-template-cl4 .m-user-right-padlock {
float: right;
padding: 17px 0;
cursor: pointer;
position: absolute;
top: 0;
right: 25px;
width: auto;
}
.template-list {
background: #fff none repeat scroll 0 0;
display: inline-block;
width: 100%;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 10px;
height:80px;
}
.template-name-left{
float: left;
width: 30%;
padding: 18px 26px;
position: relative;
}
.template-name{
text-align: left;
font-size: 14px;
}
.template-name.heading{
font-size: 20px;
}
.job-template-left{
float: left;
width: 22%;
padding: 18px 26px;
position: relative;
}
.job-template-left .grey-span, .template-name-left .grey-span{
color: #8E97A0;
font-size: 11px;
}
.text-center.save-template{
padding-top: 30px;
}
.save-template-text{
color: #4E5258;
font-size: 14px;
font-weight: 300;
padding-top: 20px;
}
.form-group.row.box-border {
height: 120px;
border: 1px solid #CED2D6;
border-radius: 5px;
padding: 35px 50px;
margin: 30px 10px;
display: flex;
align-items: center;
}
.main-tab-template {
height: 90px;
border-radius: 5px 5px 0 0;
background-color: #4E5258;
display: flex;
align-items: center;
}
span.tab-number {
width: 35px;
height: 35px;
padding: 10px 12.5px;
background: #67B413;
color: white;
display: block;
border-radius: 50%;
margin: 0 25px 0 35px;
}
/* End of Templates MT001 */
/* Start of Clients HT010 */ /* Start of Clients HT010 */
...@@ -7483,3 +7616,17 @@ input{ ...@@ -7483,3 +7616,17 @@ input{
.teammate-hiringteam {color: #8E97A0; font-size: 22px; font-weight: 300;} .teammate-hiringteam {color: #8E97A0; font-size: 22px; font-weight: 300;}
.show-all-jobs-toggle span {display: inline-block; float: left; margin-right: 5px; font-size: 13px; color: #4E5258;} .show-all-jobs-toggle span {display: inline-block; float: left; margin-right: 5px; font-size: 13px; color: #4E5258;}
.show-all-jobs-toggle {height: 40px; line-height: 22px; vertical-align: middle; padding-top: 30px;} .show-all-jobs-toggle {height: 40px; line-height: 22px; vertical-align: middle; padding-top: 30px;}
.btn.btn-primary.loginAsAdmin {
border-radius: 100px;
background-color: #03a0e7 !important;
font-size: 15px;
text-align: center;
border-color: #03a0e7 !important;
width: 190px;
height: 50px;
margin-top: 10px;
margin-right: 20px;
font-weight: 500;
color: #ffffff !important;
}
...@@ -79,6 +79,24 @@ ...@@ -79,6 +79,24 @@
</NODE> </NODE>
</MAP> </MAP>
<MAP value="JOB_TEMPLATES" description="Job Templates" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/job_templates.jsp"/>
<RenderMode name="EditJobTemplate" preIncludeJSP="extensions/adminportal/edit_job_template.jsp"/>
</NODE>
</MAP>
<MAP value="CULTURE_TEMPLATES" description="Culture Templates" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/culture_templates.jsp"/>
<RenderMode name="EditCulture" preIncludeJSP="extensions/adminportal/edit_culture_template.jsp"/>
</NODE>
</MAP>
<MAP value="MY_COMPANY" description="My Company" TemplatePage="dynamic_content_form_client.jsp"> <MAP value="MY_COMPANY" description="My Company" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration"> <NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/> <INHERITS nodename="StandardJSP"/>
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page"); String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
AssessmentCriteriaTemplate[] templates = job.getAssessmentTemplates();
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -95,25 +93,15 @@ ...@@ -95,25 +93,15 @@
<oneit:recalcClass htmlTag="div" classScript="job.showAssessmentCriteriaSection() ? 'show': 'hide'" job="<%= job %>"> <oneit:recalcClass htmlTag="div" classScript="job.showAssessmentCriteriaSection() ? 'show': 'hide'" job="<%= job %>">
<% <%
// if(templates.length > 0 || false) if(job.getAssessmentTemplate() != null)
if(false)
{ {
%> %>
<oneit:button value=" " name="loadRequirementsFromTemplate" cssClass="hide"
requestAttribs="<%= CollectionUtils.mapEntry ("Job", job)
.mapEntry (UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>" />
<div class="form-group wider-select">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= templates %>"
blankValue="Optional: Select from previously defined Requirements"/>
</div>
<div class="info-box"> <div class="info-box">
<div class="info-title"> <div class="info-title">
Template : <strong>My Job Template Title</strong> Template : <strong><%= job.getAssessmentTemplate().getTemplateName() %></strong>
</div> </div>
<div class="info-desc"> <div class="info-desc">
Changing requirement below is possible and will not overwrite <strong>My Job Template Title</strong>, OR <strong>Job Details</strong> as already defined, however they will need to be saved if you wish to use them again (which also includes Job Details). Changing requirement below is possible and will not overwrite <strong><%= job.getAssessmentTemplate().getTemplateName() %></strong>, OR <strong>Job Details</strong> as already defined, however they will need to be saved if you wish to use them again (which also includes Job Details).
</div> </div>
</div> </div>
<% <%
...@@ -171,17 +159,13 @@ ...@@ -171,17 +159,13 @@
} }
%> %>
<%
if(false)
{
%>
<div class="form-group"> <div class="form-group">
<div class="styled_checkboxes"> <div class="styled_checkboxes">
<div class="checkbox checkbox-primary"> <div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= job %>" id="save-assess-check" attributeName="SaveAssessmentTemplate" type="checkbox"/> <oneit:ormInput obj="<%= job %>" id="save-assess-check" attributeName="SaveAssessmentTemplate" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="job.showSaveAssessmentTemplate() ? 'checked': 'unchecked'" job="<%= job %>"> <oneit:recalcClass htmlTag="span" classScript="job.showSaveAssessmentTemplate() ? 'checked': 'unchecked'" job="<%= job %>">
<label for="save-assess-check"> <label for="save-assess-check">
<oneit:ormlabel obj="<%= job %>" field="SaveAssessmentTemplate" /> <oneit:label GUIName="Save Job Details and Requirements as a new template (this will not publish the Job)" />
</label> </label>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
...@@ -200,9 +184,6 @@ ...@@ -200,9 +184,6 @@
</span> </span>
</div> </div>
</oneit:recalcClass> </oneit:recalcClass>
<%
}
%>
</oneit:recalcClass> </oneit:recalcClass>
<div class="text-center"> <div class="text-center">
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_CULTURE);
SecUser secUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
Map<String, String[]> parameterMap = request.getParameterMap();
Client selectedClient = null;
String clientPage = WebUtils.getSamePageInRenderMode(request, "Page");
ClientSortOption clientSortOpt = (ClientSortOption) process.getAttribute("ClientSortOption");
Client[] clients = (Client[]) process.getAttribute("Clients");
CultureCriteriaTemplate[] templates = (CultureCriteriaTemplate[]) process.getAttribute("CultureCriteriaTemplates");
if( request.getParameter("ClientSortOption") != null)
{
clientSortOpt = ClientSortOption.forName((String) request.getParameter("ClientSortOption"));
}
if(clientSortOpt == null)
{
clientSortOpt = ClientSortOption.ALPHA_A_Z;
}
if(templates == null)
{
templates = CultureCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(transaction);
process.setAttribute("CultureCriteriaTemplates", templates);
}
// handle client
if( parameterMap.containsKey("Client"))
{
if(!request.getParameter("Client").isEmpty())
{
selectedClient = Client.getClientByID(transaction, Long.valueOf(request.getParameter("Client")));
}
}
else
{
selectedClient = (Client) session.getAttribute("Client");
}
session.setAttribute("Client", selectedClient);
if(clients == null)
{
clients = Utils.getClientsByHiringTeam(transaction);
process.setAttribute("Clients", clients);
}
List<Client> sortedClients = Utils.getClientsSorted(clients, clientSortOpt);
process.setAttribute("ClientSortOption", clientSortOpt);
%>
<oneit:form name="cultureTemplates" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Manage Culture Templates</div>
<%
if(false)
{
%>
<div class="shorting-dropdown">
<span class="order-label">Select Client</span>
<select class="form-control" onChange="location=this.value">
<%
for (ClientSortOption sortOption : ClientSortOption.getClientSortOptionArray())
{
String optionLink = clientPage + "&ClientSortOption=" + sortOption.getName() ;
%>
<option <%= (clientSortOpt != null && clientSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
<%
}
%>
</div>
<div class="main-client-list">
<%
for(CultureCriteriaTemplate template : templates)
{
%>
<div class="template-list" id="<%= template.getID() %>">
<div class="template-row">
<div class="job-template-left job-template-cl1 culture">
<div class="template-name heading">
<oneit:toString value="<%= template.getTemplateName() %>" mode="EscapeHTML" />
</div>
</div>
<div class="job-template-left job-template-cl2">
<span class="grey-span">CLIENT</span>
<div class="template-name">
<oneit:toString value="<%= template.getClient() %>" mode="EscapeHTML" />
</div>
</div>
<div class="job-template-left job-template-cl4">
<span class="grey-span">LAST UPDATED</span>
<div class="template-name">
<oneit:toString value="<%= template.getObjectLastModified() %>" mode="MidDate" />
</div>
<div class="m-user-right-padlock">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage + "&CultureCriteriaTemplateID=" + template.getObjectID())
.mapEntry("procParams", CollectionUtils.mapEntry("CultureCriteriaTemplate", template).toMap())
.toMap() %>">
<span class="m-user-right-padlockicon">
<span class="pencil"></span>
</span>
</oneit:button>
</div>
</div>
</div>
</div>
<%
}
%>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "CultureCriteriaTemplate", CultureCriteriaTemplate.REFERENCE_CultureCriteriaTemplate);
CultureCriteriaTemplate template = (CultureCriteriaTemplate) process.getAttribute("CultureCriteriaTemplate");
String nextPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(template != null && !toRedirect, "Invalid template in culture templates");
template.pipelineCultureCriteriaTemplate().toCultureCriterias().toCultureElement().toRatings().uniqueVals(); //preloading data
%>
<script type="text/javascript">
$(document).ready(function(){
recalcFunction = setupRecalc ($("form#editCultureTemplate"), {'recalcOnError':true});
});
</script>
<oneit:form name="editCultureTemplate" method="post" enctype="multipart/form-data">
<h1 class="page-title page-title-with-arrow edit-template">
<oneit:button cssClass="arrow-btn-blue" name="gotoPage" value=" " skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry("cancelProcess", true)
.toMap() %>">
<img src="images/arrow-left-prev_blue.svg" />
</oneit:button>
View/Edit Culture Template
</h1>
<div class="form-group row box-border">
<div class="col-md-1">
<label><oneit:label GUIName="Title" /></label>
</div>
<div class="col-md-5">
<oneit:ormInput obj="<%= template %>" type="text" attributeName="TemplateName" cssClass="form-control" />
</div>
<%
if(template.getClient() != null)
{
%>
<div class="col-md-1">
<label><oneit:label GUIName="Client" /></label>
</div>
<div class="col-md-5 wider-select">
<tagfile:ormsingleasso_select obj="<%= template %>" assocName="Client" options="<%= Utils.getClientsByHiringTeam(transaction) %>"/>
</div>
<%
}
%>
</div>
<div class="container-fluid">
<div class="main-tab-template">
<span class="job-details culture">Culture</span>
</div>
<div class="form-page-area nopadding">
<div class="create-job">
<div class="form-page-section darkbg">
<div class="form-group">
<label><oneit:label GUIName="Organisation Culture Statement" /> <a href="#" title="Note description gose here." class="info-icon"><img src="images/info-icon.png" /></a></label>
<oneit:ormtextarea obj="<%= template %>" attributeName="CultureStatement" cssClass="form-control textarea-box"/>
</div>
</div>
<oneit:dynInclude page="/extensions/adminportal/inc/culture_details.jsp" CultureCriteriaTemplate="<%= template %>" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
</div>
</div>
<div class="text-center save-template">
<oneit:button value="Save Template" name="save" cssClass="btn btn-primary top-margin-25 largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.toMap() %>" />
<div class="save-template-text">Saving this template will not affect any previously created or filled jobs</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<div class="form-page-section">
<script type="text/javascript">
function moveImportanceSection(elementRating){
var importanceDiv = $(elementRating).closest('.criteria_section').find('.work-rating');
var radioGroup = $("[name='" + $(elementRating).attr('name') +"']");
if(radioGroup.is(':checked')){
importanceDiv.insertAfter($("[name='" + $(elementRating).attr('name') +"']:checked").parent());
importanceDiv.show();
}
else{
importanceDiv.hide();
}
}
$(document).ready(function(){
$(".element_rating_radio").each(function (){
moveImportanceSection(this);
});
$(".element_rating_radio").change(function(){
moveImportanceSection(this);
});
$(".importance_radio").change(function(){
var importanceGroup = $(this).closest('.rate-toggle');
importanceGroup.find('li.active').removeClass("active" );
importanceGroup.find("input[type='radio']:checked").closest('li').addClass("active" );
});
$("select[name$='CultureTemplate']").change(function(){
$("button[name$='loadCultureFromTemplate']").click();
});
var showError = true;
addPostRecalcHandler (function ($fieldThatChanged) {
if(showError) {
showError = false;
$('.errorField input, .errorField select, .errorField textarea, .errorField .assocObjDesc').eq(0).focus();
}
recalcFunction();
});
});
</script>
<%
Job job = (Job) getData(request, "Job");
CultureCriteriaTemplate template = (CultureCriteriaTemplate) getData(request, "CultureCriteriaTemplate");
FormTag jobForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = jobForm.getFormBuilder();
Debug.assertion(job != null || template != null , "Job or Template is null");
for(CultureClass cultureClass : CultureClass.getCultureClassArray())
{
%>
<div class="form-group">
<div class="work-belonging">
<oneit:toString value="<%= cultureClass %>" mode="EscapeHTML"/>
</div>
<div class="critarea-desc"><%= cultureClass.getClassDescription() %></div>
<%
for(CultureCriteria criteria : (job != null ? job.getCultureCriteriasForClass(cultureClass) : template.getCultureCriteriasForClass(cultureClass)))
{
String optionKey = WebUtils.getRadioSingleAssocKey(request, criteria, CultureCriteria.SINGLEREFERENCE_CultureElementRating);
String formValue = formBuilder.fieldValue (optionKey, criteria.getCultureElementRating() == null ? "" : String.valueOf(criteria.getCultureElementRatingID()));
CultureElement element = criteria.getCultureElement();
%>
<div class="criteria_section culture-margin-bottom">
<fieldset >
<legend>
<oneit:toString value="<%= element %>" mode="EscapeHTML"/>
<a href="#" title='<%= element.getDetailedDescription() %>' class="info-icon-left"><img src="images/info-icon.png" /></a>
</legend>
<label class="switch">
<oneit:recalcClass htmlTag="span" classScript="criteria.getIsApplicable() ? 'checkbox checked': 'checkbox unchecked'" criteria="<%= criteria %>">
<oneit:ormInput obj="<%= criteria %>" attributeName="IsApplicable" type="checkbox"/>
</oneit:recalcClass>
<div class="slider round"></div>
</label>
<oneit:recalcClass htmlTag="div" classScript="criteria.getIsApplicable() ? 'show': 'hide'" criteria="<%= criteria %>">
<%
for (CultureElementRating rating : element.getRatingsSet())
{
String ratingId = String.valueOf(rating.getID().longID());
String selectedStr = (CollectionUtils.equals(ratingId, formValue) ? "checked" : "");
%>
<div class="<%= "radio radio-primary workplace-radio " %>">
<input type="radio" name="<%= optionKey %>" id="<%= ratingId %>" class="element_rating_radio" value="<%= ratingId %>" <%= selectedStr %> >
<label for="<%= ratingId %>">
<oneit:toString value="<%= rating %>" mode="EscapeHTML"/>
</label>
</div>
<%
}
%>
</oneit:recalcClass>
<div class="work-rating">
<div class="rate-background">
<span class="arrow-up-gray"></span>
<span class="rate-label">
<oneit:label GUIName="Rate Importance" />
</span>
<span class="rate-toggle">
<ul class="nav nav-pills nav-justified">
<%
String importanceKey = WebUtils.getInputKey(request, criteria, CultureCriteria.FIELD_Importance);
String importanceValue = formBuilder.fieldValue (importanceKey, criteria.getImportance() == null ? "" : criteria.getImportance().getName());
for(Importance importance : Utils.getImportancesForCulture())
{
boolean isSelected = CollectionUtils.equals(importanceValue, importance.getName());
String importanceId = String.valueOf(criteria.getID().longID()) + "_importance_" + importance.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
%>
<li class="<%= activeClass%>">
<a href="javascript:void(0)" class="importance">
<input type="radio" name="<%= importanceKey %>" id="<%= importanceId %>" class="importance_radio" value="<%= importance.getName() %>" <%= selected %>/>
<label for="<%= importanceId %>"><oneit:toString value="<%= importance.getDescription() %>" mode="EscapeHTML" /></label>
</a>
</li>
<%
}
%>
</ul>
</span>
</div>
</div>
</fieldset>
</div>
<!--<div class="form-brack-line-sub"></div>-->
<%
}
%>
</div>
<%
}
%>
</div>
</oneit:dynIncluded>
\ No newline at end of file
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<!-- Google Tag Manager --> <!-- Google Tag Manager -->
<script> <script>
dataLayer = [{ dataLayer = [{
'username': '<%= clientUser != null ? clientUser.getUserName() : "" %>', 'userId': '<%= clientUser != null ? clientUser.getUserName() : "" %>',
}]; }];
</script> </script>
<script> <script>
...@@ -197,6 +197,14 @@ ...@@ -197,6 +197,14 @@
%> %>
<li><a href="<%= myDetailsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap())%>">My Details</a></li> <li><a href="<%= myDetailsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap())%>">My Details</a></li>
<li><a href="<%= signoutUrl %>">Sign Out</a></li> <li><a href="<%= signoutUrl %>">Sign Out</a></li>
<%
if (request.getSession ().getAttribute (oneit.security.jsp.AssumeUserFP.UNASSUME_SEC_USER_ID) != null)
{
%>
<li><a href="<%= request.getContextPath () %>/editor/index_unassume.jsp">Unassume</a></li>
<%
}
%>
</ul> </ul>
</div> </div>
<div class="create-job-btn"> <div class="create-job-btn">
...@@ -207,7 +215,7 @@ ...@@ -207,7 +215,7 @@
boolean onJob = WebUtils.onJobPages(renderMode); boolean onJob = WebUtils.onJobPages(renderMode);
boolean canCreateJob = Utils.allowJobCreation(selectedTeam); boolean canCreateJob = Utils.allowJobCreation(selectedTeam);
%> %>
<a href="<%= onJob || !canCreateJob ? "#" : jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.CREATE_JOB).toMap()) %>" class="<%= onJob || !canCreateJob ? "disabled" : ""%>" >Create Job</a> <a href="<%= onJob || !canCreateJob ? "#" : jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) %>" class="<%= onJob || !canCreateJob ? "disabled" : ""%>" >Create Job</a>
<% <%
} }
%> %>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
AssessmentCriteriaTemplate template = (AssessmentCriteriaTemplate) process.getAttribute("AssessmentCriteriaTemplate");
AssessmentCriteria criteria = (AssessmentCriteria) getData(request, "AssessmentCriteria"); AssessmentCriteria criteria = (AssessmentCriteria) getData(request, "AssessmentCriteria");
if(criteria == null) if(criteria == null)
...@@ -16,8 +17,16 @@ ...@@ -16,8 +17,16 @@
criteria = AssessmentCriteria.createAssessmentCriteria(objTran); criteria = AssessmentCriteria.createAssessmentCriteria(objTran);
criteria.setCriteriaType(CriteriaType.forName((String) request.getParameter("CriteriaName"))); criteria.setCriteriaType(CriteriaType.forName((String) request.getParameter("CriteriaName")));
if(job != null )
{
job.addToAssessmentCriterias(criteria); job.addToAssessmentCriterias(criteria);
} }
else
{
template.addToAssessmentCriterias(criteria);
}
}
%> %>
<oneit:form method="POST"> <oneit:form method="POST">
......
...@@ -9,17 +9,26 @@ ...@@ -9,17 +9,26 @@
ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request); ORMProcessState process = (ORMProcessState)ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction (); ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
int sortOrder = job.getWorkFlowsCount(); AssessmentCriteriaTemplate template = (AssessmentCriteriaTemplate) process.getAttribute("AssessmentCriteriaTemplate");
int sortOrder = job != null ? job.getWorkFlowsCount() : template.getWorkFlowsCount();
ApplicationStatus status = Utils.getApplicationStatus(sortOrder); ApplicationStatus status = Utils.getApplicationStatus(sortOrder);
WorkFlow workflow = null; WorkFlow workflow = null;
if(job.getWorkFlowsCount() < 9 && status != null) if(sortOrder < 9 && status != null)
{ {
workflow = WorkFlow.createWorkFlow(objTran); workflow = WorkFlow.createWorkFlow(objTran);
workflow.setApplicationStatus(status); workflow.setApplicationStatus(status);
workflow.setSortOrder(sortOrder); workflow.setSortOrder(sortOrder);
if(job != null)
{
job.addToWorkFlows(workflow); job.addToWorkFlows(workflow);
}
else
{
template.addToWorkFlows(workflow);
}
%> %>
<oneit:form method="POST"> <oneit:form method="POST">
......
...@@ -6,39 +6,15 @@ ...@@ -6,39 +6,15 @@
<oneit:dynIncluded> <oneit:dynIncluded>
<% <%
boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job"); Job job = (Job) process.getAttribute("Job");
String jobPage = WebUtils.getSamePageInRenderMode(request, "Page"); String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
if(toRedirect)
{
%><%@include file="/saferedirect.jsp" %><%
}
SecUser txUser = SecUser.getTXUser(process.getTransaction()); SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam(); AssessmentCriteriaTemplate[] templates = job.getAssessmentTemplates();
Job[] jobs = Job.SearchByAll()
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.search(transaction);
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA); String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
job.setHiringTeam(hiringTeam);
job.setJobOwner(companyUser);
job.setIndustry(hiringTeam.getIndustry());
job.setGoogleAddressText(hiringTeam.getGoogleAddressText());
// Job job = (Job) process.getAttribute("Job");
// String jobPage = WebUtils.getSamePageInRenderMode(request, "Page");
//
// Debug.assertion(job != null, "Job is null in admin portal create job");
//
// SecUser txUser = SecUser.getTXUser(process.getTransaction());
// CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
// Job[] jobs = Job.SearchByCompany().byCompany(companyUser.getCompany()).search(transaction);
// String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.ASSESSMENT_CRITERIA);
%> %>
<script type="text/javascript"> <script type="text/javascript">
...@@ -50,7 +26,7 @@ ...@@ -50,7 +26,7 @@
{ {
setupRecalc ($("form#editJob"), {'recalcOnError':true}); setupRecalc ($("form#editJob"), {'recalcOnError':true});
$("select[name$='JobTemplate']").change(function() $("select[name$='AssessmentTemplate']").change(function()
{ {
$("button[name$='loadJobFromTemplate']").click(); $("button[name$='loadJobFromTemplate']").click();
}); });
...@@ -266,7 +242,7 @@ ...@@ -266,7 +242,7 @@
<div class="create-job"> <div class="create-job">
<div class="form-page-section"> <div class="form-page-section">
<% <%
if(false) if(templates.length > 0)
{ {
%> %>
<oneit:button value=" " name="loadJobFromTemplate" cssClass="hide" <oneit:button value=" " name="loadJobFromTemplate" cssClass="hide"
...@@ -275,7 +251,7 @@ ...@@ -275,7 +251,7 @@
.toMap() %>" /> .toMap() %>" />
<div class="form-group wider-select"> <div class="form-group wider-select">
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="JobTemplate" options="<%= jobs %>" <tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= templates %>"
blankValue="Optional: Use another Job as a starting point"/> blankValue="Optional: Use another Job as a starting point"/>
</div> </div>
<% <%
...@@ -504,7 +480,7 @@ ...@@ -504,7 +480,7 @@
index++; index++;
%> %>
<div class="form-group row"> <div class="form-group row" id="<%= workflow.getID() %>">
<div class="col-md-12"> <div class="col-md-12">
<div class="workflow-row"> <div class="workflow-row">
<span><%= workflow.getSortOrder() %></span> <span><%= workflow.getSortOrder() %></span>
...@@ -512,8 +488,12 @@ ...@@ -512,8 +488,12 @@
<% <%
if(workflow.getApplicationStatus() != ApplicationStatus.SUBMITTED && workflow.getApplicationStatus() != ApplicationStatus.SHORTLISTED) if(workflow.getApplicationStatus() != ApplicationStatus.SUBMITTED && workflow.getApplicationStatus() != ApplicationStatus.SHORTLISTED)
{ {
String deleteVarKey = FormTag.getVariableKey (request);
FormTag.setVariable (request, deleteVarKey, "objToDelete", workflow);
FormTag.setVariable (request, deleteVarKey, "jqToDelete", "#" + workflow.getID());
%> %>
<div class="remove-icon">_</div> <div class="remove-icon" onclick="return deleteWorkflow (<%= deleteVarKey %>)">_</div>
<% <%
} }
%> %>
......
...@@ -85,9 +85,9 @@ ...@@ -85,9 +85,9 @@
<span class="create-job-icon from-template"></span> <span class="create-job-icon from-template"></span>
<!--<img src="images/create_from_template.png">--> <!--<img src="images/create_from_template.png">-->
<h3>Create from template</h3> <h3>Create from template</h3>
<oneit:ormInput obj="<%= job %>" type="radio" attributeName="FromTemplate" value="true" disabled='true'/> <oneit:ormInput obj="<%= job %>" type="radio" attributeName="FromTemplate" value="true"/>
<div> <div>
<tagfile:ormsingleasso_select obj="<%= job %>" assocName="JobTemplate" options="<%= jobs %>" <tagfile:ormsingleasso_select obj="<%= job %>" assocName="AssessmentTemplate" options="<%= job.getAssessmentTemplates() %>"
blankValue="Select your template" disabled='true'/> blankValue="Select your template" disabled='true'/>
</div> </div>
</label> </label>
......
<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>
<oneit:dynIncluded>
<%
String nextPage = WebUtils.getSamePageInRenderMode(request, WebUtils.EDIT_JOB_TEMP);
SecUser secUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
Map<String, String[]> parameterMap = request.getParameterMap();
Client selectedClient = null;
String clientPage = WebUtils.getSamePageInRenderMode(request, "Page");
ClientSortOption clientSortOpt = (ClientSortOption) process.getAttribute("ClientSortOption");
Client[] clients = (Client[]) process.getAttribute("Clients");
AssessmentCriteriaTemplate[] templates = (AssessmentCriteriaTemplate[]) process.getAttribute("AssessmentCriteriaTemplates");
if( request.getParameter("ClientSortOption") != null)
{
clientSortOpt = ClientSortOption.forName((String) request.getParameter("ClientSortOption"));
}
if(clientSortOpt == null)
{
clientSortOpt = ClientSortOption.ALPHA_A_Z;
}
if(templates == null)
{
templates = AssessmentCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(transaction);
process.setAttribute("AssessmentCriteriaTemplates", templates);
}
// handle client
if( parameterMap.containsKey("Client"))
{
if(!request.getParameter("Client").isEmpty())
{
selectedClient = Client.getClientByID(transaction, Long.valueOf(request.getParameter("Client")));
}
}
else
{
selectedClient = (Client) session.getAttribute("Client");
}
session.setAttribute("Client", selectedClient);
if(clients == null)
{
clients = Utils.getClientsByHiringTeam(transaction);
process.setAttribute("Clients", clients);
}
List<Client> sortedClients = Utils.getClientsSorted(clients, clientSortOpt);
process.setAttribute("ClientSortOption", clientSortOpt);
%>
<oneit:form name="jobTemplates" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Manage Job Templates</div>
<%
if(false)
{
%>
<div class="shorting-dropdown">
<span class="order-label">Select Client</span>
<select class="form-control" onChange="location=this.value">
<%
for (ClientSortOption sortOption : ClientSortOption.getClientSortOptionArray())
{
String optionLink = clientPage + "&ClientSortOption=" + sortOption.getName() ;
%>
<option <%= (clientSortOpt != null && clientSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
<%
}
%>
</div>
<div class="main-client-list">
<%
for(AssessmentCriteriaTemplate template : templates)
{
%>
<div class="template-list" id="<%= template.getID() %>">
<div class="template-row">
<div class="job-template-left job-template-cl1">
<div class="template-name heading">
<oneit:toString value="<%= template.getTemplateName() %>" mode="EscapeHTML" />
</div>
</div>
<div class="job-template-left job-template-cl2">
<span class="grey-span">JOB TITLE</span>
<div class="template-name">
<oneit:toString value="<%= template.getJobTitle() %>" mode="EscapeHTML" />
</div>
</div>
<div class="job-template-left job-template-cl3">
<span class="grey-span">CLIENT</span>
<div class="template-name">
<oneit:toString value="<%= template.getClient() %>" mode="EscapeHTML" />
</div>
</div>
<div class="job-template-left job-template-cl4">
<span class="grey-span">LAST UPDATED</span>
<div class="template-name">
<oneit:toString value="<%= template.getObjectLastModified() %>" mode="MidDate" />
</div>
<div class="m-user-right-padlock">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage + "&AssessmentCriteriaTemplateID=" + template.getObjectID())
.mapEntry("procParams", CollectionUtils.mapEntry("AssessmentCriteriaTemplate", template).toMap())
.toMap() %>">
<span class="m-user-right-padlockicon">
<span class="pencil"></span>
</span>
</oneit:button>
</div>
</div>
</div>
</div>
<%
}
%>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script">
<NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="CultureTemplates">
<createSpecificIdentifier factory='String' value='YUTCMLJKKD3SMG6LHWDE784O6Z642M'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="YUTCMLJKKD3SMG6LHWDE784O6Z642M"/>
</articleIdentifiers>
<createdLabel factory="String" value="YUTCMLJKKD3SMG6LHWDE784O6Z642M"/>
<newParentCategory factory="String" value="created:5L47UE8LMI51VOIOS8YTLLVQAT5NTW"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="String" value="second-menu"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Allow Disable" factory="Boolean" value="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="String" value="Culture Templates"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="String" value="template-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="CultureTemplates"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-07-04 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-07-04 10:00:00"/>
<NODE name="Title" factory="String" value="CultureTemplates"/>
<NODE name="ShortTitle" factory="String" value="Clients"/>
<NODE name="SortOrder" factory="Integer" value="37957080"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="CULTURE_TEMPLATES"/>
</ormAttributeChanges>
<content factory="Map">
<NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<OBJECTS xmlns:oneit="http://www.1iT.com.au" name="">
<NODE factory="Vector" name="Script">
<NODE class="oneit.appservices.upgrade.cms.CMSArticleUpdateOperation" factory="Participant" name="JobTemplates">
<createSpecificIdentifier factory='String' value='RHOF6HGKG4WNKHWJI8MNL8392TZY03'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="RHOF6HGKG4WNKHWJI8MNL8392TZY03"/>
</articleIdentifiers>
<createdLabel factory="String" value="RHOF6HGKG4WNKHWJI8MNL8392TZY03"/>
<newParentCategory factory="String" value="created:5L47UE8LMI51VOIOS8YTLLVQAT5NTW"/>
<articleAttributeChanges factory="Map">
<NODE name="Additional CSS Class" factory="String" value="second-menu"/>
<NODE name="Exclude From Sitemap" factory="Boolean" value="false"/>
<NODE name="Exclude from SEO Indexing" factory="Boolean" value="false"/>
<NODE name="Allow Disable" factory="Boolean" value="false"/>
<NODE name="Add Brackline Separator" factory="Boolean" value="false"/>
<NODE name="On Top Menu" factory="Boolean" value="false"/>
<NODE name="On Footer Left" factory="Boolean" value="false"/>
<NODE name="Menu Title" factory="String" value="Job Templates"/>
<NODE name="On Footer Menu" factory="Boolean" value="false"/>
<NODE name="Exclude From Search" factory="Boolean" value="false"/>
<NODE name="Menu Icon CSS" factory="String" value="template-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="JobTemplates"/>
<NODE name="Exclude From Navigation" factory="Boolean" value="false"/>
<NODE name="On Footer Right" factory="Boolean" value="false"/>
</articleAttributeChanges>
<ormAttributeChanges factory="Map">
<NODE name="PublishDate" factory="Date" value="2017-07-04 00:00:00"/>
<NODE name="WithdrawDate" factory="Date" value="2067-07-04 10:00:00"/>
<NODE name="Title" factory="String" value="JobTemplates"/>
<NODE name="ShortTitle" factory="String" value="Clients"/>
<NODE name="SortOrder" factory="Integer" value="37957079"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="JOB_TEMPLATES"/>
</ormAttributeChanges>
<content factory="Map">
<NODE name="Body" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
<NODE name="Synopsis" factory="Map">
<NODE name="Content" factory="String"><![CDATA[
<p></p>
]]></NODE>
<NODE name="IncludeContent" factory="Boolean" value="true"/>
</NODE>
</content>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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_culture_template</tableName>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_culture_template" indexName="idx_tl_culture_template_TemplateID" isUnique="true">
<column name="template_name"/>
<column name="hiring_team_id"/>
<column name="company_user_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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_assessment_template</tableName>
<column name="job_title" type="String" nullable="true" length="30"/>
<column name="job_description" type="CLOB" nullable="true"/>
<column name="ref_number" type="String" nullable="true" length="10"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="location_radius" type="String" nullable="true" length="200"/>
<column name="remote" type="Boolean" nullable="true"/>
<column name="job_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="require_cv" type="Boolean" nullable="true"/>
<column name="assessment_type" type="String" nullable="true" length="200"/>
<column name="include_assessment_criteria" type="Boolean" nullable="true"/>
<column name="level_id" type="Long" length="11" nullable="true"/>
<column name="occupation_id" type="Long" length="11" nullable="true"/>
<column name="job_owner_id" type="Long" length="11" nullable="true"/>
<column name="job_id" type="Long" length="11" nullable="true"/>
<column name="client_id" type="Long" length="11" nullable="true"/>
<column name="hiring_team_id" type="Long" length="11" nullable="true"/>
<column name="company_user_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_assessment_template" indexName="idx_tl_assessment_template_TemplateID" isUnique="true">
<column name="template_name"/>
<column name="hiring_team_id"/>
<column name="company_user_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
ALTER TABLE tl_culture_template ALTER COLUMN user_id DROP NOT NULL;
ALTER TABLE tl_assessment_template ALTER COLUMN user_id DROP NOT NULL;
ALTER TABLE tl_work_flow ALTER COLUMN job_id DROP NOT NULL;
<?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_culture_template</tableName>
<column name="culture_statement" type="String" nullable="true" length="2000"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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_work_flow</tableName>
<column name="template_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?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="template_id" type="Long" length="11" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 52.2 (67145) - http://www.bohemiancoding.com/sketch -->
<title>8A8DA27B-EA69-4B7E-9593-86C45C77A294</title>
<desc>Created with sketchtool.</desc>
<g id="2018---Create-Job" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Create-a-job---step-2-J002" transform="translate(-573.000000, -328.000000)" stroke="#9B9B9B" stroke-width="1.5">
<g id="Content-Region" transform="translate(260.000000, 64.000000)">
<g id="Content" transform="translate(185.000000, 191.000000)">
<g id="Form" transform="translate(109.000000, 60.000000)">
<g id="Template" transform="translate(1.000000, 2.000000)">
<g id="icon-reuse-sml" transform="translate(19.000000, 12.000000)">
<polyline id="Shape" points="11.3684211 14.3289474 8.40789474 14.3289474 8.40789474 17.2894737"></polyline>
<path d="M17.4213158,14.9076316 C16.7765888,16.7917652 14.9465335,18.007774 12.9597657,17.872178 C10.9729979,17.736582 9.32512688,16.2832064 8.94236842,14.3289474" id="Shape"></path>
<polyline id="Shape" points="14.9210526 11.9605263 17.8815789 11.9605263 17.8815789 9"></polyline>
<path d="M8.86815789,11.3818421 C9.51288486,9.49770846 11.3429402,8.2816997 13.329708,8.41729567 C15.3164757,8.55289165 16.9643468,10.0062673 17.3471053,11.9605263" id="Shape"></path>
<path d="M5.44736842,15.5131579 L1.30263158,15.5131579 C0.648610165,15.5131579 0.118421053,14.9829688 0.118421053,14.3289474 L0.118421053,1.30263158 C0.118421053,0.648610165 0.648610165,0.118421053 1.30263158,0.118421053 L9.69394737,0.118421053 C10.0079137,0.118697451 10.30892,0.243643441 10.5307895,0.465789474 L12.7981579,2.73236842 C13.0202078,2.95456064 13.1448792,3.25587339 13.1447368,3.57 L13.1447368,5.44736842" id="Shape"></path>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>
\ 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