Commit 2865de91 by Nilu

S13012792 # Client - Incoming Issues (raised by Client) #No message = bad UX

parent 8992bf9b
......@@ -263,9 +263,22 @@ public class HiringTeam extends BaseHiringTeam
public boolean hasBillingSetup()
{
HiringTeam billingTeam = getManageOwnBilling() ? this : getBilledByTeam();
return billingTeam.getCardID() != null && billingTeam.getIsPPJ() != null &&
(billingTeam.getIsPPJ() || (!billingTeam.getIsPPJ() && billingTeam.getPaymentPlan() != null));
if(getManageOwnBilling())
{
return getCardID() != null && getIsPPJ() != null && (getIsPPJ() || (!getIsPPJ() && getPaymentPlan() != null));
}
return getBilledByTeam().hasBillingSetup();
}
// if has plan, checking whether cap is reached
public boolean allowJobCreation()
{
if(getManageOwnBilling())
{
return isTrue(isPPJ()) || ( isFalse(isPPJ()) && getPaymentPlan() != null && (getAvailableCredits() > getUsedCredits() || !getHasCap() || (getHasCap() && getMaxCap() > getUsedCredits())));
}
return getBilledByTeam().allowJobCreation();
}
}
\ No newline at end of file
......@@ -685,13 +685,6 @@ public class Utils
return colorCode == ColorCode.RED ? RingChart.RED : (colorCode == ColorCode.AMBER ? RingChart.AMBER : RingChart.GREEN);
}
public static boolean allowJobCreation(HiringTeam hiringTeam)
{
HiringTeam billingTeam = hiringTeam.getManageOwnBilling() ? hiringTeam : hiringTeam.getBilledByTeam();
return billingTeam.getCardID() != null && (billingTeam.isTrue(billingTeam.getIsPPJ()) || billingTeam.canCreateJob());
}
public static String getCurrencyFormat(HiringTeam hiringTeam)
{
CurrencyType currency = hiringTeam.getCountry().getCurrency();
......
......@@ -142,6 +142,10 @@
pointer: 'left:5'
});
});
function showReachedCap(){
$('#reachedCap').modal('show');
}
</script>
<div class="container-fluid">
......@@ -210,13 +214,14 @@
</div>
<div class="create-job-btn">
<%
if(selectedTeam != null)
if(selectedTeam != null && companyUser != null)
{
Article jobsArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.JOBS);
Article jobsArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.JOBS);
boolean onJob = WebUtils.onJobPages(renderMode);
boolean canCreateJob = Utils.allowJobCreation(selectedTeam);
boolean hasBillingSetup = selectedTeam.hasBillingSetup();
boolean canCreateJob = selectedTeam.allowJobCreation();
%>
<a href="<%= onJob || !canCreateJob ? "#" : jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) %>" class="<%= onJob || !canCreateJob ? "disabled" : ""%>" >Create Job</a>
<a href="<%= onJob || !canCreateJob ? "javascript:void(0);": jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) %>" class="<%= onJob || !hasBillingSetup ? "disabled" : ""%>" onclick="<%= canCreateJob ? "" : "showReachedCap()"%>">Create Job</a>
<%
}
%>
......@@ -226,6 +231,37 @@
</div>
</oneit:form>
</header>
<%
if(selectedTeam != null && companyUser != null)
{
%>
<div class="modal fade" id="reachedCap" role="dialog">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body main-welcome-popup">
<h2>Your account reached monthly cap!</h2>
<%
if(companyUser.getRoleForHiringTeam(selectedTeam) == RoleType.STANDARD)
{
%>
<p>Your account has reached the monthly cap for number of jobs, contact your Administrator to have the Cap increased.</p>
<%
}
else
{
%>
<p>Your account has reached the monthly cap for number of jobs. Please make a request by contacting us to make changes.</p>
<div class="create-y-f-job">
<a href=" https://www.talentology.com/support/" target="_blank">Make a Request</a>
</div>
<%
}
%>
</div>
</div>
</div>
<%
}
%>
<script type="text/javascript">
$(document).ready(function()
......
......@@ -75,7 +75,8 @@
String homePage = WebUtils.getSamePageInRenderMode(request, "Page");
String jobsPage = jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap());
boolean firstTime = request.getParameter("firstTime") != null ? Boolean.parseBoolean(request.getParameter("firstTime")) : false;
boolean canCreateJob = Utils.allowJobCreation(hiringTeam);
boolean hasBillingSetup = hiringTeam.hasBillingSetup();
boolean canCreateJob = hiringTeam.allowJobCreation();
%>
......@@ -117,7 +118,7 @@
<div class="welcome-box">
<div class="dashboard-welcome">
<div class="welcome-text"> Welcome <br/> <%= firstTime ? "" : "back"%> <oneit:toString value="<%= secUser.getFirstName()!=null ? secUser.getFirstName() : secUser.getUserName()%>" mode="EscapeHTML"/>!</div>
<a class="d-create-job-btn <%= canCreateJob ? "" : "disabled"%>" href="<%= canCreateJob ? jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) : "#" %>">Create a Job</a>
<a class="d-create-job-btn <%= hasBillingSetup ? "" : "disabled"%>" href="<%= canCreateJob ? jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) : "javascript:void(0);" %>" onclick="<%= canCreateJob ? "" : "showReachedCap()"%>">Create a Job</a>
</div>
<div class="col-sm-3 col-xs-12 d-three-box green-light">
<div class="d-fl-left eq-height">
......
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