Commit c4cd5585 by chenith

Remaining job count displayed in Job review.

parent daaf829c
...@@ -147,14 +147,33 @@ public class Company extends BaseCompany ...@@ -147,14 +147,33 @@ public class Company extends BaseCompany
public boolean canCreateJob() public boolean canCreateJob()
{ {
Job[] openJobs = Job.SearchByCompany().andJobStatus(new EqualsFilter<>(JobStatus.OPEN)) Job[] openJobs = getOpenJobs();
.byCompany(this)
.search(getTransaction());
return getPaymentPlan() != null && getPaymentPlan().getActiveJobCount() > openJobs.length; return getPaymentPlan() != null && getPaymentPlan().getActiveJobCount() > openJobs.length;
} }
public Job[] getOpenJobs()
{
return Job.SearchByCompany()
.andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
.byCompany(this)
.search(getTransaction());
}
public Integer getOpenJobsCount()
{
return getOpenJobs().length;
}
public Card getCard() throws FieldException
{
return StripeUtils.retrieveCard(this);
}
public String getCardNumber() throws FieldException public String getCardNumber() throws FieldException
{ {
if(getStripeLast4() == null) if(getStripeLast4() == null)
......
...@@ -1159,6 +1159,7 @@ span.skill-label span{ ...@@ -1159,6 +1159,7 @@ span.skill-label span{
font-size: 16px; font-size: 16px;
top: -2px; top: -2px;
position: relative; position: relative;
padding-top: 12px;
} }
.plan-link a { .plan-link a {
text-decoration: underline; text-decoration: underline;
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
process.setAttribute("Job", job); process.setAttribute("Job", job);
} }
CompanyUser companyUser = job.getCompanyUser();
Company company = companyUser.getCompany();
Debug.assertion(job != null, "Job is null in admin portal create job"); Debug.assertion(job != null, "Job is null in admin portal create job");
%> %>
...@@ -29,11 +32,27 @@ ...@@ -29,11 +32,27 @@
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<h1 class="page-title">Review Job</h1>
<!-- <div class="page-subtitle-"> <h1 class="page-title">Review Job
<span class="pull-right plan-link"> Post multiple jobs per month? <a href="#">See our plans</a></span> <%
</div>--> if(company.getPaymentPlan()!=null)
{
Integer activeCount = company.getOpenJobsCount();
Integer totCount = company.getPaymentPlan().getActiveJobCount();
Integer remCount = (totCount - activeCount) > 0 ? (totCount - activeCount) : 0;
%>
<div style="float:right;">
<span class="pull-right plan-link">
<oneit:toString value="<%= remCount %>" mode="EscapeHTML" />
/
<oneit:toString value="<%= totCount %>" mode="EscapeHTML" />
&nbsp;Jobs remaining this month
</span>
</div>
<%
}
%>
</h1>
<oneit:dynInclude page="/extensions/adminportal/inc/job_main_tabs.jsp" PageNumber="5" data="<%= CollectionUtils.EMPTY_MAP%>"/> <oneit:dynInclude page="/extensions/adminportal/inc/job_main_tabs.jsp" PageNumber="5" data="<%= CollectionUtils.EMPTY_MAP%>"/>
...@@ -73,11 +92,11 @@ ...@@ -73,11 +92,11 @@
</div> </div>
</div> </div>
<% <%
SecUser txUser = SecUser.getTXUser(process.getTransaction()); // SecUser txUser = SecUser.getTXUser(process.getTransaction());
CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser); // CompanyUser companyUser = txUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
Company company = companyUser.getCompany(); // Company company = companyUser.getCompany();
if(companyUser.getCompany().showHasClientSupport()) if(company.showHasClientSupport())
{ {
%> %>
<div class="row main-review-label"> <div class="row main-review-label">
......
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