Commit 14677235 by Jay

S21287677 # Client - Incoming Issues (raised by Client) #Warning if no HT Logo

parent 7832447f
...@@ -3,19 +3,23 @@ package performa.form; ...@@ -3,19 +3,23 @@ package performa.form;
import com.stripe.model.Subscription; import com.stripe.model.Subscription;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import oneit.business.content.Article;
import oneit.logging.LogLevel; import oneit.logging.LogLevel;
import oneit.logging.LogMgr; import oneit.logging.LogMgr;
import oneit.net.LoopbackHTTP;
import oneit.objstore.StorageException; import oneit.objstore.StorageException;
import oneit.objstore.parser.BusinessObjectParser; import oneit.objstore.parser.BusinessObjectParser;
import oneit.servlets.forms.SubmissionDetails; import oneit.servlets.forms.SubmissionDetails;
import oneit.servlets.forms.SuccessfulResult; import oneit.servlets.forms.SuccessfulResult;
import oneit.servlets.process.ORMProcessState; import oneit.servlets.process.ORMProcessState;
import oneit.servlets.process.ProcessRedirectResult;
import oneit.servlets.process.SaveFP; import oneit.servlets.process.SaveFP;
import oneit.utils.BusinessException; import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils; import oneit.utils.CollectionUtils;
import oneit.utils.MultiException; import oneit.utils.MultiException;
import performa.orm.HiringTeam; import performa.orm.HiringTeam;
import performa.utils.StripeUtils; import performa.utils.StripeUtils;
import performa.utils.WebUtils;
public class SaveCompanyFP extends SaveFP public class SaveCompanyFP extends SaveFP
...@@ -27,6 +31,13 @@ public class SaveCompanyFP extends SaveFP ...@@ -27,6 +31,13 @@ public class SaveCompanyFP extends SaveFP
HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam"); HiringTeam hiringTeam = (HiringTeam) process.getAttribute("HiringTeam");
Boolean isPayment = (Boolean) request.getAttribute("IsPayment"); Boolean isPayment = (Boolean) request.getAttribute("IsPayment");
Subscription subscription = StripeUtils.retrieveSubscription(hiringTeam.getStripeSubscription()); Subscription subscription = StripeUtils.retrieveSubscription(hiringTeam.getStripeSubscription());
Boolean isHTLogoPresent = process.getAttribute("IsHTLogoPresent") != null ? (Boolean) process.getAttribute("IsHTLogoPresent") : Boolean.FALSE;
// String nextPage = (String)request.getAttribute("nextPage");
Article article = WebUtils.getArticleByShortCut(process.getTransaction(), WebUtils.MY_COMPANY);
String hiringPage = LoopbackHTTP.getRemoteAccessURL(request)
+ article.getLink(request, CollectionUtils.mapEntry("cms.rm", "HiringTeam").toMap(), "/");
String nextPage = LoopbackHTTP.getRemoteAccessURL(request)
+ article.getLink(request, CollectionUtils.mapEntry("cms.rm", "Page").toMap(), "/");
if(CollectionUtils.equals(hiringTeam.getIsLogoDeleted(), Boolean.TRUE)) if(CollectionUtils.equals(hiringTeam.getIsLogoDeleted(), Boolean.TRUE))
{ {
...@@ -62,6 +73,18 @@ public class SaveCompanyFP extends SaveFP ...@@ -62,6 +73,18 @@ public class SaveCompanyFP extends SaveFP
} }
} }
//Set attribute IsHTLogoPresent false when HT logo is not uploaded or deleted
if(hiringTeam.getHiringTeamLogo() == null && !isHTLogoPresent)
{
process.setAttribute("IsHTLogoPresent", Boolean.FALSE);
return new ProcessRedirectResult(hiringPage, new String[]{});
}
process.setAttribute("nextPage", nextPage);
process.setAttribute("HiringTeam", hiringTeam);
return super.processForm(process, submission, params); return super.processForm(process, submission, params);
} }
......
...@@ -112,6 +112,26 @@ ...@@ -112,6 +112,26 @@
<oneit:script> <oneit:script>
<oneit:script src="/scripts/google_address.js"/> <oneit:script src="/scripts/google_address.js"/>
</oneit:script> </oneit:script>
<style>
#overlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 99999;
cursor: pointer;
}
.welcome-pop-top {
margin-top: 20%;
}
.main-welcome-popup h2 {
padding: 0 20px 0;
}
</style>
<div class="container-fluid"> <div class="container-fluid">
<div class="row content"> <div class="row content">
<div class="main-content-area"> <div class="main-content-area">
...@@ -177,6 +197,37 @@ ...@@ -177,6 +197,37 @@
</span> </span>
<% <%
} }
// if(hiringTeam.getHiringTeamLogo() == null)
// {
// nextPage = WebUtils.getSamePageInRenderMode(request, "HiringTeam");
// }
Boolean isHTLogoPresent = (Boolean)process.getAttribute("IsHTLogoPresent");
if(isHTLogoPresent != null && isHTLogoPresent == Boolean.FALSE)
{
process.setAttribute("IsHTLogoPresent",Boolean.TRUE);
%>
<div id="overlay">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body main-welcome-popup">
<h2>The HT Logo is missing!</h2>
<div class="create-y-f-job">
<oneit:button value="Ok" name="saveCompany" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", WebUtils.getSamePageInRenderMode(request, "Page"))
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", hiringTeam).mapEntry("IsHTLogoPresent",Boolean.TRUE).toMap())
.mapEntry("Company", company)
.toMap() %>">
</oneit:button>
</div>
</div>
</div>
</div>
<%
}
%> %>
</div> </div>
</div> </div>
......
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