Commit 17030d40 by Harsh Shah

Finish Hotfix-20190514

parents ed0b93ec 8193fd80
......@@ -36,6 +36,7 @@
<column name="last_plan_amount" type="Double" nullable="true"/>
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="plan_cancelled" type="Boolean" nullable="true"/>
<column name="message_id" type="Long" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="false"/>
<column name="billing_team_id" type="Long" length="11" nullable="true"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
......
......@@ -15,6 +15,7 @@
<column name="google_address_text" type="String" nullable="true" length="300"/>
<column name="prefer_remote" type="Boolean" nullable="true"/>
<column name="happy_to_relocate" type="Boolean" nullable="true"/>
<column name="is_email_ingest" type="Boolean" nullable="true"/>
<column name="candidate_id" type="Long" length="11" nullable="false"/>
<column name="job_id" type="Long" length="11" nullable="false"/>
</NODE>
......
......@@ -8,6 +8,7 @@
<column name="object_id" type="Long" nullable="false" length="11"/>
<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="message_id" type="Long" nullable="false"/>
<column name="template_name" type="String" nullable="false" length="200"/>
<column name="subject" type="String" nullable="false" length="200"/>
<column name="application_status" type="String" nullable="false" length="200"/>
......
......@@ -36,6 +36,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
message_id numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -15,6 +15,7 @@ CREATE TABLE tl_job_application (
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -8,6 +8,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
message_id numeric(12) NOT NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount number(20,5) NULL,
google_address_text varchar2(300) NULL,
plan_cancelled char(1) NULL,
message_id number(12) NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
......
......@@ -16,6 +16,7 @@ CREATE TABLE tl_job_application (
google_address_text varchar2(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
candidate_id number(12) NOT NULL,
job_id number(12) NOT NULL
);
......
......@@ -9,6 +9,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
message_id number(12) NOT NULL,
template_name varchar2(200) NOT NULL,
subject varchar2(200) NOT NULL,
application_status varchar2(200) NOT NULL,
......
......@@ -37,6 +37,7 @@ CREATE TABLE tl_hiring_team (
last_plan_amount numeric(20,5) NULL,
google_address_text varchar(300) NULL,
plan_cancelled char(1) NULL,
message_id numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -16,6 +16,7 @@ CREATE TABLE tl_job_application (
google_address_text varchar(300) NULL,
prefer_remote char(1) NULL,
happy_to_relocate char(1) NULL,
is_email_ingest char(1) NULL,
candidate_id numeric(12) NOT NULL,
job_id numeric(12) NOT NULL
);
......
......@@ -9,6 +9,7 @@ CREATE TABLE tl_message_template (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
message_id numeric(12) NOT NULL,
template_name varchar(200) NOT NULL,
subject varchar(200) NOT NULL,
application_status varchar(200) NOT NULL,
......
package performa.form;
import java.util.Map;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.security.SecUser;
import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.Debug;
import oneit.utils.MultiException;
import oneit.utils.RandomStringGen;
import oneit.utils.StringUtils;
import performa.orm.Candidate;
import performa.orm.Job;
import performa.orm.JobApplication;
import performa.utils.Utils;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.servlets.security.SessionSecUserDecorator;
public class IdentifyMaskedUserFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("IdentifyMaskedUserFP");
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
Job job = (Job) request.getAttribute("Job");
Debug.assertion(job != null, "BO not avaialble");
Candidate candidate = (Candidate) request.getAttribute("Candidate");
SecUser secUser = candidate.getUser();
BusinessObjectParser.assertFieldCondition(secUser.getEmail() != null , job, Job.FIELD_Email, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(secUser.getEmail()), job, Job.FIELD_Email, "invalid", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getFirstName() != null, secUser, SecUser.FIELD_FirstName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(secUser.getLastName() != null, secUser, SecUser.FIELD_LastName, "mandatory", exceptions, true, request);
if(candidate.isEmailFound())
{
String password = (String) request.getParameter("password");
BusinessObjectParser.assertFieldCondition(password != null, secUser, SecUser.FIELD_Password, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
HttpServletRequest request = submission.getRequest();
ObjectTransaction objTran = process.getTransaction();
Candidate candidate = (Candidate) request.getAttribute("Candidate");
JobApplication jobApplication = (JobApplication) request.getAttribute("JobApplication");
String password = (String) request.getParameter("password");
Job job = (Job) request.getAttribute("Job");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started IdentifyMaskedUserFP", candidate);
if(candidate.isTrue(candidate.getIsEmailIngest()) && candidate.isTrue(candidate.getIsMaskedEmail()))
{
SecUser old = (SecUser) candidate.getUser().getEarliestBackup();
String userEmail = candidate.getUser().getEmail();
if(CollectionUtils.equals(old.getEmail(), candidate.getUser().getEmail()))
{
throw new BusinessException("Please enter a valid email address");
}
if(Utils.emailExists(objTran, userEmail))
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "User account already exists with the entered email", candidate, "email: " , userEmail);
if(Utils.isCompanyUserEmailFound(objTran, userEmail))
{
throw new BusinessException("This email address is already in use by a Hiring Team account.");
}
SecUser newUser = candidate.getUser();
SecUser existingUser = SecUser.searchNAME(objTran, userEmail);
Candidate existingCandidate = existingUser.getExtension(Candidate.REFERENCE_Candidate);
if(!existingUser.checkPassword(password))
{
throw new BusinessException("Invalid Password. Please try again");
}
try
{
//Ideally should be managed with uniqueGroup, but uniqueGroup doesnt work without atleast 1 attribute
JobApplication.searchCandidateJob(process.getTransaction(), candidate, job); //It will throw RuntimeException when more than 1 record found.
}
catch(RuntimeException ex)
{
throw new BusinessException("You have already applied for this job.");
}
for(JobApplication application : candidate.getJobApplicationsSet())
{
application.setCandidate(existingCandidate);
}
existingUser.setFirstName(newUser.getFirstName());
existingUser.setLastName(newUser.getLastName());
existingCandidate.setKnownAsAlias(old.getEmail());
candidate.delete();
newUser.delete();
request.getSession().setAttribute (SecUser.SEC_USER_ID, existingUser);
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
}
else
{
//set new verification key as email changed
candidate.setVerificationKey(new RandomStringGen().generateAlphaNum(6));
candidate.getUser().setUserName(candidate.getUser().getEmail());
candidate.setIsMaskedEmail(false);
candidate.setKnownAsAlias(old.getEmail());
}
}
LogMgr.log(LOG, LogLevel.PROCESSING1, "Finish IdentifyMaskedUserFP");
return super.processForm(process, submission, params);
}
}
......@@ -60,7 +60,6 @@ public class SendVerificationMailFP extends SaveFP
if(job.getRequireCV())
{
BusinessObjectParser.assertFieldCondition(jobApplication.getCV() != null , jobApplication, JobApplication.FIELD_CV, "uploadCV", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(jobApplication.getCoverLetter() != null , jobApplication, JobApplication.FIELD_CoverLetter, "uploadCover", exceptions, true, request);
}
BusinessObjectParser.assertFieldCondition(candidate.getGoogleAddressText() != null, candidate, Candidate.FIELD_GoogleAddressText, "mandatory", exceptions, true, request);
......@@ -130,25 +129,9 @@ public class SendVerificationMailFP extends SaveFP
}
else
{
if(candidate.isTrue(candidate.getIsEmailIngest()))
if(candidate.isTrue(candidate.getIsEmailIngest()) || jobApplication.getApplicationStatus() == ApplicationStatus.POST_INGEST)
{
if(candidate.isTrue(candidate.getIsMaskedEmail()))
{
SecUser old = (SecUser) candidate.getUser().getEarliestBackup();
if(CollectionUtils.equals(old.getEmail(), candidate.getUser().getEmail()))
{
throw new BusinessException("Please enter a valid email address");
}
//set new verification key as email changed
candidate.setVerificationKey(new RandomStringGen().generateAlphaNum(6));
candidate.getUser().setUserName(candidate.getUser().getEmail());
candidate.setIsMaskedEmail(false);
candidate.setKnownAsAlias(old.getEmail());
}
else
if(candidate.isFalse(candidate.getIsMaskedEmail()))
{
candidate.setIsAccountVerified(true);
}
......
......@@ -22,7 +22,7 @@ public class VerifyIdentityFP extends SaveFP
HttpServletRequest request = submission.getRequest();
Candidate candidate = (Candidate) request.getAttribute("Candidate");
if(candidate.isTrue(candidate.getIsEmailIngest()) && candidate.getKnownAsAlias() == null && !candidate.isTrue(candidate.getIsPasswordChanged()))
if(candidate.isTrue(candidate.getIsEmailIngest()) && !candidate.isTrue(candidate.getIsPasswordChanged()))
{
request.getSession().setAttribute (SecUser.SEC_USER_ID, candidate.getUser());
request.getSession().setAttribute (SessionSecUserDecorator.REFRESH_SECURITY, Boolean.TRUE);
......
......@@ -13,6 +13,7 @@ import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.objstore.utils.ObjstoreUtils;
import oneit.security.SecUser;
import oneit.servlets.objstore.MessageSourceDecorator;
import oneit.servlets.process.ORMProcessState;
import oneit.utils.BusinessException;
......@@ -200,4 +201,19 @@ public class Candidate extends BaseCandidate
{
return !isTrue(getIsAccountVerified()) && isTrue(getIsEmailIngest());
}
public Boolean isEmailFound()
{
if(getUser() != null && getUser().getEmail() != null)
{
SecUser user = SecUser.searchNAME(getTransaction(), getUser().getEmail().toLowerCase());
if(user != null && user.getExtension(Candidate.REFERENCE_Candidate) != null && user.getExtension(Candidate.REFERENCE_Candidate).getIsAccountVerified())
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}
}
\ No newline at end of file
......@@ -46,6 +46,7 @@
<ATTRIB name="LastPlanAmount" type="Double" dbcol="last_plan_amount" />
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300" />
<ATTRIB name="PlanCancelled" type="Boolean" dbcol="plan_cancelled" defaultValue="Boolean.FALSE"/>
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" />
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" mandatory="true" backreferenceName="HiringTeams" />
<SINGLEREFERENCE name="BilledByTeam" type="HiringTeam" dbcol="billing_team_id" mandatory="false" backreferenceName="BillingTeams" />
......
......@@ -52,7 +52,11 @@ public class JobApplication extends BaseJobApplication
});
// create scheduled emails for new application status
MessageTemplate[] templates = MessageTemplate.SearchByAll().andApplicationStatus(new EqualsFilter<>(getApplicationStatus())).search(getTransaction());
int messageID = getJob().getHiringTeam().getMessageID() != null ? getJob().getHiringTeam().getMessageID() : 1;
MessageTemplate[] templates = MessageTemplate.SearchByAll()
.andApplicationStatus(new EqualsFilter<>(getApplicationStatus()))
.andMessageID(new EqualsFilter<>(messageID))
.search(getTransaction());
for(MessageTemplate template : templates)
......
......@@ -30,6 +30,7 @@
<ATTRIB name="GoogleAddressText" type="String" dbcol="google_address_text" length="300"/>
<ATTRIB name="PreferRemote" type="Boolean" dbcol="prefer_remote" defaultValue="Boolean.FALSE"/>
<ATTRIB name="HappyToRelocate" type="Boolean" dbcol="happy_to_relocate"/>
<ATTRIB name="IsEmailIngest" type="Boolean" dbcol="is_email_ingest" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="Candidate" type="Candidate" dbcol="candidate_id" backreferenceName="JobApplications" mandatory="true"/>
<SINGLEREFERENCE name="Job" type="Job" dbcol="job_id" backreferenceName="JobApplications" mandatory="true"/>
......
......@@ -6,6 +6,7 @@
<IMPORT value="performa.orm.*"/>
<TABLE name="tl_message_template" tablePrefix="object" polymorphic="FALSE">
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" mandatory="true" defaultValue="1"/>
<ATTRIB name="TemplateName" type="String" dbcol="template_name" mandatory="true" length="200" />
<ATTRIB name="Subject" type="String" dbcol="subject" mandatory="true" length="200" />
<ATTRIB name="ApplicationStatus" type="ApplicationStatus" dbcol="application_status" mandatory="true" defaultValue="ApplicationStatus.DRAFT" attribHelper="EnumeratedAttributeHelper" />
......
......@@ -6,6 +6,7 @@ import javax.mail.*;
import javax.mail.internet.*;
import javax.mail.search.*;
import oneit.appservices.config.ConfigMgr;
import oneit.appservices.documents.HTML2PDF;
import oneit.components.*;
import oneit.email.EmailFetcher;
import oneit.logging.*;
......@@ -14,6 +15,9 @@ import oneit.objstore.services.*;
import oneit.security.SecUser;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import performa.orm.*;
import performa.orm.types.ApplicationStatus;
......@@ -25,7 +29,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
private static final String SERVER_PROTOCOL = ConfigMgr.getKeyfileString("imap.server.protocol", "imaps");
private static final String ACC_USER_NAME = ConfigMgr.getKeyfileString("imap.email.acc.username");
private static final String ACC_PASSWORD = ConfigMgr.getKeyfileString("imap.email.acc.password");
private static final boolean SYNC_ALL_EXISTING_EMAILS = ConfigMgr.getKeyfileBoolean("sync.all.existing.emails", true);
private static final boolean SYNC_ALL_EXISTING_EMAILS = ConfigMgr.getKeyfileBoolean("sync.all.existing.emails", false);
private static final Integer SYNC_EMAILS_SINCE_MINUTES = ConfigMgr.getKeyfileInt("sync.emails.since.minutes", 30*60); //Applicable only when SYNC_ALL_EXISTING_EMAILS is false.
public static final LoggingArea LOG = LoggingArea.createLoggingArea("PerformaEmailFetcher");
......@@ -234,6 +238,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
String tmpRecipient = null;
String tmpJobId = null;
String tmpMessageID = null;
String tmpMessageBody = null;
List<FileBinaryContent> tmpContents;
......@@ -247,6 +252,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
final String emailText;
final String jobIdentifier;
final String messageID;
final String messageBody;
final List<FileBinaryContent> contents;
try
......@@ -293,6 +299,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
tmpEmailText = EmailFetcher.getText(message, new ArrayList<>());
tmpContents = getAttachments(message);
tmpMessageBody = EmailFetcher.getText(message, new ArrayList());
}
catch (MessagingException | IOException ex)
{
......@@ -311,6 +318,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
contents = tmpContents;
emailText = tmpEmailText;
messageID = tmpMessageID;
messageBody = tmpMessageBody;
try
{
......@@ -376,6 +384,7 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0)
{
......@@ -427,12 +436,28 @@ public class PerformaEmailFetcher implements Runnable, InitialisationParticipant
JobApplication jobApplication = JobApplication.createNewApplication(candidate, job);
jobApplication.setApplicationStatus(ApplicationStatus.POST_INGEST);
jobApplication.setIsEmailIngest(true);
if(contents.size() > 0)
{
jobApplication.setCV(contents.get(0));
}
Document document = Jsoup.parse(messageBody);
Element table = document.select("table").size() > 14 ? document.select("table").get(14) : null;
if(table != null)
{
Element firstTR = table.select("tr").first();
ByteArrayOutputStream out = new ByteArrayOutputStream();
HTML2PDF.HTML2PDF(firstTR.toString() , out, "");
FileBinaryContent binaryContent = new FileBinaryContent("application/pdf", out.toByteArray(), "CoverLetter");
jobApplication.setCoverLetter(binaryContent);
}
}
private void createEmailMessage(ObjectTransaction objTran, Job job) throws StorageException, FieldException
......
......@@ -80,6 +80,12 @@
if(isMobile)
{
String accept = request.getHeader("accept");
String userAgent = request.getHeader("user-agent");
String uaOS = request.getHeader("UA-OS");
LogMgr.log(HiringTeam.LOG, LogLevel.PROCESSING1, "IsMobile accept :", accept, " user agent: ", userAgent, " uaOS: ", uaOS );
response.sendRedirect(request.getContextPath() + "/extensions/adminportal/responsive_alert.jsp");
}
......
......@@ -80,7 +80,7 @@
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).mapEntry("Applications", applications).toMap())
.toMap() %>">
<%
if(jobApplication.isTrue(candidate.getIsEmailIngest()))
if(jobApplication.isTrue(jobApplication.getIsEmailIngest()))
{
%>
<span style="padding-right: 5px;"><img src="images/email-ingest-icon.jpg"></span>
......
......@@ -54,3 +54,4 @@ HiringTeam.HiringTeamLogo = Hiring Team Logo
HiringTeam.HiringTeamType = Hiring Team Type
HiringTeam.HiringTeamName = Hiring Team Name
HiringTeam.BilledByTeam = Billing Team
HiringTeam.MessageID = Message ID
......@@ -246,6 +246,16 @@
</div>
</div>
<%
if(Utils.isAssumedUser(request))
{
%>
<div class="form-group">
<label><oneit:ormlabel obj="<%= hiringTeam %>" field="MessageID" /></label>
<oneit:ormInput obj="<%= hiringTeam %>" type="text" attributeName="MessageID" cssClass="form-control"/>
</div>
<%
}
if(company.getHiringTeamsCount() > 1)
{
%>
......
<?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_application</tableName>
<column name="is_email_ingest" type="Boolean" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
UPDATE tl_job_application SET is_email_ingest = 'Y' FROM oneit_sec_user_extension WHERE oneit_sec_user_extension.object_id = tl_job_application.candidate_id AND oneit_sec_user_extension.is_email_ingest = 'Y';
\ No newline at end of file
......@@ -4,6 +4,7 @@
<NODE name="dynamic_content_form::APPLICANT_PORTAL" factory="Participant">
<FORM name="*.signIn" factory="Participant" class="performa.form.SignInCandidateFP"/>
<FORM name="*.verifyIdentity" factory="Participant" class="performa.form.VerifyIdentityFP"/>
<FORM name="*.identifyUser" factory="Participant" class="performa.form.IdentifyMaskedUserFP"/>
<FORM name="*.completeApplication" factory="Participant" class="performa.form.CompleteApplicationFP"/>
<FORM name="*.validateApplication" factory="Participant" class="performa.form.ValidateApplicationFP"/>
<FORM name="*.saveAndExitExperienece" factory="Participant" class="performa.form.SaveAndExitExperienceFP"/>
......
......@@ -25,6 +25,7 @@
<RenderMode name="Page" preIncludeJSP="extensions/applicantportal/job_overview.jsp"/>
<RenderMode name="SignIn" preIncludeJSP="extensions/applicantportal/sign_in.jsp"/>
<RenderMode name="VerifyIdentity" preIncludeJSP="extensions/applicantportal/verify_identity.jsp"/>
<RenderMode name="MaskedIdentity" preIncludeJSP="extensions/applicantportal/masked_identity.jsp"/>
<RenderMode name="VerificationSent" preIncludeJSP="extensions/applicantportal/verification_sent.jsp"/>
<RenderMode name="ForgotPassword" preIncludeJSP="extensions/applicantportal/forgot_password.jsp"/>
<RenderMode name="ResetPassword" preIncludeJSP="extensions/applicantportal/reset_password.jsp"/>
......
......@@ -45,6 +45,7 @@
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
Job job = (Job) process.getAttribute("Job");
SecUser secUser = (SecUser) process.getAttribute("User");
String id = request.getParameter("id");
String key = request.getParameter("key");
......@@ -55,6 +56,11 @@
}
Debug.assertion(job != null, "Invalid job in applicant portal");
if(secUser != null)
{
job.setEmail(secUser.getEmail());
}
%>
<div class="main-verify-identity">
<div class="login-logo"><img src="<%= request.getContextPath() %>/images/logo.png" /></div>
......
......@@ -32,7 +32,11 @@
String navigateTo = WebUtils.getSamePageInRenderMode(request, "SignIn") + "&UserName=" + secUser.getEmail();
if((loggedInUser != null && loggedInUser == secUser) || candidate.isUnverifiedEmailIngestUser() || !candidate.isTrue(candidate.getIsPasswordChanged()))
if(candidate.isUnverifiedEmailIngestUser() && candidate.isTrue(candidate.getIsMaskedEmail()))
{
navigateTo = WebUtils.getSamePageInRenderMode(request,"MaskedIdentity");
}
else if((loggedInUser != null && loggedInUser == secUser) || candidate.isUnverifiedEmailIngestUser() || !candidate.isTrue(candidate.getIsPasswordChanged()))
{
navigateTo = WebUtils.getSamePageInRenderMode(request,"VerifyIdentity");
}
......
<%@ 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, "Job", Job.REFERENCE_Job);
Job job = (Job) process.getAttribute("Job");
Debug.assertion(job != null && !toRedirect, "Invalid job in applicant portal");
SecUser secUser = SecUser.getTXUser(transaction);
Debug.assertion(secUser != null, "Invalid candidate in applicant portal");
Candidate candidate = secUser.getExtension(Candidate.REFERENCE_Candidate);
Debug.assertion(candidate != null, "Invalid candidate in applicant portal");
String successPage = WebUtils.getSamePageInRenderMode(request, "VerifyIdentity") + "&JobID=" + job.getID();
JobApplication jobApplication = JobApplication.searchCandidateJob(transaction, candidate, job);
jobApplication.setIsEmailIngest(true);
process.setAttribute("JobApplication", jobApplication);
process.setAttribute("User", secUser);
%>
<style>
button[disabled] {
opacity: 0.6;
background-color: #0582ba;
}
.email input[name$="Email"] {
opacity: 0;
position: absolute;
}
.forgot-pass{
margin-top: 20px;
}
</style>
<script type="text/javascript">
$(document.body).addClass('bg-color');
var interval ;
$(document).ready(function() {
recalcFunction = setupRecalc ($("form#signIn"), {'recalcOnError':true});
});
</script>
<oneit:form name="signIn" method="post" enctype="multipart/form-data">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="apply-job-logo-header signinpage">
<div class="box-sizing-border-box">
<div class="logo-img">
<%
BinaryContent logo = job.getLogo();
if(logo != null)
{
int logoHeight = 45;
%>
<tagfile:img src="<%= ThumbnailUtils.filterImage(DiskFileBinaryContent.getRelativeURL(logo), "KEEP", new ScaleWithin (0, logoHeight)) %>" />
<%
}
%>
</div>
<div class="header-title">
<%= job.getTeamName() %>
</div>
</div>
</div>
<div class="main-verify-identity">
<div class="pl-confirm text-center">Please confirm your details to continue</div>
<div class="main-box-layout main-verify-step-2">
<div class="form-group text-left">
<label>Email Address</label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true"/>
</div>
<div class="row">
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="FirstName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="FirstName" cssClass="form-control second-style" required="true"/>
</div>
<div class="form-group text-left col-sm-6 col-xs-12">
<label><oneit:ormlabel obj="<%= secUser %>" field="LastName" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="LastName" cssClass="form-control second-style" required="true"/>
</div>
</div>
<oneit:recalcClass htmlTag="div" classScript="candidate.isEmailFound() ? 'show': 'hide'" candidate="<%= candidate %>">
<div class="form-group text-left email">
<label style="display: none;"><oneit:ormlabel obj="<%= secUser %>" field="Email" /></label>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control"/>
</div>
<div class="form-group text-left">
<label>Password</label>
<input type="password" class="form-control" name="password">
</div>
</oneit:recalcClass>
<div class="form-group">
<oneit:recalcClass htmlTag="div" classScript="candidate.isEmailFound() ? 'show': 'hide'" candidate="<%= candidate %>">
<oneit:button value="Forgot password?" name="gotoPage" cssClass="forgot-pass" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "ForgotPassword"))
.mapEntry("procParams", CollectionUtils.mapEntry("Job", job).mapEntry("User", secUser).toMap())
.toMap() %>"/>
</oneit:recalcClass>
<oneit:button value="Submit" name="identifyUser" cssClass="box-btn login-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", successPage)
.mapEntry("Job",job)
.mapEntry("Candidate",candidate)
.mapEntry("JobApplication",jobApplication)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.toMap() %>"/>
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
......@@ -163,7 +163,7 @@
<div class="form-group text-left">
<label>Email Address</label>
<%
if(secUser.getEmail() == null || (candidate.isUnverifiedEmailIngestUser() && candidate.isTrue(candidate.getIsMaskedEmail())))
if(secUser.getEmail() == null)
{
%>
<oneit:ormInput obj="<%= secUser %>" type="text" attributeName="Email" cssClass="form-control" style="text-transform: lowercase" required="true"/>
......@@ -201,7 +201,6 @@
<label>Confirm password</label>
<oneit:input type="password" name="<%= passkey + 2 %>" class="form-control second-style reset-pw"/>
</div>
<%
}
%>
......@@ -224,7 +223,7 @@
{
%>
<div class="form-group text-left relative-parent ">
<label>Upload your CV (PDF preferred)</label>
<label>Upload your CV, required (PDF preferred)</label>
<div class="form-control second-style">
<a target='blank' class="new-file-link" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CV", jobApplication.getCV(), true) %>'>
<%= jobApplication.getCV() != null ? "Click to View File" : "" %>
......@@ -234,7 +233,7 @@
</div>
</div>
<div class="form-group text-left relative-parent">
<label>Upload your Cover Letter (PDF preferred)</label>
<label>Upload your Cover Letter, optional (PDF preferred)</label>
<div class="form-control second-style">
<a target='blank' class="new-file-link" href='<%= request.getContextPath() + "/" + BinaryContentHandler.getRelativeURL(request, jobApplication, "CoverLetter", jobApplication.getCoverLetter(), true) %>'>
<%= jobApplication.getCoverLetter() != null ? "Click to View File" : "" %>
......
......@@ -53,6 +53,15 @@
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="MessageID"/>
</oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= messageTemplate %>" attributeName="MessageID"/>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormlabel obj="<%= messageTemplate %>" field="TemplateName"/>
</oneit:layout_label>
<oneit:layout_field width="1">
......
......@@ -4,3 +4,4 @@ MessageTemplate.MessageContent = Message Content
MessageTemplate.PlaceholderVariable = Placeholder Variable
MessageTemplate.DelayHrs = Delay
MessageTemplate.TemplateName = Template Name
MessageTemplate.MessageID = Message ID
\ 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_hiring_team</tableName>
<column name="message_id" type="Long" 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_message_template</tableName>
<column name="message_id" type="Long" nullable="true"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
UPDATE tl_message_template SET message_id = 1 WHERE message_id IS NULL;
\ 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