Commit 52f3f572 by Nilu

Merge branch 'feature/Feature-Phase-3.1' into feature/Feature-Phase-3.1-2

parents e068d5b9 7db6b3ec
......@@ -20,6 +20,7 @@
<column name="is_email_changed" type="Boolean" nullable="true"/>
<column name="user_id" type="Long" length="11" nullable="true"/>
<column name="company_id" type="Long" length="11" nullable="true"/>
<column name="default_hiring_team_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="oneit_sec_user_extension" indexName="idx_oneit_sec_user_extension_user_id" isUnique="false"><column name="user_id"/></NODE>
......
<?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.DefineTableOperation">
<tableName factory="String">tl_company_user_hiring_team_link</tableName>
<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="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_company_user_hiring_team_link" indexName="idx_tl_company_user_hiring_team_link_hiring_team_id" isUnique="false"><column name="hiring_team_id"/></NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_company_user_hiring_team_link" indexName="idx_tl_company_user_hiring_team_link_company_user_id" isUnique="false"><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.DefineTableOperation">
<tableName factory="String">tl_hiring_team</tableName>
<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="hiring_team_name" type="String" nullable="false" length="100"/>
<column name="hiring_team_logo" type="BLOB" nullable="true"/>
<column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
<column name="manage_own_billing" type="Boolean" nullable="true"/>
<column name="stripe_reference" type="String" nullable="true" length="100"/>
<column name="stripe_subscription" type="String" nullable="true" length="100"/>
<column name="name_on_card" type="String" nullable="true" length="100"/>
<column name="card_post_code" type="String" nullable="true" length="10"/>
<column name="card_id" type="String" nullable="true" length="100"/>
<column name="plan_renewed_on" type="Date" nullable="true"/>
<column name="used_credits" 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"/>
<column name="payment_plan_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_hiring_team" indexName="idx_tl_hiring_team_company_id" isUnique="false"><column name="company_id"/></NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -18,7 +18,8 @@ CREATE TABLE oneit_sec_user_extension (
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
company_id numeric(12) NULL,
default_hiring_team_id numeric(12) NULL
);
......
-- DROP TABLE tl_company_user_hiring_team_link;
CREATE TABLE tl_company_user_hiring_team_link (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
);
ALTER TABLE tl_company_user_hiring_team_link ADD
CONSTRAINT PK_tl_company_user_hiring_team_link PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_company_user_hiring_team_link_hiring_team_id
ON tl_company_user_hiring_team_link (hiring_team_id);
CREATE INDEX idx_tl_company_user_hiring_team_link_company_user_id
ON tl_company_user_hiring_team_link (company_user_id);
-- DROP TABLE tl_hiring_team;
CREATE TABLE tl_hiring_team (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
hiring_team_name varchar(100) NOT NULL,
hiring_team_logo image NULL,
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
manage_own_billing char(1) NULL,
stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL,
name_on_card varchar(100) NULL,
card_post_code varchar(10) NULL,
card_id varchar(100) NULL,
plan_renewed_on datetime NULL,
used_credits numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
ALTER TABLE tl_hiring_team ADD
CONSTRAINT PK_tl_hiring_team PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_hiring_team_company_id
ON tl_hiring_team (company_id);
......@@ -19,7 +19,8 @@ CREATE TABLE oneit_sec_user_extension (
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id number(12) NULL,
company_id number(12) NULL
company_id number(12) NULL,
default_hiring_team_id number(12) NULL
);
......
-- DROP TABLE tl_company_user_hiring_team_link;
CREATE TABLE tl_company_user_hiring_team_link (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
hiring_team_id number(12) NULL,
company_user_id number(12) NULL
);
ALTER TABLE tl_company_user_hiring_team_link ADD
CONSTRAINT PK_tl_company_user_hiring_team_link PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_company_user_hiring_team_link_hiring_team_id
ON tl_company_user_hiring_team_link (hiring_team_id);
CREATE INDEX idx_tl_company_user_hiring_team_link_company_user_id
ON tl_company_user_hiring_team_link (company_user_id);
-- DROP TABLE tl_hiring_team;
CREATE TABLE tl_hiring_team (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
hiring_team_name varchar2(100) NOT NULL,
hiring_team_logo blob NULL,
hiring_team_type varchar2(200) NULL,
industry varchar2(200) NULL,
time_zone varchar2(200) NULL,
state varchar2(200) NULL,
country varchar2(200) NULL,
post_code varchar2(10) NULL,
city varchar2(100) NULL,
has_client_support char(1) NULL,
manage_own_billing char(1) NULL,
stripe_reference varchar2(100) NULL,
stripe_subscription varchar2(100) NULL,
name_on_card varchar2(100) NULL,
card_post_code varchar2(10) NULL,
card_id varchar2(100) NULL,
plan_renewed_on date NULL,
used_credits number(12) NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
payment_plan_id number(12) NULL
);
ALTER TABLE tl_hiring_team ADD
CONSTRAINT PK_tl_hiring_team PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_hiring_team_company_id
ON tl_hiring_team (company_id);
......@@ -19,7 +19,8 @@ CREATE TABLE oneit_sec_user_extension (
is_account_verified char(1) NULL,
is_email_changed char(1) NULL,
user_id numeric(12) NULL,
company_id numeric(12) NULL
company_id numeric(12) NULL,
default_hiring_team_id numeric(12) NULL
);
......
-- @AutoRun
-- drop table tl_company_user_hiring_team_link;
CREATE TABLE tl_company_user_hiring_team_link (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
hiring_team_id numeric(12) NULL,
company_user_id numeric(12) NULL
);
ALTER TABLE tl_company_user_hiring_team_link ADD
CONSTRAINT pk_tl_company_user_hiring_team_link PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_company_user_hiring_team_link_hiring_team_id
ON tl_company_user_hiring_team_link (hiring_team_id);
CREATE INDEX idx_tl_company_user_hiring_team_link_company_user_id
ON tl_company_user_hiring_team_link (company_user_id);
-- @AutoRun
-- drop table tl_hiring_team;
CREATE TABLE tl_hiring_team (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
hiring_team_name varchar(100) NOT NULL,
hiring_team_logo bytea NULL,
hiring_team_type varchar(200) NULL,
industry varchar(200) NULL,
time_zone varchar(200) NULL,
state varchar(200) NULL,
country varchar(200) NULL,
post_code varchar(10) NULL,
city varchar(100) NULL,
has_client_support char(1) NULL,
manage_own_billing char(1) NULL,
stripe_reference varchar(100) NULL,
stripe_subscription varchar(100) NULL,
name_on_card varchar(100) NULL,
card_post_code varchar(10) NULL,
card_id varchar(100) NULL,
plan_renewed_on timestamp NULL,
used_credits numeric(12) NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
ALTER TABLE tl_hiring_team ADD
CONSTRAINT pk_tl_hiring_team PRIMARY KEY
(
object_id
) ;
CREATE INDEX idx_tl_hiring_team_company_id
ON tl_hiring_team (company_id);
......@@ -35,9 +35,9 @@ public class SendVerificationMailFP extends SaveFP
Job job = (Job) request.getAttribute("Job");
Company company = (Company) request.getAttribute("Company");
Debug.assertion(company != null || job!=null, "BO not avaialble");
Debug.assertion(company != null || job != null, "BO not avaialble");
if(company!=null)
if(company != null)
{
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
......@@ -61,7 +61,7 @@ public class SendVerificationMailFP extends SaveFP
Job job = (Job) request.getAttribute("Job");
Company company = (Company) request.getAttribute("Company");
if(company!=null)
if(company != null)
{
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
......@@ -99,6 +99,11 @@ public class SendVerificationMailFP extends SaveFP
//set default to admin
companyUser.setRole(RoleType.ADMIN);
if(companyUser.getDefaultHiringTeam() != null)
{
companyUser.getDefaultHiringTeam().setHiringTeamName(company.getCompanyName());
}
Utils.sendVerificationMail(companyUser, request, emailer, SendVerificationMailFP.class.getName());
LogMgr.log(LOG, LogLevel.PROCESSING1, "End of sending varification email.", companyUser);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,7 @@ import oneit.objstore.ObjectStatus;
import oneit.objstore.ValidationContext;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.security.SecUser;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils;
import oneit.utils.math.NullArith;
......@@ -27,12 +28,25 @@ public class Company extends BaseCompany
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
protected void postInitNewObj() throws BusinessException
{
addToHiringTeams(HiringTeam.createHiringTeam(getTransaction()));
super.postInitNewObj();
}
public boolean showHasClientSupport()
{
return isTrue(getHasClientSupport());
}
public boolean showTeamManagesOwnBilling()
{
return isTrue(getManageOwnBilling());
}
//This logic moved from invite_users.jsp
public boolean createDefaultUser() throws FieldException
{
......@@ -56,18 +70,6 @@ public class Company extends BaseCompany
}
@Override
public void validate(ValidationContext context)
{
if(getStatus() != ObjectStatus.NEW)
{
context.check(getHiringTeamType() != null , this, FIELD_HiringTeamType, "mandatory");
}
super.validate(context);
}
public Boolean isEmailCorrect()
{
return StringUtils.isEmailAddress(StringUtils.subBlanks(getUserEmail()));
......@@ -226,4 +228,9 @@ public class Company extends BaseCompany
return Boolean.FALSE;
}
public HiringTeam getDefaultHiringTeam()
{
return getHiringTeamsCount() > 0 ? getHiringTeamsAt(0) : null;
}
}
\ No newline at end of file
......@@ -8,19 +8,26 @@
<IMPORT value="performa.orm.types.TimeZone"/>
<IMPORT value="oneit.business.shopping.orm.*"/>
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company"/>
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company"/>
<TRANSIENT name="UserEmail" type="String"/>
<TRANSIENT name="FirstName" type="String"/>
<TRANSIENT name="LastName" type="String"/>
<MULTIPLEREFERENCE name="Users" type="CompanyUser" backreferenceName="Company" />
<MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="Company" />
<MULTIPLEREFERENCE name="HiringTeams" type="HiringTeam" backreferenceName="Company" />
<TRANSIENT name="HiringTeamName" type="String" />
<TRANSIENT name="ManageOwnBilling" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="UserEmail" type="String" />
<TRANSIENT name="FirstName" type="String" />
<TRANSIENT name="LastName" type="String" />
<TRANSIENT name="RoleType" type="RoleType" defaultValue="RoleType.STANDARD" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="CompletedProfile" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="PaymentJobCount" type="Integer"/>
<TRANSIENT name="PaymentJobCount" type="Integer" />
<TRANSIENT name="StripeLast4" type="String" />
<TRANSIENT name="StripeBrand" type="String" />
<TRANSIENTSINGLE name="Owner" type="CompanyUser" />
<TRANSIENTSINGLE name="BillingTeam" type="HiringTeam" />
<TABLE name="tl_company" tablePrefix="object">
<ATTRIB name="CompanyName" type="String" dbcol="company_name" mandatory="true" length="100" />
......
......@@ -7,6 +7,8 @@
<IMPORT value="oneit.security.*" />
<IMPORT value="performa.orm.types.*"/>
<MULTIPLEREFERENCE name="HiringTeams" type="CompanyUserHiringTeamLink" backreferenceName="CompanyUser" />
<TRANSIENT name="Email" type="String" validators="Email" />
<TRANSIENT name="Password" type="String"/>
<TRANSIENT name="ConfirmPassword" type="String"/>
......@@ -25,6 +27,7 @@
<SINGLEREFERENCE name="User" type="SecUser" dbcol="user_id" backreferenceName="Extensions" inSuper='TRUE'/>
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" backreferenceName="Users"/>
<SINGLEREFERENCE name="DefaultHiringTeam" type="HiringTeam" dbcol="default_hiring_team_id" />
</TABLE>
......
package performa.orm;
public class CompanyUserHiringTeamLink extends BaseCompanyUserHiringTeamLink
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public CompanyUserHiringTeamLink ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="CompanyUserHiringTeamLink" package="performa.orm">
<TABLE name="tl_company_user_hiring_team_link" tablePrefix="object">
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="hiring_team_id" backreferenceName="Users" />
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="company_user_id" backreferenceName="HiringTeams" />
</TABLE>
<SEARCH type="All" paramFilter="tl_company_user_hiring_team_link.object_id is not null" >
</SEARCH>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
package performa.orm;
import oneit.objstore.ObjectStatus;
import oneit.objstore.ValidationContext;
import oneit.utils.StringUtils;
public class HiringTeam extends BaseHiringTeam
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public HiringTeam ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public void validate(ValidationContext context)
{
if(getStatus() != ObjectStatus.NEW)
{
context.check(getHiringTeamType() != null , this, FIELD_HiringTeamType, "mandatory");
}
super.validate(context);
}
@Override
public String getToString()
{
return StringUtils.subNulls(getHiringTeamName(), super.getToString());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="HiringTeam" package="performa.orm">
<IMPORT value="performa.orm.types.*"/>
<IMPORT value="performa.orm.types.TimeZone"/>
<IMPORT value="oneit.business.shopping.orm.*"/>
<MULTIPLEREFERENCE name="Users" type="CompanyUserHiringTeamLink" backreferenceName="HiringTeam" />
<!-- <MULTIPLEREFERENCE name="Clients" type="Client" backreferenceName="HiringTeam" />-->
<TABLE name="tl_hiring_team" tablePrefix="object">
<ATTRIB name="HiringTeamName" type="String" dbcol="hiring_team_name" mandatory="true" length="100" />
<ATTRIB name="HiringTeamLogo" type="BinaryContent" dbcol="hiring_team_logo" mandatory="false" binaryHandler="loggedin" attribHelper="BLOBAttributeHelper" attribHelperInstance="BLOBAttributeHelper.INSTANCE" />
<ATTRIB name="HiringTeamType" type="HiringTeamType" dbcol="hiring_team_type" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Industry" type="Industry" dbcol="industry" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="TimeZone" type="TimeZone" dbcol="time_zone" mandatory="false" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="State" type="State" dbcol="state" mandatory="false" defaultValue="State.WA" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="Country" type="Countries" dbcol="country" mandatory="false" defaultValue="Countries.AU" attribHelper="EnumeratedAttributeHelper"/>
<ATTRIB name="PostCode" type="String" dbcol="post_code" mandatory="false" length="10"/>
<ATTRIB name="City" type="String" dbcol="city" mandatory="false" length="100"/>
<ATTRIB name="HasClientSupport" type="Boolean" dbcol="has_client_support" mandatory="false" defaultValue="Boolean.FALSE"/>
<ATTRIB name="ManageOwnBilling" type="Boolean" dbcol="manage_own_billing" mandatory="false" defaultValue="Boolean.TRUE"/>
<ATTRIB name="StripeReference" type="String" dbcol="stripe_reference" length="100" />
<ATTRIB name="StripeSubscription" type="String" dbcol="stripe_subscription" length="100" />
<ATTRIB name="NameOnCard" type="String" dbcol="name_on_card" length="100" />
<ATTRIB name="CardPostCode" type="String" dbcol="card_post_code" length="10" />
<ATTRIB name="CardID" type="String" dbcol="card_id" length="100" />
<ATTRIB name="PlanRenewedOn" type="Date" dbcol="plan_renewed_on" mandatory="false" />
<ATTRIB name="UsedCredits" type="Integer" dbcol="used_credits" />
<SINGLEREFERENCE name="Company" type="Company" dbcol="company_id" mandatory="true" backreferenceName="HiringTeams" />
<SINGLEREFERENCE name="BillingTeam" type="HiringTeam" dbcol="billing_team_id" mandatory="false" />
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true" />
<SINGLEREFERENCE name="PaymentPlan" type="PaymentPlan" dbcol="payment_plan_id" mandatory="false" />
</TABLE>
<SEARCH type="All" paramFilter="tl_hiring_team.object_id is not null" >
</SEARCH>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -533,4 +533,10 @@ public class Utils
{
return PaymentPlan.SearchByMax().search(objTran);
}
public static HiringTeam[] getHiringTeamsByUser(CompanyUser companyUser)
{
return companyUser.pipelineCompanyUser().toHiringTeams().toHiringTeam().uniqueVals().toArray(new HiringTeam[0]);
}
}
\ No newline at end of file
......@@ -76,7 +76,8 @@
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/my_company.jsp"/>
<RenderMode name="Page" preIncludeJSP="extensions/adminportal/hiring_teams.jsp"/>
<RenderMode name="HiringTeam" preIncludeJSP="extensions/adminportal/my_company.jsp"/>
<RenderMode name="ManagePlan" preIncludeJSP="extensions/adminportal/manage_plan.jsp"/>
<RenderMode name="Billing" preIncludeJSP="extensions/adminportal/billing.jsp"/>
<RenderMode name="ReplaceCard" preIncludeJSP="extensions/adminportal/replace_card.jsp"/>
......
......@@ -14,6 +14,10 @@
Debug.assertion(company != null, "Invalid company user in admin portal");
HiringTeam hiringTeam = company.getDefaultHiringTeam();
Debug.assertion(hiringTeam != null, "No Hiring Team added in admin portal");
CompanyUser companyUser = company.getAddedByUser();
SecUser secUser = companyUser.getUser();
Integer pageNumber = 1;
......@@ -41,13 +45,13 @@
<%
FormTag jobForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = jobForm.getFormBuilder();
String optionKey = WebUtils.getInputKey(request, company, Company.FIELD_HiringTeamType);
String formValue = formBuilder.fieldValue (optionKey, company.getHiringTeamType() == null ? "" : company.getHiringTeamType().getName());
String optionKey = WebUtils.getInputKey(request, hiringTeam, HiringTeam.FIELD_HiringTeamType);
String formValue = formBuilder.fieldValue (optionKey, hiringTeam.getHiringTeamType() == null ? "" : hiringTeam.getHiringTeamType().getName());
for(HiringTeamType hiringTeamType : HiringTeamType.getHiringTeamTypeArray())
{
boolean isSelected = CollectionUtils.equals(formValue, hiringTeamType.getName());
String hiringTeamTypeId = String.valueOf(company.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String hiringTeamTypeId = String.valueOf(hiringTeam.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
%>
......@@ -64,12 +68,12 @@
<div class="form-group">
<label><oneit:label GUIName="Industry" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="Industry" cssClass="form-control"/>
<oneit:ormEnum obj="<%= hiringTeam %>" attributeName="Industry" cssClass="form-control"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Time zone" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="TimeZone" cssClass="form-control"/>
<oneit:ormEnum obj="<%= hiringTeam %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
......
<%@ 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" %>
<%@ page import="oneit.utils.filter.CollectionFilter"%>
<oneit:dynIncluded>
<%
String currentPage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MY_COMPANY).getLink(request);
String hiringTeamPage = WebUtils.getSamePageInRenderMode(request, "Page");
ObjectTransaction objTran = process.getTransaction ();
SecUser secUser = SecUser.getTXUser(objTran);
Company company = (Company) process.getAttribute("Company");
CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
Collection<CompanyUser> companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers");
Collection pendingUsers = (Collection<CompanyUser>) process.getAttribute("PendingUsers");
if(company==null)
{
company = comUser.getCompany();
process.setAttribute("Company", company);
}
if(companyUsers == null || pendingUsers == null)
{
companyUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)));
pendingUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE)));
process.setAttribute("CompanyUsers", companyUsers);
process.setAttribute("PendingUsers", pendingUsers);
}
if( request.getParameter("UserSortOption") != null)
{
userSortOpt = UserSortOption.forName((String) request.getParameter("UserSortOption"));
}
if(userSortOpt == null)
{
userSortOpt = UserSortOption.ALPHA_A_Z;
}
process.setAttribute("UserSortOption", userSortOpt);
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
company.setRoleType(RoleType.STANDARD);
%>
<oneit:form name="listHiringTeams" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area second-part">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="eq-justify-content">
<div class="manage-user-left">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Hiring Teams</div>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value">
<%
for (UserSortOption sortOption : UserSortOption.getUserSortOptionArray())
{
String optionLink = hiringTeamPage + "&UserSortOption=" + sortOption.getName() ;
%>
<option <%= (userSortOpt != null && userSortOpt == sortOption ? "selected" : "" )%> value="<%= optionLink %>">
<oneit:toString value="<%= sortOption.getDescription() %>" mode="EscapeHTML"/>
</option>
<%
}
%>
</select>
</div>
</div>
<div class="main-manage-userlist">
<%
for(HiringTeam hiringTeam : company.getHiringTeamsSet())
{
%>
<div class="user-list-row">
<div class="m-user-left">
<!--TODO: add hiring team icon-->
<div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info">
<div class="m-user-name">
<oneit:toString value="<%= hiringTeam.getHiringTeamName() %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
Owner: <oneit:toString value="<%= hiringTeam.getAddedByUser() %>" mode="EscapeHTML" />
</div>
</div>
</div>
</div>
<%
}
%>
</div>
</div>
<div class="manage-user-right">
<div class="sidebar-title">
Add Hiring Team
</div>
<div class="form-group">
<label><oneit:label GUIName="Hiring Team Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="HiringTeamName" cssClass="form-control" style="text-transform: lowercase"/>
</div>
<div class="form-group">
<label><oneit:label GUIName="Team Owner/Admin" /></label>
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= company %>" assocName="Owner" options="<%= companyUsers.toArray(new CompanyUser[0]) %>"/>
</div>
</div>
<div class="form-group">
<label><oneit:label GUIName="Billing" /></label>
<div class="styled_checkboxes">
<div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= company %>" id="manage-own-billing" attributeName="ManageOwnBilling" type="checkbox"/>
<oneit:recalcClass htmlTag="span" classScript="company.showTeamManagesOwnBilling() ? 'checked': 'unchecked'" company="<%= company %>">
<label for="manage-own-billing">
<oneit:ormlabel obj="<%= company %>" field="ManageOwnBilling" />
</label>
</oneit:recalcClass>
</div>
</div>
</div>
<div class="form-group">
<label><oneit:label GUIName="Select Billing Team" /></label>
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= company %>" assocName="BillingTeam" options="<%= company.getHiringTeamsSet().toArray(new HiringTeam[0]) %>"/>
</div>
</div>
<oneit:button value="Add Team" name="sendUserInvites" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.NOTIFICATION_MSG_PARAM, "invitationSent")
.toMap() %>" />
</div>
</div>
</div>
</oneit:form>
</oneit:dynIncluded>
......@@ -37,3 +37,4 @@ Company.CompanyLogo = Logo
Company.HiringTeamType = Hiring Team
Company.CompanyName = Hiring Team Name
Company.PaymentPlan = Payment Plan
Company.ManageOwnBilling = Team manages its own billing
......@@ -98,6 +98,13 @@
<label><oneit:label GUIName="Phone" /></label>
<oneit:ormInput obj="<%= companyUser %>" type="text" attributeName="Phone" cssClass="form-control" />
</div>
<div class="form-group">
<label><oneit:label GUIName="Default Hiring Team"/></label>
<div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= companyUser %>" assocName="DefaultHiringTeam" options="<%= Utils.getHiringTeamsByUser(companyUser) %>"/>
</div>
</div>
<div class="text-center form-group">
<oneit:button value="Save Updates" name="saveUserDetails" cssClass="btn btn-primary largeBtn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
......
......@@ -17,13 +17,21 @@
SecUser secUser = null;
CompanyUser companyUser = company.getAddedByUser();
if(companyUser==null)
if(companyUser == null)
{
secUser = SecUser.createSecUser(objTran);
companyUser = secUser.getExtensionOrCreate(CompanyUser.REFERENCE_CompanyUser);
company.setAddedByUser(companyUser);
companyUser.setCompany(company);
HiringTeam hiringTeam = company.getHiringTeamsAt(0);
hiringTeam.setAddedByUser(companyUser);
companyUser.setDefaultHiringTeam(hiringTeam);
CompanyUserHiringTeamLink link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran);
link.setCompanyUser(companyUser);
link.setHiringTeam(hiringTeam);
}
secUser = companyUser.getUser();
......
......@@ -24,6 +24,14 @@
company.setAddedByUser(companyUser);
companyUser.setCompany(company);
HiringTeam hiringTeam = company.getHiringTeamsAt(0);
hiringTeam.setAddedByUser(companyUser);
companyUser.setDefaultHiringTeam(hiringTeam);
CompanyUserHiringTeamLink link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran);
link.setCompanyUser(companyUser);
link.setHiringTeam(hiringTeam);
}
secUser = companyUser.getUser();
......
<?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">oneit_sec_user_extension</tableName>
<column name="default_hiring_team_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.DefineTableOperation">
<tableName factory="String">tl_company_user_hiring_team_link</tableName>
<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="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_company_user_hiring_team_link" indexName="idx_tl_company_user_hiring_team_link_hiring_team_id" isUnique="false">
<column name="hiring_team_id"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_company_user_hiring_team_link" indexName="idx_tl_company_user_hiring_team_link_company_user_id" isUnique="false">
<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.DefineTableOperation">
<tableName factory="String">tl_hiring_team</tableName>
<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="hiring_team_name" type="String" nullable="false" length="100"/>
<column name="hiring_team_logo" type="BLOB" nullable="true"/>
<column name="hiring_team_type" type="String" nullable="true" length="200"/>
<column name="industry" type="String" nullable="true" length="200"/>
<column name="time_zone" type="String" nullable="true" length="200"/>
<column name="state" type="String" nullable="true" length="200"/>
<column name="country" type="String" nullable="true" length="200"/>
<column name="post_code" type="String" nullable="true" length="10"/>
<column name="city" type="String" nullable="true" length="100"/>
<column name="has_client_support" type="Boolean" nullable="true"/>
<column name="manage_own_billing" type="Boolean" nullable="true"/>
<column name="stripe_reference" type="String" nullable="true" length="100"/>
<column name="stripe_subscription" type="String" nullable="true" length="100"/>
<column name="name_on_card" type="String" nullable="true" length="100"/>
<column name="card_post_code" type="String" nullable="true" length="10"/>
<column name="card_id" type="String" nullable="true" length="100"/>
<column name="plan_renewed_on" type="Date" nullable="true"/>
<column name="used_credits" 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"/>
<column name="payment_plan_id" type="Long" length="11" nullable="true"/>
</NODE>
<NODE name="INDEX" factory="Participant" class="oneit.sql.transfer.DefineIndexOperation" tableName="tl_hiring_team" indexName="idx_tl_hiring_team_company_id" isUnique="false">
<column name="company_id"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
......@@ -18,11 +18,11 @@
String verifyKey = request.getParameter("key");
Boolean invalid = Boolean.TRUE;
if(id!=null && verifyKey !=null)
if(id != null && verifyKey != null)
{
companyUser = CompanyUser.searchIdPin(transaction, Long.parseLong(id), verifyKey);
if(companyUser!=null && companyUser.getIsAccountVerified()!=Boolean.TRUE)
if(companyUser != null && companyUser.getIsAccountVerified() != Boolean.TRUE)
{
secUser = companyUser.getUser();
process.setAttribute("CompanyUser", companyUser);
......@@ -37,10 +37,10 @@
SecUser logedInUser = SecUser.getTXUser(transaction);
companyUser = logedInUser != null ? logedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser) : null;
if(logedInUser!=null
if(logedInUser != null
&& logedInUser.hasRole(Utils.ROLE_CLIENT)
&& companyUser!=null
&& companyUser.getIsAccountVerified()!=Boolean.TRUE)
&& companyUser != null
&& companyUser.getIsAccountVerified() != Boolean.TRUE)
{
socialLogin = Boolean.TRUE;
invalid = Boolean.FALSE;
......@@ -54,7 +54,13 @@
Debug.assertion(companyUser != null, "Invalid CompanyUser in admin portal");
process.setAttribute("Company", companyUser.getCompany());
Company company = companyUser.getCompany();
if(!invalid && CollectionUtils.equals(company.getAddedByUser(), companyUser))
{
}
process.setAttribute("Company", company);
%>
<oneit:script>
<oneit:script src="/scripts/password_strength_lightweight.js"/>
......
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