Commit 4930d548 by Harsh Shah

Finish Hotfix-20190807

parents e09bed93 005af8d4
......@@ -26,6 +26,7 @@
<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_status" type="String" nullable="false" length="200"/>
<column name="added_by_user_id" type="Long" length="11" nullable="false"/>
<column name="payment_plan_id" type="Long" length="11" nullable="true"/>
</NODE>
......
......@@ -41,6 +41,7 @@
<column name="on_trial" type="Boolean" nullable="true"/>
<column name="trial_job_count" type="Long" nullable="true"/>
<column name="message_id" type="Long" nullable="true"/>
<column name="ht_status" type="String" nullable="false" length="200"/>
<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"/>
......
......@@ -9,6 +9,7 @@
<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="xxxx" type="CLOB" nullable="true"/>
<column name="" type="String" nullable="true" length="200"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
......@@ -26,6 +26,7 @@ CREATE TABLE tl_company (
card_id varchar(100) NULL,
plan_renewed_on datetime NULL,
used_credits numeric(12) NULL,
company_status varchar(200) NOT NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
......
......@@ -41,6 +41,7 @@ CREATE TABLE tl_hiring_team (
on_trial char(1) NULL,
trial_job_count numeric(12) NULL,
message_id numeric(12) NULL,
ht_status varchar(200) NOT NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -8,7 +8,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
xxxx text NULL
xxxx text NULL,
varchar(200) NULL
);
......
......@@ -27,6 +27,7 @@ CREATE TABLE tl_company (
card_id varchar2(100) NULL,
plan_renewed_on date NULL,
used_credits number(12) NULL,
company_status varchar2(200) NOT NULL,
added_by_user_id number(12) NOT NULL,
payment_plan_id number(12) NULL
);
......
......@@ -42,6 +42,7 @@ CREATE TABLE tl_hiring_team (
on_trial char(1) NULL,
trial_job_count number(12) NULL,
message_id number(12) NULL,
ht_status varchar2(200) NOT NULL,
company_id number(12) NOT NULL,
billing_team_id number(12) NULL,
added_by_user_id number(12) NOT NULL,
......
......@@ -9,7 +9,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
xxxx clob NULL
xxxx clob NULL,
varchar2(200) NULL
);
......
......@@ -27,6 +27,7 @@ CREATE TABLE tl_company (
card_id varchar(100) NULL,
plan_renewed_on timestamp NULL,
used_credits numeric(12) NULL,
company_status varchar(200) NOT NULL,
added_by_user_id numeric(12) NOT NULL,
payment_plan_id numeric(12) NULL
);
......
......@@ -42,6 +42,7 @@ CREATE TABLE tl_hiring_team (
on_trial char(1) NULL,
trial_job_count numeric(12) NULL,
message_id numeric(12) NULL,
ht_status varchar(200) NOT NULL,
company_id numeric(12) NOT NULL,
billing_team_id numeric(12) NULL,
added_by_user_id numeric(12) NOT NULL,
......
......@@ -9,7 +9,8 @@ CREATE TABLE it_does_not_matter (
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
xxxx text NULL
xxxx text NULL,
varchar(200) NULL
);
......
......@@ -36,10 +36,15 @@ public class CloseJobBatch extends ORMBatch
if(job.getJobApplicationsCount() == 0)
{
HiringTeam hiringTeam = job.getHiringTeam();
HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
HiringTeam billingTeam = hiringTeam == null || hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
LogMgr.log(CLOSE_JOB_BATCH, LogLevel.PROCESSING1, "No Applicants for job: ", job, " hence crediting account : ", billingTeam);
if(billingTeam == null)
{
continue;
}
if(billingTeam.isTrue(billingTeam.getOnTrial()))
{
billingTeam.setTrialJobCount(billingTeam.getTrialJobCount() - 1);
......
package performa.form;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser;
import oneit.objstore.rdbms.filters.EqualsFilter;
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.MultiException;
import performa.orm.Company;
import performa.orm.CompanyUser;
import performa.orm.CompanyUserHiringTeamLink;
import performa.orm.HiringTeam;
import performa.orm.types.RoleType;
public class ChangeCompanyFP extends SaveFP
{
private static final LoggingArea LOG = LoggingArea.createLoggingArea("ChangeCompanyFP");
@Override
public void validate(ORMProcessState process, SubmissionDetails submission, MultiException exceptions, Map params) throws StorageException
{
HttpServletRequest request = submission.getRequest();
HiringTeam hiringTeam = (HiringTeam) request.getAttribute("HiringTeam");
if(hiringTeam.isFalse(hiringTeam.getExistingCustomer()))
{
BusinessObjectParser.assertFieldCondition(hiringTeam.getCompanyName() != null, hiringTeam, HiringTeam.FIELD_CompanyName, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(hiringTeam.getCompanyTimeZone() != null, hiringTeam, HiringTeam.FIELD_CompanyTimeZone, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(hiringTeam.getCompanyType() != null, hiringTeam, HiringTeam.FIELD_CompanyType, "mandatory", exceptions, true, request);
}
super.validate(process, submission, exceptions, params);
}
@Override
public SuccessfulResult processForm(ORMProcessState process, SubmissionDetails submission, Map params) throws BusinessException, StorageException
{
ObjectTransaction objTran = process.getTransaction();
HttpServletRequest request = submission.getRequest();
HiringTeam hiringTeam = (HiringTeam) request.getAttribute("HiringTeam");
LogMgr.log(LOG, LogLevel.PROCESSING1, "Changing company of hiring team : ", hiringTeam);
if(hiringTeam.isFalse(hiringTeam.getExistingCustomer()))
{
Company company = Company.createCompany(objTran);
company.setCompanyName(hiringTeam.getCompanyName());
company.setHiringTeamType(hiringTeam.getCompanyType());
company.setTimeZone(hiringTeam.getCompanyTimeZone());
company.setAddedByUser(hiringTeam.getAddedByUser());
hiringTeam.setCompany(company);
LogMgr.log(LOG, LogLevel.PROCESSING1, "Added new company : ", company);
}
CompanyUser addedByUser = hiringTeam.getAddedByUser();
CompanyUserHiringTeamLink link = addedByUser.pipelineCompanyUser().toHiringTeams(CompanyUserHiringTeamLink.SearchByAll().andHiringTeam(new EqualsFilter<>(hiringTeam))).val();
if(link == null)
{
link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(objTran);
link.setHiringTeam(hiringTeam);
link.setCompanyUser(addedByUser);
link.setRole(RoleType.OWNER);
}
hiringTeam.getCompany().setCompanyStatus(hiringTeam.getCompanyStatus());
return super.processForm(process, submission, params);
}
}
\ No newline at end of file
......@@ -43,7 +43,7 @@ public class SendUserInvitationFP extends SaveFP
{
BusinessObjectParser.assertFieldCondition(inviteTeammate.getUserEmail() != null, inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "mandatory", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(StringUtils.isEmailAddress(inviteTeammate.getUserEmail()), inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "invalidEmail", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(!Utils.userFoundInAnotherCompany(process.getTransaction(), inviteTeammate.getUserEmail() , company), inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "existsInOtherCompany", exceptions, true, request);
// BusinessObjectParser.assertFieldCondition(!Utils.userFoundInAnotherCompany(process.getTransaction(), inviteTeammate.getUserEmail() , company), inviteTeammate, InviteTeammateNPO.FIELD_UserEmail, "existsInOtherCompany", exceptions, true, request);
BusinessObjectParser.assertFieldCondition(inviteTeammate.getRoleType() != null, inviteTeammate, InviteTeammateNPO.FIELD_RoleType, "mandatory", exceptions, true, request);
}
......@@ -73,7 +73,7 @@ public class SendUserInvitationFP extends SaveFP
{
LogMgr.log(LOG, LogLevel.PROCESSING1, "Started to create new use", company);
SecUser secUser = SecUser.searchNAME(objTran, inviteTeammate.getUserEmail());
SecUser secUser = SecUser.searchNAME(objTran, inviteTeammate.getUserEmail().toLowerCase());
if(secUser == null)
{
......
......@@ -35,6 +35,10 @@ public class UserLoginFP extends LoginProcessor
{
throw new FieldException("Your account is disabled.", SecUser.FIELD_UserName);
}
else if(companyUser.getSelectedTeam() == null)
{
throw new FieldException("Your customer account is not active. Please contact Matchd <a href='https://matchd.com/support' target='_blank'>support</a> for assistance", SecUser.FIELD_UserName);
}
else if(companyUser.isTrue(companyUser.getIsEmailChanged()))
{
//verify email address change
......
......@@ -60,6 +60,7 @@ public abstract class BaseCompany extends BaseBusinessClass
public static final String FIELD_CardID = "CardID";
public static final String FIELD_PlanRenewedOn = "PlanRenewedOn";
public static final String FIELD_UsedCredits = "UsedCredits";
public static final String FIELD_CompanyStatus = "CompanyStatus";
public static final String FIELD_HiringTeamName = "HiringTeamName";
public static final String FIELD_ManageOwnBilling = "ManageOwnBilling";
public static final String FIELD_HTCountry = "HTCountry";
......@@ -102,6 +103,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final DefaultAttributeHelper<Company> HELPER_CardID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_PlanRenewedOn = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_UsedCredits = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Company, CompanyStatus> HELPER_CompanyStatus = new EnumeratedAttributeHelper<Company, CompanyStatus> (CompanyStatus.FACTORY_CompanyStatus);
private static final DefaultAttributeHelper<Company> HELPER_HiringTeamName = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper<Company> HELPER_ManageOwnBilling = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<Company, Countries> HELPER_HTCountry = new EnumeratedAttributeHelper<Company, Countries> (Countries.FACTORY_Countries);
......@@ -131,6 +133,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private String _CardID;
private Date _PlanRenewedOn;
private Integer _UsedCredits;
private CompanyStatus _CompanyStatus;
private String _HiringTeamName;
private Boolean _ManageOwnBilling;
private Countries _HTCountry;
......@@ -184,6 +187,7 @@ public abstract class BaseCompany extends BaseBusinessClass
private static final AttributeValidator[] FIELD_CardID_Validators;
private static final AttributeValidator[] FIELD_PlanRenewedOn_Validators;
private static final AttributeValidator[] FIELD_UsedCredits_Validators;
private static final AttributeValidator[] FIELD_CompanyStatus_Validators;
// Arrays of behaviour decorators
......@@ -233,6 +237,7 @@ public abstract class BaseCompany extends BaseBusinessClass
FIELD_CardID_Validators = (AttributeValidator[])setupAttribMetaData_CardID(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_PlanRenewedOn_Validators = (AttributeValidator[])setupAttribMetaData_PlanRenewedOn(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_UsedCredits_Validators = (AttributeValidator[])setupAttribMetaData_UsedCredits(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_CompanyStatus_Validators = (AttributeValidator[])setupAttribMetaData_CompanyStatus(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_Company.initialiseReference ();
......@@ -840,6 +845,27 @@ public abstract class BaseCompany extends BaseBusinessClass
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_CompanyStatus(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("dbcol", "company_status");
metaInfo.put ("defaultValue", "CompanyStatus.ACTIVE");
metaInfo.put ("mandatory", "true");
metaInfo.put ("name", "CompanyStatus");
metaInfo.put ("type", "CompanyStatus");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for Company.CompanyStatus:", metaInfo);
ATTRIBUTES_METADATA_Company.put (FIELD_CompanyStatus, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(Company.class, "CompanyStatus", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for Company.CompanyStatus:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -885,6 +911,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_CardID = (String)(HELPER_CardID.initialise (_CardID));
_PlanRenewedOn = (Date)(HELPER_PlanRenewedOn.initialise (_PlanRenewedOn));
_UsedCredits = (Integer)(HELPER_UsedCredits.initialise (_UsedCredits));
_CompanyStatus = (CompanyStatus)(CompanyStatus.ACTIVE);
_HiringTeamName = (String)(HELPER_HiringTeamName.initialise (_HiringTeamName));
_ManageOwnBilling = (Boolean)(Boolean.FALSE);
_HTCountry = (Countries)(HELPER_HTCountry.initialise (_HTCountry));
......@@ -2697,6 +2724,105 @@ public abstract class BaseCompany extends BaseBusinessClass
}
/**
* Get the attribute CompanyStatus
*/
public CompanyStatus getCompanyStatus ()
{
assertValid();
CompanyStatus valToReturn = _CompanyStatus;
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
valToReturn = bhd.getCompanyStatus ((Company)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preCompanyStatusChange (CompanyStatus newCompanyStatus) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postCompanyStatusChange () throws FieldException
{
}
public FieldWriteability getWriteability_CompanyStatus ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute CompanyStatus. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setCompanyStatus (CompanyStatus newCompanyStatus) throws FieldException
{
boolean oldAndNewIdentical = HELPER_CompanyStatus.compare (_CompanyStatus, newCompanyStatus);
try
{
for (CompanyBehaviourDecorator bhd : Company_BehaviourDecorators)
{
newCompanyStatus = bhd.setCompanyStatus ((Company)this, newCompanyStatus);
oldAndNewIdentical = HELPER_CompanyStatus.compare (_CompanyStatus, newCompanyStatus);
}
BusinessObjectParser.assertFieldCondition (newCompanyStatus != null, this, FIELD_CompanyStatus, "mandatory");
if (FIELD_CompanyStatus_Validators.length > 0)
{
Object newCompanyStatusObj = HELPER_CompanyStatus.toObject (newCompanyStatus);
if (newCompanyStatusObj != null)
{
int loopMax = FIELD_CompanyStatus_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_Company.get (FIELD_CompanyStatus);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_CompanyStatus_Validators[v].checkAttribute (this, FIELD_CompanyStatus, metadata, newCompanyStatusObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_CompanyStatus () != FieldWriteability.FALSE, "Field CompanyStatus is not writeable");
preCompanyStatusChange (newCompanyStatus);
markFieldChange (FIELD_CompanyStatus);
_CompanyStatus = newCompanyStatus;
postFieldChange (FIELD_CompanyStatus);
postCompanyStatusChange ();
}
}
/**
* Get the attribute HiringTeamName
*/
public String getHiringTeamName ()
......@@ -4573,6 +4699,7 @@ public abstract class BaseCompany extends BaseBusinessClass
tl_companyPSet.setAttrib (FIELD_CardID, HELPER_CardID.toObject (_CardID)); //
tl_companyPSet.setAttrib (FIELD_PlanRenewedOn, HELPER_PlanRenewedOn.toObject (_PlanRenewedOn)); //
tl_companyPSet.setAttrib (FIELD_UsedCredits, HELPER_UsedCredits.toObject (_UsedCredits)); //
tl_companyPSet.setAttrib (FIELD_CompanyStatus, HELPER_CompanyStatus.toObject (_CompanyStatus)); //
_AddedByUser.getPersistentSets (allSets);
_PaymentPlan.getPersistentSets (allSets);
......@@ -4607,6 +4734,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_CardID = (String)(HELPER_CardID.fromObject (_CardID, tl_companyPSet.getAttrib (FIELD_CardID))); //
_PlanRenewedOn = (Date)(HELPER_PlanRenewedOn.fromObject (_PlanRenewedOn, tl_companyPSet.getAttrib (FIELD_PlanRenewedOn))); //
_UsedCredits = (Integer)(HELPER_UsedCredits.fromObject (_UsedCredits, tl_companyPSet.getAttrib (FIELD_UsedCredits))); //
_CompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.fromObject (_CompanyStatus, tl_companyPSet.getAttrib (FIELD_CompanyStatus))); //
_AddedByUser.setFromPersistentSets (objectID, allSets);
_PaymentPlan.setFromPersistentSets (objectID, allSets);
......@@ -4786,6 +4914,15 @@ public abstract class BaseCompany extends BaseBusinessClass
e.addException (ex);
}
try
{
setCompanyStatus (otherCompany.getCompanyStatus ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -4819,6 +4956,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_CardID = sourceCompany._CardID;
_PlanRenewedOn = sourceCompany._PlanRenewedOn;
_UsedCredits = sourceCompany._UsedCredits;
_CompanyStatus = sourceCompany._CompanyStatus;
_HiringTeamName = sourceCompany._HiringTeamName;
_ManageOwnBilling = sourceCompany._ManageOwnBilling;
_HTCountry = sourceCompany._HTCountry;
......@@ -4906,6 +5044,7 @@ public abstract class BaseCompany extends BaseBusinessClass
_CardID = (String)(HELPER_CardID.readExternal (_CardID, vals.get(FIELD_CardID))); //
_PlanRenewedOn = (Date)(HELPER_PlanRenewedOn.readExternal (_PlanRenewedOn, vals.get(FIELD_PlanRenewedOn))); //
_UsedCredits = (Integer)(HELPER_UsedCredits.readExternal (_UsedCredits, vals.get(FIELD_UsedCredits))); //
_CompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.readExternal (_CompanyStatus, vals.get(FIELD_CompanyStatus))); //
_HiringTeamName = (String)(HELPER_HiringTeamName.readExternal (_HiringTeamName, vals.get(FIELD_HiringTeamName))); //
_ManageOwnBilling = (Boolean)(HELPER_ManageOwnBilling.readExternal (_ManageOwnBilling, vals.get(FIELD_ManageOwnBilling))); //
_HTCountry = (Countries)(HELPER_HTCountry.readExternal (_HTCountry, vals.get(FIELD_HTCountry))); //
......@@ -4950,6 +5089,7 @@ public abstract class BaseCompany extends BaseBusinessClass
vals.put (FIELD_CardID, HELPER_CardID.writeExternal (_CardID));
vals.put (FIELD_PlanRenewedOn, HELPER_PlanRenewedOn.writeExternal (_PlanRenewedOn));
vals.put (FIELD_UsedCredits, HELPER_UsedCredits.writeExternal (_UsedCredits));
vals.put (FIELD_CompanyStatus, HELPER_CompanyStatus.writeExternal (_CompanyStatus));
vals.put (FIELD_HiringTeamName, HELPER_HiringTeamName.writeExternal (_HiringTeamName));
vals.put (FIELD_ManageOwnBilling, HELPER_ManageOwnBilling.writeExternal (_ManageOwnBilling));
vals.put (FIELD_HTCountry, HELPER_HTCountry.writeExternal (_HTCountry));
......@@ -5050,6 +5190,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
listener.notifyFieldChange(this, other, FIELD_UsedCredits, HELPER_UsedCredits.toObject(this._UsedCredits), HELPER_UsedCredits.toObject(otherCompany._UsedCredits));
}
if (!HELPER_CompanyStatus.compare(this._CompanyStatus, otherCompany._CompanyStatus))
{
listener.notifyFieldChange(this, other, FIELD_CompanyStatus, HELPER_CompanyStatus.toObject(this._CompanyStatus), HELPER_CompanyStatus.toObject(otherCompany._CompanyStatus));
}
// Compare single assocs
_Owner.compare (otherCompany._Owner, listener);
......@@ -5105,6 +5249,7 @@ public abstract class BaseCompany extends BaseBusinessClass
visitor.visitField(this, FIELD_CardID, HELPER_CardID.toObject(getCardID()));
visitor.visitField(this, FIELD_PlanRenewedOn, HELPER_PlanRenewedOn.toObject(getPlanRenewedOn()));
visitor.visitField(this, FIELD_UsedCredits, HELPER_UsedCredits.toObject(getUsedCredits()));
visitor.visitField(this, FIELD_CompanyStatus, HELPER_CompanyStatus.toObject(getCompanyStatus()));
visitor.visitAssociation (_Owner);
visitor.visitAssociation (_BillingTeam);
visitor.visitAssociation (_AddedByUser);
......@@ -5245,6 +5390,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return filter.matches (getUsedCredits ());
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return filter.matches (getCompanyStatus ());
}
else if (attribName.equals (SINGLEREFERENCE_AddedByUser))
{
return filter.matches (getAddedByUser ());
......@@ -5392,6 +5541,12 @@ public abstract class BaseCompany extends BaseBusinessClass
return this;
}
public SearchAll andCompanyStatus (QueryFilter<CompanyStatus> filter)
{
filter.addFilter (context, "tl_company.company_status", "CompanyStatus");
return this;
}
public SearchAll andAddedByUser (QueryFilter<CompanyUser> filter)
{
filter.addFilter (context, "tl_company.added_by_user_id", "AddedByUser");
......@@ -5511,6 +5666,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return HELPER_UsedCredits.toObject (getUsedCredits ());
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return HELPER_CompanyStatus.toObject (getCompanyStatus ());
}
else if (attribName.equals (FIELD_HiringTeamName))
{
return HELPER_HiringTeamName.toObject (getHiringTeamName ());
......@@ -5628,6 +5787,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return HELPER_UsedCredits;
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return HELPER_CompanyStatus;
}
else if (attribName.equals (FIELD_HiringTeamName))
{
return HELPER_HiringTeamName;
......@@ -5745,6 +5908,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
setUsedCredits ((Integer)(HELPER_UsedCredits.fromObject (_UsedCredits, attribValue)));
}
else if (attribName.equals (FIELD_CompanyStatus))
{
setCompanyStatus ((CompanyStatus)(HELPER_CompanyStatus.fromObject (_CompanyStatus, attribValue)));
}
else if (attribName.equals (FIELD_HiringTeamName))
{
setHiringTeamName ((String)(HELPER_HiringTeamName.fromObject (_HiringTeamName, attribValue)));
......@@ -5869,6 +6036,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return getWriteability_UsedCredits ();
}
else if (fieldName.equals (FIELD_CompanyStatus))
{
return getWriteability_CompanyStatus ();
}
else if (fieldName.equals (MULTIPLEREFERENCE_Users))
{
return getWriteability_Users ();
......@@ -6029,6 +6200,11 @@ public abstract class BaseCompany extends BaseBusinessClass
fields.add (FIELD_UsedCredits);
}
if (getWriteability_CompanyStatus () != FieldWriteability.TRUE)
{
fields.add (FIELD_CompanyStatus);
}
if (getWriteability_HiringTeamName () != FieldWriteability.TRUE)
{
fields.add (FIELD_HiringTeamName);
......@@ -6096,6 +6272,7 @@ public abstract class BaseCompany extends BaseBusinessClass
result.add(HELPER_CardID.getAttribObject (getClass (), _CardID, false, FIELD_CardID));
result.add(HELPER_PlanRenewedOn.getAttribObject (getClass (), _PlanRenewedOn, false, FIELD_PlanRenewedOn));
result.add(HELPER_UsedCredits.getAttribObject (getClass (), _UsedCredits, false, FIELD_UsedCredits));
result.add(HELPER_CompanyStatus.getAttribObject (getClass (), _CompanyStatus, true, FIELD_CompanyStatus));
result.add(HELPER_HiringTeamName.getAttribObject (getClass (), _HiringTeamName, false, FIELD_HiringTeamName));
result.add(HELPER_ManageOwnBilling.getAttribObject (getClass (), _ManageOwnBilling, false, FIELD_ManageOwnBilling));
result.add(HELPER_HTCountry.getAttribObject (getClass (), _HTCountry, false, FIELD_HTCountry));
......@@ -6497,6 +6674,24 @@ public abstract class BaseCompany extends BaseBusinessClass
}
/**
* Get the attribute CompanyStatus
*/
public CompanyStatus getCompanyStatus (Company obj, CompanyStatus original)
{
return original;
}
/**
* Change the value set for attribute CompanyStatus.
* May modify the field beforehand
* Occurs before validation.
*/
public CompanyStatus setCompanyStatus (Company obj, CompanyStatus newCompanyStatus) throws FieldException
{
return newCompanyStatus;
}
/**
* Get the attribute HiringTeamName
*/
public String getHiringTeamName (Company obj, String original)
......@@ -6816,6 +7011,10 @@ public abstract class BaseCompany extends BaseBusinessClass
{
return toUsedCredits ();
}
if (name.equals ("CompanyStatus"))
{
return toCompanyStatus ();
}
if (name.equals ("AddedByUser"))
{
return toAddedByUser ();
......@@ -6881,6 +7080,8 @@ public abstract class BaseCompany extends BaseBusinessClass
public PipeLine<From, Date> toPlanRenewedOn () { return pipe(new ORMAttributePipe<Me, Date>(FIELD_PlanRenewedOn)); }
public PipeLine<From, Integer> toUsedCredits () { return pipe(new ORMAttributePipe<Me, Integer>(FIELD_UsedCredits)); }
public PipeLine<From, CompanyStatus> toCompanyStatus () { return pipe(new ORMAttributePipe<Me, CompanyStatus>(FIELD_CompanyStatus)); }
public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toOwner () { return toOwner (Filter.ALL); }
public CompanyUser.CompanyUserPipeLineFactory<From, CompanyUser> toOwner (Filter<CompanyUser> filter)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,15 +2,17 @@ package performa.orm;
import java.util.Set;
import oneit.logging.LoggingArea;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.security.SecUser;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils;
import oneit.utils.filter.Filter;
import oneit.utils.math.NullArith;
import performa.orm.types.JobStatus;
import performa.orm.types.TimeZone;
import performa.orm.types.RoleType;
import performa.utils.Utils;
......@@ -29,8 +31,6 @@ public class Company extends BaseCompany
@Override
protected void postInitNewObj() throws BusinessException
{
addToHiringTeams(HiringTeam.createHiringTeam(getTransaction()));
super.postInitNewObj();
}
......@@ -176,8 +176,21 @@ public class Company extends BaseCompany
return pipelineCompany().toHiringTeams(filter).uniqueVals();
}
public TimeZone getDefaultTimeZone()
@Override
public FieldWriteability getObjectWriteability()
{
return pipelineCompany().toHiringTeams().toTimeZone().val();
SecUser secUser = SecUser.getTXUser(getTransaction());
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
{
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser.getSelectedTeam() != null && companyUser.getRoleForHiringTeam(companyUser.getSelectedTeam()) == RoleType.STANDARD)
{
return FieldWriteability.NOT_IN_GUI;
}
}
return super.getObjectWriteability();
}
}
\ No newline at end of file
......@@ -44,6 +44,7 @@
<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" />
<ATTRIB name="CompanyStatus" type="CompanyStatus" dbcol="company_status" mandatory="true" attribHelper="EnumeratedAttributeHelper" defaultValue="CompanyStatus.ACTIVE" />
<SINGLEREFERENCE name="AddedByUser" type="CompanyUser" dbcol="added_by_user_id" mandatory="true" />
<SINGLEREFERENCE name="PaymentPlan" type="PaymentPlan" dbcol="payment_plan_id" mandatory="false" />
......
......@@ -46,6 +46,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private String dummyCardID;
private Date dummyPlanRenewedOn;
private Integer dummyUsedCredits;
private CompanyStatus dummyCompanyStatus;
// Static constants corresponding to attribute helpers
......@@ -67,6 +68,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_CardID = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_PlanRenewedOn = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_UsedCredits = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_CompanyStatus = new EnumeratedAttributeHelper (CompanyStatus.FACTORY_CompanyStatus);
......@@ -91,10 +93,11 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
dummyCardID = (String)(HELPER_CardID.initialise (dummyCardID));
dummyPlanRenewedOn = (Date)(HELPER_PlanRenewedOn.initialise (dummyPlanRenewedOn));
dummyUsedCredits = (Integer)(HELPER_UsedCredits.initialise (dummyUsedCredits));
dummyCompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.initialise (dummyCompanyStatus));
}
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.company_logo, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.stripe_reference, {PREFIX}tl_company.stripe_subscription, {PREFIX}tl_company.name_on_card, {PREFIX}tl_company.card_post_code, {PREFIX}tl_company.card_id, {PREFIX}tl_company.plan_renewed_on, {PREFIX}tl_company.used_credits, {PREFIX}tl_company.added_by_user_id, {PREFIX}tl_company.payment_plan_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_company.object_id as id, {PREFIX}tl_company.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_company.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_company.company_name, {PREFIX}tl_company.company_logo, {PREFIX}tl_company.hiring_team_type, {PREFIX}tl_company.industry, {PREFIX}tl_company.time_zone, {PREFIX}tl_company.is_verified, {PREFIX}tl_company.state, {PREFIX}tl_company.country, {PREFIX}tl_company.post_code, {PREFIX}tl_company.city, {PREFIX}tl_company.has_client_support, {PREFIX}tl_company.stripe_reference, {PREFIX}tl_company.stripe_subscription, {PREFIX}tl_company.name_on_card, {PREFIX}tl_company.card_post_code, {PREFIX}tl_company.card_id, {PREFIX}tl_company.plan_renewed_on, {PREFIX}tl_company.used_credits, {PREFIX}tl_company.company_status, {PREFIX}tl_company.added_by_user_id, {PREFIX}tl_company.payment_plan_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -163,6 +166,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
!tl_companyPSet.containsAttrib(Company.FIELD_CardID)||
!tl_companyPSet.containsAttrib(Company.FIELD_PlanRenewedOn)||
!tl_companyPSet.containsAttrib(Company.FIELD_UsedCredits)||
!tl_companyPSet.containsAttrib(Company.FIELD_CompanyStatus)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_AddedByUser)||
!tl_companyPSet.containsAttrib(Company.SINGLEREFERENCE_PaymentPlan))
{
......@@ -234,10 +238,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_company " +
"SET company_name = ?, company_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, stripe_reference = ?, stripe_subscription = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, added_by_user_id = ? , payment_plan_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET company_name = ?, company_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, is_verified = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, stripe_reference = ?, stripe_subscription = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, used_credits = ?, company_status = ?, added_by_user_id = ? , payment_plan_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_company.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))).listEntry (HELPER_CompanyStatus.getForSQL(dummyCompanyStatus, tl_companyPSet.getAttrib (Company.FIELD_CompanyStatus))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -511,6 +515,7 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
tl_companyPSet.setAttrib(Company.FIELD_CardID, HELPER_CardID.getFromRS(dummyCardID, r, "card_id"));
tl_companyPSet.setAttrib(Company.FIELD_PlanRenewedOn, HELPER_PlanRenewedOn.getFromRS(dummyPlanRenewedOn, r, "plan_renewed_on"));
tl_companyPSet.setAttrib(Company.FIELD_UsedCredits, HELPER_UsedCredits.getFromRS(dummyUsedCredits, r, "used_credits"));
tl_companyPSet.setAttrib(Company.FIELD_CompanyStatus, HELPER_CompanyStatus.getFromRS(dummyCompanyStatus, r, "company_status"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_AddedByUser, r.getObject ("added_by_user_id"));
tl_companyPSet.setAttrib(Company.SINGLEREFERENCE_PaymentPlan, r.getObject ("payment_plan_id"));
......@@ -530,10 +535,10 @@ public class CompanyPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_company " +
" (company_name, company_logo, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, stripe_reference, stripe_subscription, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, added_by_user_id, payment_plan_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (company_name, company_logo, hiring_team_type, industry, time_zone, is_verified, state, country, post_code, city, has_client_support, stripe_reference, stripe_subscription, name_on_card, card_post_code, card_id, plan_renewed_on, used_credits, company_status, added_by_user_id, payment_plan_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_CompanyName.getForSQL(dummyCompanyName, tl_companyPSet.getAttrib (Company.FIELD_CompanyName))).listEntry (HELPER_CompanyLogo.getForSQL(dummyCompanyLogo, tl_companyPSet.getAttrib (Company.FIELD_CompanyLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_companyPSet.getAttrib (Company.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_companyPSet.getAttrib (Company.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_companyPSet.getAttrib (Company.FIELD_TimeZone))).listEntry (HELPER_IsVerified.getForSQL(dummyIsVerified, tl_companyPSet.getAttrib (Company.FIELD_IsVerified))).listEntry (HELPER_State.getForSQL(dummyState, tl_companyPSet.getAttrib (Company.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_companyPSet.getAttrib (Company.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_companyPSet.getAttrib (Company.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_companyPSet.getAttrib (Company.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_companyPSet.getAttrib (Company.FIELD_HasClientSupport))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_companyPSet.getAttrib (Company.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_companyPSet.getAttrib (Company.FIELD_StripeSubscription))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_companyPSet.getAttrib (Company.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_companyPSet.getAttrib (Company.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_companyPSet.getAttrib (Company.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_companyPSet.getAttrib (Company.FIELD_PlanRenewedOn))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_companyPSet.getAttrib (Company.FIELD_UsedCredits))).listEntry (HELPER_CompanyStatus.getForSQL(dummyCompanyStatus, tl_companyPSet.getAttrib (Company.FIELD_CompanyStatus))) .listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_companyPSet.getAttrib (Company.SINGLEREFERENCE_PaymentPlan)))) .listEntry (objectID.longID ()).toList().toArray());
tl_companyPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -13,6 +13,8 @@ import oneit.security.SecUser;
import oneit.security.jsp.SecUserToNameTransform;
import oneit.utils.*;
import oneit.utils.parsers.FieldException;
import performa.orm.types.CompanyStatus;
import performa.orm.types.HTStatus;
import performa.orm.types.RoleType;
import performa.utils.Utils;
......@@ -197,7 +199,21 @@ public class CompanyUser extends BaseCompanyUser
@Override
public HiringTeam getSelectedTeam() throws StorageException
{
return super.getSelectedTeam() == null ? getDefaultHiringTeam() : super.getSelectedTeam();
if(super.getSelectedTeam() == null || super.getSelectedTeam().getHTStatus() != HTStatus.ACTIVE || super.getSelectedTeam().getCompany().getCompanyStatus() != CompanyStatus.ACTIVE)
{
if(getDefaultHiringTeam() != null && getDefaultHiringTeam().getHTStatus() == HTStatus.ACTIVE && getDefaultHiringTeam().getCompany().getCompanyStatus() == CompanyStatus.ACTIVE)
{
return getDefaultHiringTeam();
}
else
{
HiringTeam[] hiringTeams = Utils.getHiringTeamsByUser(this);
return hiringTeams.length > 0 ? hiringTeams[0] : null;
}
}
return super.getSelectedTeam();
}
......
......@@ -36,7 +36,7 @@
</TABLE>
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null" >
<SEARCH type="All" paramFilter="oneit_sec_user_extension.object_id is not null and oneit_sec_user_extension.object_type = 'CompanyUser'" >
</SEARCH>
<SEARCH type="AllCompanyUsers" paramFilter="oneit_sec_user_extension.object_id is not null">
......
......@@ -487,8 +487,8 @@ public class CompanyUserPersistenceMgr extends SecUserExtensionPersistenceMgr
String tables = " ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null
String preFilter = "(oneit_sec_user_extension.object_id is not null)"
Object[] searchParams; // paramFilter: oneit_sec_user_extension.object_id is not null and oneit_sec_user_extension.object_type = 'CompanyUser'
String preFilter = "(oneit_sec_user_extension.object_id is not null and oneit_sec_user_extension.object_type = 'CompanyUser')"
+ " ";
......
......@@ -332,4 +332,38 @@ public class HiringTeam extends BaseHiringTeam
StripeUtils.makePayment(this, job);
}
}
public CompanyUser getOwner()
{
return pipelineHiringTeam().toUsers(CompanyUserHiringTeamLink.SearchByAll().andRole(new EqualsFilter<>(RoleType.OWNER))).toCompanyUser().val();
}
@Override
public FieldWriteability getWriteability_HTStatus()
{
HiringTeam billingTeam = getManageOwnBilling() ? this : getBilledByTeam();
if(billingTeam != null && billingTeam.isFalse(billingTeam.getIsPPJ()))
{
return FieldWriteability.NOT_IN_GUI;
}
return super.getWriteability_CompanyStatus();
}
@Override
public FieldWriteability getWriteability_CompanyStatus()
{
for(HiringTeam hiringTeam : getCompany().getHiringTeamsSet())
{
HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
if(billingTeam != null && billingTeam.isFalse(billingTeam.getIsPPJ()))
{
return FieldWriteability.NOT_IN_GUI;
}
}
return super.getWriteability_CompanyStatus();
}
}
\ No newline at end of file
......@@ -12,10 +12,15 @@
<MULTIPLEREFERENCE name="BillingTeams" type="HiringTeam" backreferenceName="BilledByTeam" />
<MULTIPLEREFERENCE name="DiversityQuestions" type="HTDiversityQuestion" backreferenceName="HiringTeam" />
<TRANSIENT name="ExistingCustomer" type="Boolean" defaultValue="Boolean.TRUE"/>
<TRANSIENT name="IsLogoDeleted" type="Boolean" defaultValue="Boolean.FALSE"/>
<TRANSIENT name="CouponCode" type="String" length="20"/>
<TRANSIENT name="StripeBrand" type="String" />
<TRANSIENT name="StripeLast4" type="String" />
<TRANSIENT name="CompanyName" type="String" />
<TRANSIENT name="CompanyType" type="HiringTeamType" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="CompanyStatus" type="CompanyStatus" attribHelper="EnumeratedAttributeHelper"/>
<TRANSIENT name="CompanyTimeZone" type="TimeZone" attribHelper="EnumeratedAttributeHelper"/>
<TABLE name="tl_hiring_team" tablePrefix="object">
......@@ -52,6 +57,7 @@
<ATTRIB name="OnTrial" type="Boolean" dbcol="on_trial" defaultValue="Boolean.FALSE"/>
<ATTRIB name="TrialJobCount" type="Integer" dbcol="trial_job_count" defaultValue="0"/>
<ATTRIB name="MessageID" type="Integer" dbcol="message_id" />
<ATTRIB name="HTStatus" type="HTStatus" dbcol="ht_status" mandatory="true" attribHelper="EnumeratedAttributeHelper" defaultValue="HTStatus.ACTIVE" />
<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" />
......@@ -64,6 +70,13 @@
<SEARCH type="All" paramFilter="tl_hiring_team.object_id is not null" >
</SEARCH>
<SEARCH type="Company" paramFilter="tl_hiring_team.object_id is not null" orderBy="tl_hiring_team.object_id">
<TABLE name="tl_company" join="tl_company.object_id = tl_hiring_team.company_id"/>
<PARAM name="CompanyStatus" type="CompanyStatus" transform='CompanyStatus.getValue()' paramFilter="tl_company.company_status = ${CompanyStatus}" />
</SEARCH>
<SEARCH type="BillingTeams" paramFilter="tl_hiring_team.object_id is not null and (is_ppj = 'Y' or (is_ppj = 'N' and payment_plan_id is not null))" >
</SEARCH>
......
......@@ -61,6 +61,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private Boolean dummyOnTrial;
private Integer dummyTrialJobCount;
private Integer dummyMessageID;
private HTStatus dummyHTStatus;
// Static constants corresponding to attribute helpers
......@@ -97,6 +98,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
private static final DefaultAttributeHelper HELPER_OnTrial = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_TrialJobCount = DefaultAttributeHelper.INSTANCE;
private static final DefaultAttributeHelper HELPER_MessageID = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_HTStatus = new EnumeratedAttributeHelper (HTStatus.FACTORY_HTStatus);
......@@ -136,10 +138,11 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
dummyOnTrial = (Boolean)(HELPER_OnTrial.initialise (dummyOnTrial));
dummyTrialJobCount = (Integer)(HELPER_TrialJobCount.initialise (dummyTrialJobCount));
dummyMessageID = (Integer)(HELPER_MessageID.initialise (dummyMessageID));
dummyHTStatus = (HTStatus)(HELPER_HTStatus.initialise (dummyHTStatus));
}
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.has_diversity, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.ppj_credits, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.plan_cancelled, {PREFIX}tl_hiring_team.on_trial, {PREFIX}tl_hiring_team.trial_job_count, {PREFIX}tl_hiring_team.message_id, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}tl_hiring_team.object_id as id, {PREFIX}tl_hiring_team.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}tl_hiring_team.object_CREATED_DATE as CREATED_DATE, {PREFIX}tl_hiring_team.hiring_team_name, {PREFIX}tl_hiring_team.hiring_team_logo, {PREFIX}tl_hiring_team.hiring_team_type, {PREFIX}tl_hiring_team.industry, {PREFIX}tl_hiring_team.time_zone, {PREFIX}tl_hiring_team.state, {PREFIX}tl_hiring_team.country, {PREFIX}tl_hiring_team.post_code, {PREFIX}tl_hiring_team.city, {PREFIX}tl_hiring_team.has_client_support, {PREFIX}tl_hiring_team.has_diversity, {PREFIX}tl_hiring_team.manage_own_billing, {PREFIX}tl_hiring_team.stripe_reference, {PREFIX}tl_hiring_team.stripe_subscription, {PREFIX}tl_hiring_team.stripe_fixed_sub_item, {PREFIX}tl_hiring_team.stripe_metered_sub_item, {PREFIX}tl_hiring_team.name_on_card, {PREFIX}tl_hiring_team.card_post_code, {PREFIX}tl_hiring_team.card_id, {PREFIX}tl_hiring_team.plan_renewed_on, {PREFIX}tl_hiring_team.ppj_credits, {PREFIX}tl_hiring_team.used_credits, {PREFIX}tl_hiring_team.available_credits, {PREFIX}tl_hiring_team.is_ppj, {PREFIX}tl_hiring_team.has_cap, {PREFIX}tl_hiring_team.max_cap, {PREFIX}tl_hiring_team.coupon_expiry_date, {PREFIX}tl_hiring_team.last_plan_amount, {PREFIX}tl_hiring_team.google_address_text, {PREFIX}tl_hiring_team.plan_cancelled, {PREFIX}tl_hiring_team.on_trial, {PREFIX}tl_hiring_team.trial_job_count, {PREFIX}tl_hiring_team.message_id, {PREFIX}tl_hiring_team.ht_status, {PREFIX}tl_hiring_team.company_id, {PREFIX}tl_hiring_team.billing_team_id, {PREFIX}tl_hiring_team.added_by_user_id, {PREFIX}tl_hiring_team.payment_plan_id, {PREFIX}tl_hiring_team.coupon_id, 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -223,6 +226,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_OnTrial)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_TrialJobCount)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_MessageID)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.FIELD_HTStatus)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_Company)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam)||
!tl_hiring_teamPSet.containsAttrib(HiringTeam.SINGLEREFERENCE_AddedByUser)||
......@@ -317,10 +321,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}tl_hiring_team " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, has_diversity = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, ppj_credits = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, plan_cancelled = ?, on_trial = ?, trial_job_count = ?, message_id = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET hiring_team_name = ?, hiring_team_logo = ?, hiring_team_type = ?, industry = ?, time_zone = ?, state = ?, country = ?, post_code = ?, city = ?, has_client_support = ?, has_diversity = ?, manage_own_billing = ?, stripe_reference = ?, stripe_subscription = ?, stripe_fixed_sub_item = ?, stripe_metered_sub_item = ?, name_on_card = ?, card_post_code = ?, card_id = ?, plan_renewed_on = ?, ppj_credits = ?, used_credits = ?, available_credits = ?, is_ppj = ?, has_cap = ?, max_cap = ?, coupon_expiry_date = ?, last_plan_amount = ?, google_address_text = ?, plan_cancelled = ?, on_trial = ?, trial_job_count = ?, message_id = ?, ht_status = ?, company_id = ? , billing_team_id = ? , added_by_user_id = ? , payment_plan_id = ? , coupon_id = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE tl_hiring_team.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_HasDiversity.getForSQL(dummyHasDiversity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasDiversity))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_PPJCredits.getForSQL(dummyPPJCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PPJCredits))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_OnTrial.getForSQL(dummyOnTrial, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_OnTrial))).listEntry (HELPER_TrialJobCount.getForSQL(dummyTrialJobCount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TrialJobCount))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_HasDiversity.getForSQL(dummyHasDiversity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasDiversity))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_PPJCredits.getForSQL(dummyPPJCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PPJCredits))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_OnTrial.getForSQL(dummyOnTrial, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_OnTrial))).listEntry (HELPER_TrialJobCount.getForSQL(dummyTrialJobCount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TrialJobCount))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))).listEntry (HELPER_HTStatus.getForSQL(dummyHTStatus, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HTStatus))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -408,6 +412,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
throw new RuntimeException ("NOT implemented: executeSearchQueryAll");
}
public ResultSet executeSearchQueryCompany (SQLManager sqlMgr, CompanyStatus CompanyStatus) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryCompany");
}
public ResultSet executeSearchQueryBillingTeams (SQLManager sqlMgr) throws SQLException
{
throw new RuntimeException ("NOT implemented: executeSearchQueryBillingTeams");
......@@ -561,6 +569,56 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
return results;
}
else if (searchType.equals (HiringTeam.SEARCH_Company))
{
// Local scope for transformed variables
{
if (criteria.containsKey("CompanyStatus"))
{
CompanyStatus CompanyStatus = (CompanyStatus)(criteria.get("CompanyStatus"));
criteria.put ("CompanyStatus", CompanyStatus.getValue());
}
}
String orderBy = " ORDER BY tl_hiring_team.object_id";
String tables = ", tl_company ";
Set<String> joinTableSet = new HashSet<String>();
String filter;
Object[] searchParams; // paramFilter: tl_hiring_team.object_id is not null
String preFilter = "(tl_hiring_team.object_id is not null)"
+ " AND (tl_company.object_id = tl_hiring_team.company_id) ";
if (criteria.containsKey("CompanyStatus"))
{
preFilter += " AND (tl_company.company_status = ${CompanyStatus}) ";
preFilter += "";
}
preFilter += context.getLoadingAttributes ().getCustomSQL() ;
SearchParamTransform tx = new SearchParamTransform (criteria);
filter = StringUtils.replaceParams (preFilter, tx);
searchParams = tx.getParamsArray();
Integer maxRows = context.getLoadingAttributes ().getMaxRows ();
boolean truncateExtra = !context.getLoadingAttributes ().isFailIfMaxExceeded();
String query = "SELECT " + SELECT_COLUMNS +
"FROM {PREFIX}tl_hiring_team " + tables + tableSetToSQL(joinTableSet) +
"WHERE " + SELECT_JOINS + " " + filter + orderBy;
BaseBusinessClass[] results = loadQuery (allPSets, sqlMgr, context, query, searchParams, maxRows, truncateExtra);
return results;
}
else if (searchType.equals (HiringTeam.SEARCH_BillingTeams))
{
// Local scope for transformed variables
......@@ -651,6 +709,7 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_OnTrial, HELPER_OnTrial.getFromRS(dummyOnTrial, r, "on_trial"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_TrialJobCount, HELPER_TrialJobCount.getFromRS(dummyTrialJobCount, r, "trial_job_count"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_MessageID, HELPER_MessageID.getFromRS(dummyMessageID, r, "message_id"));
tl_hiring_teamPSet.setAttrib(HiringTeam.FIELD_HTStatus, HELPER_HTStatus.getFromRS(dummyHTStatus, r, "ht_status"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_Company, r.getObject ("company_id"));
tl_hiring_teamPSet.setAttrib(HiringTeam.SINGLEREFERENCE_BilledByTeam, r.getObject ("billing_team_id"));
......@@ -673,10 +732,10 @@ public class HiringTeamPersistenceMgr extends ObjectPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}tl_hiring_team " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, has_diversity, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, ppj_credits, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, plan_cancelled, on_trial, trial_job_count, message_id, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (hiring_team_name, hiring_team_logo, hiring_team_type, industry, time_zone, state, country, post_code, city, has_client_support, has_diversity, manage_own_billing, stripe_reference, stripe_subscription, stripe_fixed_sub_item, stripe_metered_sub_item, name_on_card, card_post_code, card_id, plan_renewed_on, ppj_credits, used_credits, available_credits, is_ppj, has_cap, max_cap, coupon_expiry_date, last_plan_amount, google_address_text, plan_cancelled, on_trial, trial_job_count, message_id, ht_status, company_id, billing_team_id, added_by_user_id, payment_plan_id, coupon_id, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_HasDiversity.getForSQL(dummyHasDiversity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasDiversity))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_PPJCredits.getForSQL(dummyPPJCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PPJCredits))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_OnTrial.getForSQL(dummyOnTrial, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_OnTrial))).listEntry (HELPER_TrialJobCount.getForSQL(dummyTrialJobCount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TrialJobCount))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_HiringTeamName.getForSQL(dummyHiringTeamName, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamName))).listEntry (HELPER_HiringTeamLogo.getForSQL(dummyHiringTeamLogo, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamLogo))).listEntry (HELPER_HiringTeamType.getForSQL(dummyHiringTeamType, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HiringTeamType))).listEntry (HELPER_Industry.getForSQL(dummyIndustry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Industry))).listEntry (HELPER_TimeZone.getForSQL(dummyTimeZone, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TimeZone))).listEntry (HELPER_State.getForSQL(dummyState, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_State))).listEntry (HELPER_Country.getForSQL(dummyCountry, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_Country))).listEntry (HELPER_PostCode.getForSQL(dummyPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PostCode))).listEntry (HELPER_City.getForSQL(dummyCity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_City))).listEntry (HELPER_HasClientSupport.getForSQL(dummyHasClientSupport, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasClientSupport))).listEntry (HELPER_HasDiversity.getForSQL(dummyHasDiversity, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasDiversity))).listEntry (HELPER_ManageOwnBilling.getForSQL(dummyManageOwnBilling, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_ManageOwnBilling))).listEntry (HELPER_StripeReference.getForSQL(dummyStripeReference, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeReference))).listEntry (HELPER_StripeSubscription.getForSQL(dummyStripeSubscription, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeSubscription))).listEntry (HELPER_StripeFixedSubItem.getForSQL(dummyStripeFixedSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeFixedSubItem))).listEntry (HELPER_StripeMeteredSubItem.getForSQL(dummyStripeMeteredSubItem, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_StripeMeteredSubItem))).listEntry (HELPER_NameOnCard.getForSQL(dummyNameOnCard, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_NameOnCard))).listEntry (HELPER_CardPostCode.getForSQL(dummyCardPostCode, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardPostCode))).listEntry (HELPER_CardID.getForSQL(dummyCardID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CardID))).listEntry (HELPER_PlanRenewedOn.getForSQL(dummyPlanRenewedOn, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanRenewedOn))).listEntry (HELPER_PPJCredits.getForSQL(dummyPPJCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PPJCredits))).listEntry (HELPER_UsedCredits.getForSQL(dummyUsedCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_UsedCredits))).listEntry (HELPER_AvailableCredits.getForSQL(dummyAvailableCredits, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_AvailableCredits))).listEntry (HELPER_IsPPJ.getForSQL(dummyIsPPJ, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_IsPPJ))).listEntry (HELPER_HasCap.getForSQL(dummyHasCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HasCap))).listEntry (HELPER_MaxCap.getForSQL(dummyMaxCap, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MaxCap))).listEntry (HELPER_CouponExpiryDate.getForSQL(dummyCouponExpiryDate, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_CouponExpiryDate))).listEntry (HELPER_LastPlanAmount.getForSQL(dummyLastPlanAmount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_LastPlanAmount))).listEntry (HELPER_GoogleAddressText.getForSQL(dummyGoogleAddressText, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_GoogleAddressText))).listEntry (HELPER_PlanCancelled.getForSQL(dummyPlanCancelled, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_PlanCancelled))).listEntry (HELPER_OnTrial.getForSQL(dummyOnTrial, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_OnTrial))).listEntry (HELPER_TrialJobCount.getForSQL(dummyTrialJobCount, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_TrialJobCount))).listEntry (HELPER_MessageID.getForSQL(dummyMessageID, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_MessageID))).listEntry (HELPER_HTStatus.getForSQL(dummyHTStatus, tl_hiring_teamPSet.getAttrib (HiringTeam.FIELD_HTStatus))) .listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Company)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_BilledByTeam)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_AddedByUser)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_PaymentPlan)))).listEntry (SQLManager.CheckNull((Long)(tl_hiring_teamPSet.getAttrib (HiringTeam.SINGLEREFERENCE_Coupon)))) .listEntry (objectID.longID ()).toList().toArray());
tl_hiring_teamPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -481,9 +481,9 @@ public class Job extends BaseJob
{
title.append(getClient()).append(" - ");
}
else if(getCreatedBy() != null && getCreatedBy().getCompany() != null)
else if(getHiringTeam() != null)
{
title.append(getCreatedBy().getCompany()).append(" - ");
title.append(getHiringTeam()).append(" - ");
}
title.append(getJobTitle()).append(" ");
......
......@@ -68,7 +68,7 @@ public class JobApplication extends BaseJobApplication
if(template.getBusinessHoursOnly())
{
TimeZone jobTimeZone = getJob().getHiringTeam().getCompany().getDefaultTimeZone();
TimeZone jobTimeZone = getJob().getHiringTeam().getCompany().getTimeZone();
Calendar cal = new GregorianCalendar();
cal.setTime(scheduledDate);
......
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class CompanyStatus extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_CompanyStatus = new CompanyStatusFactory();
public static final CompanyStatus ACTIVE = new CompanyStatus ("ACTIVE", "ACTIVE", "Active", false);
public static final CompanyStatus CANCELLED = new CompanyStatus ("CANCELLED", "CANCELLED", "Cancelled", false);
public static final CompanyStatus CLOSED = new CompanyStatus ("CLOSED", "CLOSED", "Closed", false);
private static final CompanyStatus[] allCompanyStatuss =
new CompanyStatus[] { ACTIVE,CANCELLED,CLOSED};
private static CompanyStatus[] getAllCompanyStatuss ()
{
return allCompanyStatuss;
}
private CompanyStatus (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allCompanyStatuss);
static
{
defineAdditionalData ();
}
public boolean isEqual (CompanyStatus other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return CompanyStatus.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return CompanyStatus.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_CompanyStatus;
}
public static CompanyStatus forName (String name)
{
if (name == null) { return null; }
CompanyStatus[] all = getAllCompanyStatuss();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static CompanyStatus forValue (String value)
{
if (value == null) { return null; }
CompanyStatus[] all = getAllCompanyStatuss();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllCompanyStatuss (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllCompanyStatuss());
}
public static CompanyStatus[] getCompanyStatusArray ()
{
return (CompanyStatus[])getAllCompanyStatuss().clone ();
}
public static void defineAdditionalData ()
{
}
static class CompanyStatusFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return CompanyStatus.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return CompanyStatus.forValue (name);
}
public Enumeration getAll ()
{
return CompanyStatus.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="CompanyStatus">
<VALUE name="ACTIVE" value="ACTIVE" description="Active" />
<VALUE name="CANCELLED" value="CANCELLED" description="Cancelled" />
<VALUE name="CLOSED" value="CLOSED" description="Closed" />
</CONSTANT>
</ROOT>
\ No newline at end of file
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class HTStatus extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_HTStatus = new HTStatusFactory();
public static final HTStatus ACTIVE = new HTStatus ("ACTIVE", "ACTIVE", "Active", false);
public static final HTStatus CANCELLED = new HTStatus ("CANCELLED", "CANCELLED", "Cancelled", false);
public static final HTStatus CLOSED = new HTStatus ("CLOSED", "CLOSED", "Closed", false);
private static final HTStatus[] allHTStatuss =
new HTStatus[] { ACTIVE,CANCELLED,CLOSED};
private static HTStatus[] getAllHTStatuss ()
{
return allHTStatuss;
}
private HTStatus (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allHTStatuss);
static
{
defineAdditionalData ();
}
public boolean isEqual (HTStatus other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return HTStatus.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return HTStatus.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_HTStatus;
}
public static HTStatus forName (String name)
{
if (name == null) { return null; }
HTStatus[] all = getAllHTStatuss();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static HTStatus forValue (String value)
{
if (value == null) { return null; }
HTStatus[] all = getAllHTStatuss();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllHTStatuss (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllHTStatuss());
}
public static HTStatus[] getHTStatusArray ()
{
return (HTStatus[])getAllHTStatuss().clone ();
}
public static void defineAdditionalData ()
{
}
static class HTStatusFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return HTStatus.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return HTStatus.forValue (name);
}
public Enumeration getAll ()
{
return HTStatus.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="HTStatus">
<VALUE name="ACTIVE" value="ACTIVE" description="Active" />
<VALUE name="CANCELLED" value="CANCELLED" description="Cancelled" />
<VALUE name="CLOSED" value="CLOSED" description="Closed" />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -28,6 +28,8 @@ import oneit.utils.parsers.FieldException;
import oneit.servlets.orm.*;
import performa.orm.types.*;
public abstract class BaseSearchHiringTeam extends SearchExecutor
......@@ -41,16 +43,19 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
// Static constants corresponding to field names
public static final String FIELD_Details = "Details";
public static final String FIELD_CompanyStatus = "CompanyStatus";
// Static constants corresponding to searches
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper<SearchHiringTeam> HELPER_Details = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper<SearchHiringTeam, CompanyStatus> HELPER_CompanyStatus = new EnumeratedAttributeHelper<SearchHiringTeam, CompanyStatus> (CompanyStatus.FACTORY_CompanyStatus);
// Private attributes corresponding to business object data
private String _Details;
private CompanyStatus _CompanyStatus;
// Private attributes corresponding to single references
......@@ -64,6 +69,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
// Arrays of validators for each attribute
private static final AttributeValidator[] FIELD_Details_Validators;
private static final AttributeValidator[] FIELD_CompanyStatus_Validators;
// Arrays of behaviour decorators
......@@ -78,6 +84,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
Map validatorMapping = ((Map)ConfigMgr.getConfigObject ("CONFIG.ORMVALIDATOR", "ValidatorMapping"));
FIELD_Details_Validators = (AttributeValidator[])setupAttribMetaData_Details(validatorMapping).toArray (new AttributeValidator[0]);
FIELD_CompanyStatus_Validators = (AttributeValidator[])setupAttribMetaData_CompanyStatus(validatorMapping).toArray (new AttributeValidator[0]);
REFERENCE_SearchHiringTeam.initialiseReference ();
......@@ -110,6 +117,24 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
return validators;
}
// Meta Info setup
private static List setupAttribMetaData_CompanyStatus(Map validatorMapping)
{
Map metaInfo = new HashMap ();
metaInfo.put ("attribHelper", "EnumeratedAttributeHelper");
metaInfo.put ("name", "CompanyStatus");
metaInfo.put ("type", "CompanyStatus");
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG2, "Metadata for SearchHiringTeam.CompanyStatus:", metaInfo);
ATTRIBUTES_METADATA_SearchHiringTeam.put (FIELD_CompanyStatus, Collections.unmodifiableMap (metaInfo));
List validators = BaseBusinessClass.getAttribValidators(SearchHiringTeam.class, "CompanyStatus", metaInfo, validatorMapping);
LogMgr.log (BUSINESS_OBJECTS, LogLevel.DEBUG1, "Validators for SearchHiringTeam.CompanyStatus:", validators);
return validators;
}
// END OF STATIC METADATA DEFINITION
......@@ -138,6 +163,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
_Details = (String)(HELPER_Details.initialise (_Details));
_CompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.initialise (_CompanyStatus));
}
......@@ -260,6 +286,104 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
}
}
/**
* Get the attribute CompanyStatus
*/
public CompanyStatus getCompanyStatus ()
{
assertValid();
CompanyStatus valToReturn = _CompanyStatus;
for (SearchHiringTeamBehaviourDecorator bhd : SearchHiringTeam_BehaviourDecorators)
{
valToReturn = bhd.getCompanyStatus ((SearchHiringTeam)this, valToReturn);
}
return valToReturn;
}
/**
* Called prior to the attribute changing. Subclasses need not call super. If a field exception
* is thrown, the attribute change will fail. The new value is different to the old value.
*/
protected void preCompanyStatusChange (CompanyStatus newCompanyStatus) throws FieldException
{
}
/**
* Called after the attribute changes.
* If a field exception is thrown, the value is still changed, however it
* may lead to the TX being rolled back
*/
protected void postCompanyStatusChange () throws FieldException
{
}
public FieldWriteability getWriteability_CompanyStatus ()
{
return getFieldWritabilityUtil (FieldWriteability.TRUE);
}
/**
* Set the attribute CompanyStatus. Checks to ensure a new value
* has been supplied. If so, marks the field as altered and sets the attribute.
*/
public void setCompanyStatus (CompanyStatus newCompanyStatus) throws FieldException
{
boolean oldAndNewIdentical = HELPER_CompanyStatus.compare (_CompanyStatus, newCompanyStatus);
try
{
for (SearchHiringTeamBehaviourDecorator bhd : SearchHiringTeam_BehaviourDecorators)
{
newCompanyStatus = bhd.setCompanyStatus ((SearchHiringTeam)this, newCompanyStatus);
oldAndNewIdentical = HELPER_CompanyStatus.compare (_CompanyStatus, newCompanyStatus);
}
if (FIELD_CompanyStatus_Validators.length > 0)
{
Object newCompanyStatusObj = HELPER_CompanyStatus.toObject (newCompanyStatus);
if (newCompanyStatusObj != null)
{
int loopMax = FIELD_CompanyStatus_Validators.length;
Map metadata = (Map)ATTRIBUTES_METADATA_SearchHiringTeam.get (FIELD_CompanyStatus);
for (int v = 0 ; v < loopMax ; ++v)
{
FIELD_CompanyStatus_Validators[v].checkAttribute (this, FIELD_CompanyStatus, metadata, newCompanyStatusObj);
}
}
}
}
catch (FieldException e)
{
if (!oldAndNewIdentical)
{
e.setWouldModify ();
}
throw e;
}
if (!oldAndNewIdentical)
{
assertValid();
Debug.assertion (getWriteability_CompanyStatus () != FieldWriteability.FALSE, "Field CompanyStatus is not writeable");
preCompanyStatusChange (newCompanyStatus);
markFieldChange (FIELD_CompanyStatus);
_CompanyStatus = newCompanyStatus;
postFieldChange (FIELD_CompanyStatus);
postCompanyStatusChange ();
}
}
/**
......@@ -519,6 +643,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
it_does_not_matterPSet.setAttrib (FIELD_ObjectID, myID);
it_does_not_matterPSet.setAttrib (FIELD_Details, HELPER_Details.toObject (_Details)); //
it_does_not_matterPSet.setAttrib (FIELD_CompanyStatus, HELPER_CompanyStatus.toObject (_CompanyStatus)); //
}
......@@ -534,6 +659,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
PersistentSet it_does_not_matterPSet = allSets.getPersistentSet (objectID, "it_does_not_matter");
_Details = (String)(HELPER_Details.fromObject (_Details, it_does_not_matterPSet.getAttrib (FIELD_Details))); //
_CompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.fromObject (_CompanyStatus, it_does_not_matterPSet.getAttrib (FIELD_CompanyStatus))); //
}
......@@ -558,6 +684,15 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
e.addException (ex);
}
try
{
setCompanyStatus (otherSearchHiringTeam.getCompanyStatus ());
}
catch (FieldException ex)
{
e.addException (ex);
}
}
}
......@@ -574,6 +709,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
BaseSearchHiringTeam sourceSearchHiringTeam = (BaseSearchHiringTeam)(source);
_Details = sourceSearchHiringTeam._Details;
_CompanyStatus = sourceSearchHiringTeam._CompanyStatus;
}
}
......@@ -627,6 +763,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
super.readExternalData(vals);
_Details = (String)(HELPER_Details.readExternal (_Details, vals.get(FIELD_Details))); //
_CompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.readExternal (_CompanyStatus, vals.get(FIELD_CompanyStatus))); //
}
......@@ -639,6 +776,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
super.writeExternalData(vals);
vals.put (FIELD_Details, HELPER_Details.writeExternal (_Details));
vals.put (FIELD_CompanyStatus, HELPER_CompanyStatus.writeExternal (_CompanyStatus));
}
......@@ -656,6 +794,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
listener.notifyFieldChange(this, other, FIELD_Details, HELPER_Details.toObject(this._Details), HELPER_Details.toObject(otherSearchHiringTeam._Details));
}
if (!HELPER_CompanyStatus.compare(this._CompanyStatus, otherSearchHiringTeam._CompanyStatus))
{
listener.notifyFieldChange(this, other, FIELD_CompanyStatus, HELPER_CompanyStatus.toObject(this._CompanyStatus), HELPER_CompanyStatus.toObject(otherSearchHiringTeam._CompanyStatus));
}
// Compare single assocs
......@@ -679,6 +821,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
super.visitAttributes (visitor);
visitor.visitField(this, FIELD_Details, HELPER_Details.toObject(getDetails()));
visitor.visitField(this, FIELD_CompanyStatus, HELPER_CompanyStatus.toObject(getCompanyStatus()));
}
......@@ -716,6 +859,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
return filter.matches (getDetails ());
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return filter.matches (getCompanyStatus ());
}
else
{
return super.testFilter (attribName, filter);
......@@ -735,6 +882,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
return HELPER_Details.toObject (getDetails ());
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return HELPER_CompanyStatus.toObject (getCompanyStatus ());
}
else
{
return super.getAttribute (attribName);
......@@ -752,6 +903,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
return HELPER_Details;
}
else if (attribName.equals (FIELD_CompanyStatus))
{
return HELPER_CompanyStatus;
}
else
{
return super.getAttributeHelper (attribName);
......@@ -769,6 +924,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
setDetails ((String)(HELPER_Details.fromObject (_Details, attribValue)));
}
else if (attribName.equals (FIELD_CompanyStatus))
{
setCompanyStatus ((CompanyStatus)(HELPER_CompanyStatus.fromObject (_CompanyStatus, attribValue)));
}
else
{
super.setAttribute (attribName, attribValue);
......@@ -793,6 +952,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
return getWriteability_Details ();
}
else if (fieldName.equals (FIELD_CompanyStatus))
{
return getWriteability_CompanyStatus ();
}
else
{
return super.getWriteable (fieldName);
......@@ -808,6 +971,11 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
fields.add (FIELD_Details);
}
if (getWriteability_CompanyStatus () != FieldWriteability.TRUE)
{
fields.add (FIELD_CompanyStatus);
}
super.putUnwriteable (fields);
}
......@@ -818,6 +986,7 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
result.add(HELPER_Details.getAttribObject (getClass (), _Details, false, FIELD_Details));
result.add(HELPER_CompanyStatus.getAttribObject (getClass (), _CompanyStatus, false, FIELD_CompanyStatus));
return result;
}
......@@ -886,6 +1055,24 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
return newDetails;
}
/**
* Get the attribute CompanyStatus
*/
public CompanyStatus getCompanyStatus (SearchHiringTeam obj, CompanyStatus original)
{
return original;
}
/**
* Change the value set for attribute CompanyStatus.
* May modify the field beforehand
* Occurs before validation.
*/
public CompanyStatus setCompanyStatus (SearchHiringTeam obj, CompanyStatus newCompanyStatus) throws FieldException
{
return newCompanyStatus;
}
}
......@@ -942,6 +1129,10 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
{
return toDetails ();
}
if (name.equals ("CompanyStatus"))
{
return toCompanyStatus ();
}
return super.to(name);
......@@ -950,6 +1141,8 @@ public abstract class BaseSearchHiringTeam extends SearchExecutor
public PipeLine<From, String> toDetails () { return pipe(new ORMAttributePipe<Me, String>(FIELD_Details)); }
public PipeLine<From, CompanyStatus> toCompanyStatus () { return pipe(new ORMAttributePipe<Me, CompanyStatus>(FIELD_CompanyStatus)); }
}
public boolean isTransientAttrib(String attribName)
......
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.rdbms.filters.ILikeFilter;
import oneit.servlets.jsp.ORMTextSearcher;
import performa.orm.Company;
public class CompanySearcher implements ORMTextSearcher
{
public static CompanySearcher INSTANCE = new CompanySearcher();
@Override
public BaseBusinessClass[] search(ObjectTransaction ot, String searchTerm)
{
return Company.SearchByAll().andCompanyName(new ILikeFilter(searchTerm, "%", "%")).search(ot);
}
}
\ No newline at end of file
......@@ -18,6 +18,9 @@ public class SearchHiringTeam extends BaseSearchHiringTeam
@Override
public BaseBusinessClass[] doSearch()
{
return HiringTeam.SearchByAll().andHiringTeamName(new ILikeFilter(getDetails(), "%", "%")).search(getTransaction());
return HiringTeam.SearchByCompany()
.byCompanyStatus(getCompanyStatus())
.andHiringTeamName(new ILikeFilter(getDetails(), "%", "%"))
.search(getTransaction());
}
}
\ No newline at end of file
......@@ -5,11 +5,13 @@
<BUSINESSCLASS name="SearchHiringTeam" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*" />
<IMPORT value="performa.orm.types.*" />
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE" >
<ATTRIB name="Details" type="String" dbcol="xxxx" />
<ATTRIB name="Details" type="String" dbcol="xxxx" />
<ATTRIB name="CompanyStatus" type="CompanyStatus" attribHelper="EnumeratedAttributeHelper"/>
</TABLE>
</BUSINESSCLASS>
......
......@@ -15,6 +15,7 @@ import oneit.utils.resource.*;
import oneit.utils.*;
import oneit.utils.threading.*;
import oneit.servlets.orm.*;
import performa.orm.types.*;
......@@ -28,10 +29,12 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
// Private attributes corresponding to business object data
private String dummyDetails;
private CompanyStatus dummyCompanyStatus;
// Static constants corresponding to attribute helpers
private static final DefaultAttributeHelper HELPER_Details = DefaultAttributeHelper.INSTANCE;
private static final EnumeratedAttributeHelper HELPER_CompanyStatus = new EnumeratedAttributeHelper (CompanyStatus.FACTORY_CompanyStatus);
......@@ -39,10 +42,11 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
public SearchHiringTeamPersistenceMgr ()
{
dummyDetails = (String)(HELPER_Details.initialise (dummyDetails));
dummyCompanyStatus = (CompanyStatus)(HELPER_CompanyStatus.initialise (dummyCompanyStatus));
}
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, 1 AS commasafe ";
private String SELECT_COLUMNS = "{PREFIX}it_does_not_matter.object_id as id, {PREFIX}it_does_not_matter.object_LAST_UPDATED_DATE as LAST_UPDATED_DATE, {PREFIX}it_does_not_matter.object_CREATED_DATE as CREATED_DATE, {PREFIX}it_does_not_matter.xxxx, {PREFIX}it_does_not_matter., 1 AS commasafe ";
private String SELECT_JOINS = "";
public BaseBusinessClass fetchByID(ObjectID id, PersistentSetCollection allPSets, RDBMSPersistenceContext context, SQLManager sqlMgr) throws SQLException, StorageException
......@@ -93,7 +97,8 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
// Check for persistent sets already prefetched
if (false || !it_does_not_matterPSet.containsAttrib(BaseBusinessClass.FIELD_ObjectLastModified) ||
!it_does_not_matterPSet.containsAttrib(SearchHiringTeam.FIELD_Details))
!it_does_not_matterPSet.containsAttrib(SearchHiringTeam.FIELD_Details)||
!it_does_not_matterPSet.containsAttrib(SearchHiringTeam.FIELD_CompanyStatus))
{
// We will need to retrieve it
idsToFetch.add (id.longValue());
......@@ -163,10 +168,10 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
{
int rowsUpdated = executeStatement (sqlMgr,
"UPDATE {PREFIX}it_does_not_matter " +
"SET xxxx = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"SET xxxx = ?, = ? , object_LAST_UPDATED_DATE = " + sqlMgr.getPortabilityServices ().getTimestampExpression () + " " +
"WHERE it_does_not_matter.object_id = ? AND " + getConcurrencyCheck (sqlMgr, "object_LAST_UPDATED_DATE", obj.getObjectLastModified ()) + " ",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_Details))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_Details))).listEntry (HELPER_CompanyStatus.getForSQL(dummyCompanyStatus, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_CompanyStatus))).listEntry (objectID.longID ()).listEntry (obj.getObjectLastModified ()).toList().toArray());
if (rowsUpdated != 1)
{
......@@ -401,6 +406,7 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
it_does_not_matterPSet.setAttrib(BaseBusinessClass.FIELD_ObjectCreated, r.getTimestamp ("CREATED_DATE"));
it_does_not_matterPSet.setAttrib(SearchHiringTeam.FIELD_Details, HELPER_Details.getFromRS(dummyDetails, r, "xxxx"));
it_does_not_matterPSet.setAttrib(SearchHiringTeam.FIELD_CompanyStatus, HELPER_CompanyStatus.getFromRS(dummyCompanyStatus, r, ""));
}
......@@ -418,10 +424,10 @@ public class SearchHiringTeamPersistenceMgr extends SearchExecutorPersistenceMgr
{
executeStatement (sqlMgr,
"INSERT INTO {PREFIX}it_does_not_matter " +
" (xxxx, object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
" (xxxx, , object_id, object_LAST_UPDATED_DATE, object_CREATED_DATE) " +
"VALUES " +
" (?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_Details))) .listEntry (objectID.longID ()).toList().toArray());
" (?, ?, ?, " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ", " + sqlMgr.getPortabilityServices ().getTimestampExpression () + ")",
CollectionUtils.listEntry (HELPER_Details.getForSQL(dummyDetails, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_Details))).listEntry (HELPER_CompanyStatus.getForSQL(dummyCompanyStatus, it_does_not_matterPSet.getAttrib (SearchHiringTeam.FIELD_CompanyStatus))) .listEntry (objectID.longID ()).toList().toArray());
it_does_not_matterPSet.setStatus (PersistentSetStatus.PROCESSED);
}
......
......@@ -26,7 +26,7 @@ public class SearchHome extends BaseSearchHome
if(!getShowAllJobs())
{
search = search.andCreatedBy(new EqualsFilter<>(getCompanyUser()));
search = search.andJobOwner(new EqualsFilter<>(getCompanyUser()));
}
return search.search(getTransaction());
......
......@@ -104,9 +104,11 @@ public class PerformaOAuthCallbackDecorator implements ServletDecorator, Initial
company.setAddedByUser(companyUser);
companyUser.setCompany(company);
HiringTeam hiringTeam = company.getHiringTeamsAt(0);
HiringTeam hiringTeam = HiringTeam.createHiringTeam(transaction);
hiringTeam.setAddedByUser(companyUser);
hiringTeam.setHiringTeamName("");
company.addToHiringTeams(hiringTeam);
companyUser.setDefaultHiringTeam(hiringTeam);
CompanyUserHiringTeamLink link = CompanyUserHiringTeamLink.createCompanyUserHiringTeamLink(transaction);
......
......@@ -570,8 +570,19 @@ public class Utils
public static HiringTeam[] getHiringTeamsByUser(CompanyUser companyUser)
{
return companyUser.pipelineCompanyUser().toHiringTeams().toHiringTeam().uniqueVals().toArray(new HiringTeam[0]);
Set<HiringTeam> hiringTeams = new HashSet();
for(HiringTeam hiringTeam : companyUser.pipelineCompanyUser().toHiringTeams().toHiringTeam(HiringTeam.SearchByAll().andHTStatus(new EqualsFilter<>(HTStatus.ACTIVE))).uniqueVals())
{
if(hiringTeam.getCompany().getCompanyStatus() == CompanyStatus.ACTIVE)
{
hiringTeams.add(hiringTeam);
}
}
return hiringTeams.toArray(new HiringTeam[0]);
}
public static HiringTeam[] getOtherHiringTeams(HiringTeam hiringTeam, CompanyUser comUser, CompanyUserHiringTeamLink userLink)
{
......
......@@ -7710,7 +7710,7 @@ input{
font-size: 15px;
text-align: center;
border-color: #03a0e7 !important;
width: 190px;
width: 170px;
height: 50px;
margin-top: 10px;
margin-right: 20px;
......@@ -7879,3 +7879,20 @@ input{
/*
End of CV Cover Letter Popup
*/
/*
Start of Manage Customer
*/
.my-company-area.manage-company{
width: 90%;
}
.company-content-area.manage-company {
float: left;
width: 100%;
}
.radio.radio-primary.workplace-radio.manage-company {
margin-left: 30px;
}
/*
End of Manage Customer
*/
\ No newline at end of file
......@@ -97,6 +97,14 @@
</NODE>
</MAP>
<MAP value="CUSTOMER" description="Manage Customer" 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/manage_customer.jsp"/>
</NODE>
</MAP>
<MAP value="MY_COMPANY" description="My Company" TemplatePage="dynamic_content_form_client.jsp">
<NODE name="Config" factory="Participant" class="oneit.business.content.ArticleConfiguration">
<INHERITS nodename="StandardJSP"/>
......
......@@ -23,7 +23,6 @@
CultureCriteriaTemplate[] templates = CultureCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(transaction);
// handle client
......
......@@ -14,7 +14,7 @@
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<CompanyUser> companyUsers = comUser.pipelineCompanyUser().toHiringTeams().toHiringTeam().toUsers().toCompanyUser().uniqueVals();
boolean readOnly = !comUser.isOwner();
HiringTeam selectedTeam = comUser.getActiveHiringTeam();
......@@ -23,13 +23,8 @@
company = comUser.getCompany();
process.setAttribute("Company", company);
}
if(companyUsers == null)
{
companyUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)));
process.setAttribute("CompanyUsers", companyUsers);
}
process.setAttribute("CompanyUsers", companyUsers);
if( request.getParameter("UserSortOption") != null)
{
......@@ -94,7 +89,7 @@
<oneit:toString value="<%= hiringTeam.getHiringTeamName() %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
Owner: <oneit:toString value="<%= hiringTeam.getAddedByUser() %>" mode="EscapeHTML" />
Owner: <oneit:toString value="<%= hiringTeam.getOwner() %>" mode="EscapeHTML" />
</div>
</div>
</div>
......
......@@ -41,7 +41,7 @@
<%
}
%>
</span> by <oneit:toString value="<%= job.getCreatedBy() %>" mode="EscapeHTML" nullValue=""/> &nbsp;&nbsp;.&nbsp;&nbsp;
</span> by <oneit:toString value="<%= job.getJobOwner() %>" mode="EscapeHTML" nullValue=""/> &nbsp;&nbsp;.&nbsp;&nbsp;
<oneit:toString value="<%= job.getOccupation() %>" mode="EscapeHTML" />
</div>
</div>
......@@ -303,6 +303,11 @@
for(FactorClass factorClass : factorClassDtls.keySet())
{
if(roleScoreMap.get(factorClass) == null)
{
continue;
}
Map<FactorLevelLink, Map> factorDetails = factorClassDtls.get(factorClass);
Double rating = roleScoreMap.get(factorClass).get2() > 0 ? roleScoreMap.get(factorClass).get2() : 0d;
......
......@@ -65,7 +65,7 @@
<%
}
%>
</span> by <oneit:toString value="<%= job.getCreatedBy() %>" mode="EscapeHTML" nullValue=""/>
</span> by <oneit:toString value="<%= job.getJobOwner() %>" mode="EscapeHTML" nullValue=""/>
&nbsp;&nbsp;.&nbsp;&nbsp;
<oneit:toString value="<%= job.getLevel() %>" mode="EscapeHTML" />
</div>
......
......@@ -67,7 +67,7 @@
<%
}
%>
</span> by <oneit:toString value="<%= job.getCreatedBy() %>" mode="EscapeHTML" nullValue=""/>
</span> by <oneit:toString value="<%= job.getJobOwner() %>" mode="EscapeHTML" nullValue=""/>
&nbsp;&nbsp;.&nbsp;&nbsp;
<oneit:toString value="<%= job.getOccupation() %>" mode="EscapeHTML" />
</div>
......
......@@ -37,7 +37,7 @@
ExtendPopup = new jBox('Modal', {
id : "extend-job",
overlay : true,
width : 500, height : 380
width : 500, height : 400
});
StatusPopup = new jBox('Modal', {
......@@ -221,6 +221,7 @@
Are you sure you want to extend this job?
</h3>
<div class="extend-job-info">
There is a charge equal to 1 Job to extend a job.<br/><br/>
Extending this Job will add an additional 30 days for applicants to apply. By confirming the new close date for this job will be
<oneit:toString value="<%= DateDiff.add(job.getApplyBy(), Calendar.DATE, 30) %>" mode="LongDate" />.
Would you like to continue?
......
......@@ -73,7 +73,7 @@
<%
}
%>
</span> by <oneit:toString value="<%= job.getCreatedBy() %>" mode="EscapeHTML" nullValue=""/>
</span> by <oneit:toString value="<%= job.getJobOwner() %>" mode="EscapeHTML" nullValue=""/>
</div>
</div>
<div class="applicant-right-status">
......
......@@ -48,7 +48,7 @@
<%
}
if((userRole != RoleType.STANDARD && hiringTeam.getCardID() == null || isAssumedUser) && hiringTeam.getManageOwnBilling())
if((userRole != RoleType.STANDARD || isAssumedUser) && hiringTeam.getManageOwnBilling())
{
%>
<li class="<%= tabNumber == "3" ? "active" : ""%>">
......
......@@ -50,6 +50,7 @@
jobApplication.setWorkFlow(workflow);
%>
<div class="appli-row" id="<%= jobApplication.getID() %>">
<div class="appli-checkbox appli-l eq-second-height">
<div class="checkbox-list">
......
......@@ -25,9 +25,6 @@
process.setAttribute("Job", job);
}
CompanyUser companyUser = job.getCreatedBy();
Company company = companyUser.getCompany();
Debug.assertion(job != null, "Job is null in admin portal create job");
......
......@@ -23,7 +23,6 @@
AssessmentCriteriaTemplate[] templates = AssessmentCriteriaTemplate.SearchByAll()
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.andCompanyUser(new EqualsFilter<>(companyUser))
.search(transaction);
// handle client
......
<%@ 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>
<%
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getActiveHiringTeam();
Company company = hiringTeam.getCompany();
String nextPage = WebUtils.getArticleByShortCut(transaction, WebUtils.ADMIN_HOME).getLink(request);
Debug.assertion(company != null , "Invalid company in admin portal my company");
boolean readOnly = company.getObjectWriteability() == FieldWriteability.NOT_IN_GUI;
%>
<div class="container-fluid">
<div class="row content">
<div class="main-content-area">
<oneit:form name="editCompany" method="post" enctype="multipart/form-data">
<h1 class="page-title">Manage Customer</h1>
<div class="my-company-area manage-company">
<div style="padding-left: 15px; padding-right: 15px;">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
</div>
<div class="company-content-area manage-company">
<!-- Tab panes -->
<div class="tab-content form-content-wrap">
<div class="tab-pane active" id="company-detail">
<div class="form-group row">
<div class="col-md-12">
<label><oneit:label GUIName="Customer Name"/></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="CompanyName" cssClass="form-control"/>
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<label><oneit:label GUIName="What type of hiring team are you?" /></label>
<%
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());
for(HiringTeamType hiringTeamType : HiringTeamType.getHiringTeamTypeArray())
{
boolean isSelected = CollectionUtils.equals(formValue, hiringTeamType.getName());
String hiringTeamTypeId = String.valueOf(company.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
String disabled = isSelected ? "" : readOnly? "disabled" : "";
%>
<div class="radio radio-primary workplace-radio manage-company">
<input type="radio" name="<%= optionKey %>" id="<%= hiringTeamTypeId %>" class="element_rating_radio" value="<%= hiringTeamType.getName() %>" <%= selected %> <%= disabled %>>
<label for="<%= hiringTeamTypeId %>">
<oneit:toString value="<%= hiringTeamType %>" mode="EscapeHTML"/>
</label>
</div>
<%
}
%>
</div>
</div>
<div class="form-group row">
<div class="col-md-8">
<label><oneit:label GUIName="Time Zone" /></label>
<oneit:ormEnum obj="<%= company %>" attributeName="TimeZone" cssClass="form-control"/>
</div>
</div>
</div>
<div class="text-center form-group">
<oneit:button value="Cancel" name="gotoPage" cssClass="btn btn-primary largeBtn greyBtn"
requestAttribs='<%= CollectionUtils.mapEntry ("nextPage", nextPage)
.mapEntry("cancelProcess", true)
.toMap() %>'/>
<oneit:button value="Save" name="save" cssClass="btn btn-primary largeBtn" disabled="<%= readOnly ? "true" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("Company", company)
.toMap() %>" />
</div>
</div>
</div>
</div>
</div>
</oneit:form>
</div>
</div>
</oneit:dynIncluded>
......@@ -10,10 +10,7 @@
String homePage = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.ADMIN_HOME).getLink(request);
SecUser loggedInUser = SecUser.getTXUser(transaction);
CompanyUser companyUser = loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Debug.assertion(company != null , "Invalid company in admin portal my company");
Debug.assertion(hiringTeam != null , "Invalid Hiring Team in admin portal manage plan");
......
......@@ -14,6 +14,11 @@
Boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Company", Company.REFERENCE_Company);
Company company = (Company) process.getAttribute("Company");
if(toRedirect)
{
company.addToHiringTeams(HiringTeam.createHiringTeam(objTran));
}
SecUser secUser = null;
CompanyUser companyUser = company.getAddedByUser();
......
......@@ -13,7 +13,12 @@
ObjectTransaction objTran = process.getTransaction ();
Boolean toRedirect = GenericObjDF.getOrCreateObject (request, "Company", Company.REFERENCE_Company);
Company company = (Company) process.getAttribute("Company");
if(toRedirect)
{
company.addToHiringTeams(HiringTeam.createHiringTeam(objTran));
}
SecUser secUser = null;
CompanyUser companyUser = company.getAddedByUser();
......
<?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="ManageCustomer">
<createSpecificIdentifier factory='String' value='P3JAHBQF4OA43X1KDGW7301HWK0BXR'/>
<articleIdentifiers factory="Array" class="java.lang.String">
<NODE factory="String" value="P3JAHBQF4OA43X1KDGW7301HWK0BXR"/>
</articleIdentifiers>
<createdLabel factory="String" value="P3JAHBQF4OA43X1KDGW7301HWK0BXR"/>
<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="Manage Customer"/>
<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="company-icon"/>
<NODE name="On Left Menu" factory="Boolean" value="true"/>
<NODE name="Shortcuts" factory="String" value="ManageCustomer"/>
<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="ManageCustomer"/>
<NODE name="ShortTitle" factory="String" value="Clients"/>
<NODE name="SortOrder" factory="Integer" value="38019994"/>
<NODE name="Type" factory="Enumerated" class="oneit.business.content.ArticleType" value="ARTICLE"/>
<NODE name="Template" factory="Enumerated" class="oneit.business.content.ArticleTemplate" value="CUSTOMER"/>
</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_company</tableName>
<column name="company_status" type="String" nullable="true" length="200"/>
</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_hiring_team</tableName>
<column name="ht_status" type="String" nullable="true" length="200"/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
-- @AutoRun
update tl_company set company_status = 'ACTIVE';
update tl_hiring_team set ht_status = 'ACTIVE';
\ No newline at end of file
......@@ -12,12 +12,16 @@
<FORM name="*.createPlan" factory="Participant" class="performa.form.CreatePlanFP"/>
</NODE>
<NODE name="createArticle_jsp::TL" factory="Participant">
<NODE name="customers_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
<FORM name="*.assume" factory="Participant" class="performa.form.AssumeHTAdminFP">
<NODE name="loginFP" factory="Named" nodename="CMSLoginFP"/>
</FORM>
<FORM name="*.search" factory="Participant" class="oneit.servlets.orm.RunSearchExecutorFP"/>
<DATA class="oneit.servlets.orm.RunSearchExecutorDF"/>
</NODE>
<NODE name="changeCompanyPopup_jsp" factory="Participant">
<INHERITS factory="Named" nodename="CoreORMAdmin"/>
<FORM name="*.changeCompany" factory="Participant" class="performa.form.ChangeCompanyFP"/>
</NODE>
<NODE name="editMessageTemplate_jsp" factory="Participant">
......
......@@ -8,6 +8,7 @@
<!-- <TOPMENU name="MENU.TEST_ANALYSIS" desc="Test Analysis" sortOrder="100" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element"
link="/extensions/performa/testAnalysis.jsp"/> -->
<CHILD name="Performa.Customers" desc="Customers" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/customers.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.SetupPlans" desc="Setup Plans" sortOrder="10" toplevel="ADMIN" priv="admin" link="/extensions/performa/setupPlans.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.MessageTemplate" desc="Message Template" sortOrder="20" toplevel="ADMIN" priv="admin" link="/extensions/performa/listMessageTemplate.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
<CHILD name="Performa.NotificationTemplate" desc="Notification Template" sortOrder="30" toplevel="ADMIN" priv="admin" link="/extensions/performa/listNotificationTemplates.jsp" factory="Participant" class="oneit.servlets.jsp.ui.DefaultUICustomiser$Element" />
......
<%@ page extends="oneit.servlets.jsp.JSPInclude"%>
<%@ page extends="oneit.servlets.jsp.FormJSP"%>
<%@ include file="/setuprequest.jsp"%>
<%@ include file="inc/stdimports.jsp"%>
<%@ include file="/editor/stdimports.jsp"%>
<%@ page import="oneit.security.jsp.*" %>
<%@ page import="oneit.servlets.jsp.ormtable.*" %>
<oneit:dynIncluded>
<%! protected String getName (ServletConfig config) { return "customers_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
String currentPage = request.getContextPath() + "/editor/home.jsp";
String currentPage = request.getContextPath() + "/extensions/performa/customers.jsp";
SecUser secUser = SecUser.getTXUser(objTran);
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
SearchHiringTeam searchHT = (SearchHiringTeam) RunSearchExecutorFP.setupExecutor(request, SearchHiringTeam.REFERENCE_SearchHiringTeam, true);
......@@ -45,32 +45,65 @@
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "Customers").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "Customers");
%>
<%@include file="/editor/header.jsp"%>
<oneit:css>
<oneit:css href="/css/common.css" />
<oneit:css href="/css/jBox.css" />
</oneit:css>
<oneit:script>
<oneit:script src="/scripts/jBox.js"/>
</oneit:script>
<style>
.dashboard-content-area {
margin-top: 0px ;
width: 100%;
}
.change-company-btn{
border: none;
background: none;
color: #4e5258;
}
</style>
<div class="dashboard-content-area second-part">
<script type="text/javascript">
$(function(){
var Popup = null;
$(document).ready(function(){
setupRecalc ($("form"), {'recalcOnError':true});
$(".change-company-btn").prop('title', 'Change Customer');
$(".htstatus").change(function() {
$('.save').click();
});
$(".company-status").change(function() {
$('.search-real-btn').click();
});
});
$(function(){
$('.search-icon-btn').click(function () {
$('.search-real-btn').click();
});
});
</script>
<div class="dashboard-content-area second-part">
<div class="jobs-list-shorting">
<div class="d-job-title all-jobs-title">Customers</div>
<div class="shorting-dropdown relative-parent">
<div class="order-label">Search Customers</div>
<oneit:ormInput obj="<%= searchHT %>" type="text" attributeName="Details" cssClass="form-control search-input" id="searchText" />
<span class="search-icon-btn"></span>
</div>
<div class="order-label">Search Customers</div>
<oneit:ormInput obj="<%= searchHT %>" type="text" attributeName="Details" cssClass="form-control search-input" id="searchText" />
<span class="search-icon-btn"></span>
</div>
<div class="shorting-dropdown relative-parent">
<div class="order-label">Customer Status</div>
<oneit:ormEnum obj="<%= searchHT %>" attributeName="CompanyStatus" cssClass="form-control company-status"/>
</div>
<oneit:button value="Search" name="search" cssClass="btn btn-primary search-real-btn hidden" />
<oneit:button value=" " name="save" cssClass="btn save hidden" requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage).toMap() %>" id="save"/>
<div class="shorting-dropdown">
<span class="order-label">order by</span>
<select class="form-control" onChange="location=this.value">
......@@ -104,14 +137,24 @@
int openCount = openJobs != null ? openJobs.length : 0;
int clientCount = hiringTeam.pipelineHiringTeam().toClients().uniqueVals().size();
%>
<div class="client-list" id="<%= hiringTeam.getID() %>">
<div class="client-list">
<div class="client-row" >
<div class="client-name-cell jl-c" style="width:50%;">
<div class="client-name-cell jl-c" style="width:25%;">
<div class="client-name">
<oneit:toString value="<%= hiringTeam.getHiringTeamName() %>" mode="EscapeHTML" />
</div>
</div>
</div>
<div class="client-row company-details" >
<div class="client-name-cell jl-c" style="width:20%;">
<div class="client-name">
<%= hiringTeam.getCompany().getCompanyName() %>
<tagfile:popup actualJSP="<%= contextPath + "/extensions/performa/inc/changeCompanyPopup.jsp" %>" id="<%= hiringTeam.getID().toString() %>"
displayValue="..." cssClass="change-company-btn" bypassValidate="false"
procVars="<%= CollectionUtils.mapEntry("HiringTeam", hiringTeam).toMap() %>" width="800" height="450" popupAction="#save"/>
</div>
</div>
</div>
<div class="<%= "application-count jl-c " + (clientCount == 0 ? "opaque-jobcount" : "")%>">
<oneit:toString value="<%= clientCount %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Clients</span>
......@@ -124,17 +167,25 @@
<oneit:toString value="<%= filledCount %>" mode="EscapeHTML" nullValue="0"/>
<span class="grey-span">Jobs Filled</span>
</div>
<div class="application-count jl-c" style="width:20%;">
<oneit:button value="Login as Admin" name="assume" cssClass="btn btn-primary loginAsAdmin"
requestAttribs="<%= CollectionUtils.mapEntry("HiringTeam", hiringTeam)
.toMap()%>"/>
<div class="application-count jl-c" style="width:12%;">
<oneit:ormEnum obj="<%= hiringTeam %>" attributeName="HTStatus" cssClass="form-control htstatus"/>
</div>
<%
if(hiringTeam.getHTStatus() == HTStatus.ACTIVE && hiringTeam.getCompany().getCompanyStatus() == CompanyStatus.ACTIVE)
{
%>
<div class="application-count jl-c" style="width:13%;padding: 11px 6px 17px 20px;">
<oneit:button value="Login as Admin" name="assume" cssClass="btn btn-primary loginAsAdmin"
requestAttribs="<%= CollectionUtils.mapEntry("HiringTeam", hiringTeam)
.toMap()%>"/>
</div>
<%
}
%>
</div>
<%
}
%>
</div>
</div>
</oneit:dynIncluded>
\ No newline at end of file
<%@include file="/editor/footer.jsp"%>
\ No newline at end of file
......@@ -6,7 +6,8 @@
<oneit:dynIncluded>
<oneit:dynInclude page="/extensions/performa/customers.jsp" data="<%= CollectionUtils.EMPTY_MAP %>"/>
<%
response.sendRedirect(request.getContextPath() + "/extensions/performa/customers.jsp");
%>
</oneit:dynIncluded>
\ No newline at end of file
<%@ page extends="oneit.servlets.jsp.FormJSP" %>
<%@ include file="/setuprequest.jsp" %>
<%@ include file="stdimports.jsp" %>
<%@ include file="/editor/stdimports.jsp" %>
<%! protected String getName (ServletConfig config) { return "changeCompanyPopup_jsp"; } %>
<%
ORMProcessState process = (ORMProcessState) ProcessDecorator.getDefaultProcess(request);
ObjectTransaction objTran = process.getTransaction ();
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
hiringTeam.setCompanyStatus(hiringTeam.getCompany().getCompanyStatus());
request.setAttribute("oneit.pageFormDetails", CollectionUtils.mapEntry("name", "changeCompanyPopup").mapEntry("enctype", "multipart/form-data").toMap());
request.setAttribute("oneit.pageHeaderTitle", "Change Customer Popup");
%>
<%@include file="/editor/header.jsp" %>
<script type="text/javascript">
$(document).ready(function(){
setupRecalc ($("form"), {'recalcOnError':true});
});
</script>
<oneit:layout_total widths="<%= new double[] {4, 8} %>" skin="bootstrap">
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:label GUIName="Hiring Team" /></oneit:layout_label>
<oneit:layout_field width="1"><oneit:toString value="<%= hiringTeam.getHiringTeamName() %>" mode="EscapeHTML"/></oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:label GUIName="Customer Status" /></oneit:layout_label>
<oneit:layout_field width="1"><oneit:ormEnum obj="<%= hiringTeam %>" attributeName="CompanyStatus" cssClass="form-control"/></oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ExistingCustomer" value="true"/> Existing Customer
</oneit:layout_label>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:recalcClass htmlTag="span" classScript="hiringTeam.isTrue(hiringTeam.getExistingCustomer()) ? 'show col-xs-offset-1' : 'hide'" hiringTeam="<%= hiringTeam %>">
<oneit:layout_label width="1"><oneit:label GUIName="Customer" /></oneit:layout_label>
<oneit:layout_field width="1">
<tagfile:ormsingleasso_autocomplete obj="<%= hiringTeam %>" assocName="Company" cssClass="form-control" searcher="<%= CompanySearcher.INSTANCE %>" />
</oneit:layout_field>
</oneit:recalcClass>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1">
<oneit:ormInput obj="<%= hiringTeam %>" type="radio" attributeName="ExistingCustomer" value="false"/> New Customer
</oneit:layout_label>
</oneit:skin>
<oneit:recalcClass htmlTag="span" classScript="hiringTeam.isFalse(hiringTeam.getExistingCustomer()) ? 'show col-xs-offset-1' : 'hide'" hiringTeam="<%= hiringTeam %>">
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:label GUIName="Customer Name" /></oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormInput obj="<%= hiringTeam %>" type="text" attributeName="CompanyName" cssClass="form-control" />
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:label GUIName="Time Zone" /></oneit:layout_label>
<oneit:layout_field width="1">
<oneit:ormEnum obj="<%= hiringTeam %>" attributeName="CompanyTimeZone" cssClass="form-control"/>
</oneit:layout_field>
</oneit:skin>
<oneit:skin tagName="layout_row">
<oneit:layout_label width="1"><oneit:label GUIName="What type of hiring team are you?" /></oneit:layout_label>
</oneit:skin>
<%
FormTag jobForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = jobForm.getFormBuilder();
String optionKey = WebUtils.getInputKey(request, hiringTeam, HiringTeam.FIELD_CompanyType);
String formValue = formBuilder.fieldValue (optionKey, hiringTeam.getCompanyType() == null ? "" : hiringTeam.getCompanyType().getName());
for(HiringTeamType hiringTeamType : HiringTeamType.getHiringTeamTypeArray())
{
boolean isSelected = CollectionUtils.equals(formValue, hiringTeamType.getName());
String hiringTeamTypeId = String.valueOf(hiringTeam.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
%>
<oneit:skin tagName="layout_row">
<oneit:layout_field width="2">
<input type="radio" name="<%= optionKey %>" id="<%= hiringTeamTypeId %>" class="element_rating_radio" value="<%= hiringTeamType.getName() %>" <%= selected%>>
<label for="<%= hiringTeamTypeId %>">
<oneit:toString value="<%= hiringTeamType %>" mode="EscapeHTML"/>
</label>
</oneit:layout_field>
</oneit:skin>
<%
}
%>
</oneit:recalcClass>
<oneit:skin tagName="layout_row">
<oneit:layout_field width="2">
<oneit:button value="Save" cssClass="btn btn-primary pull-right" name="changeCompany"
requestAttribs="<%= CollectionUtils.mapEntry("HiringTeam", hiringTeam)
.toMap() %>"/>
</oneit:layout_field>
</oneit:skin>
</oneit:layout_total>
<%@include file="/editor/footer.jsp" %>
\ 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