Skip to content

Commit

Permalink
SAK-30715: Use mail.support for boxes 2 and 3 if technicalAddress not…
Browse files Browse the repository at this point in the history
… set (sakaiproject#2220)

SAK-30715: Use constant for hard coded string

SAK-30715: Default value for MAIL.SUPPORT
  • Loading branch information
nicholaswilson100 authored and ottenhoff committed Jun 2, 2016
1 parent aa537d6 commit 8c99f7e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
siteEmail = site.getProperties().getProperty(Site.PROP_SITE_CONTACT_EMAIL);
}

String mailSupport = sakaiProxy.getConfigString(Constants.MAIL_SUPPORT, "support@"+ sakaiProxy.getServerName());
if (siteEmail!=null && !siteEmail.isEmpty() && siteExists){
contactName = site.getProperties().getProperty(Site.PROP_SITE_CONTACT_NAME);
}
Expand All @@ -245,6 +246,7 @@ else if (!hasViewPermission){
contactName = String.format("%s <%s>" ,serviceContactName, serviceContactEmail);
}
setStringAttribute(request, "contactName", contactName);
setStringAttribute(request, "mailSupport", mailSupport);

response.setContentType("text/html");
request.getRequestDispatcher("/WEB-INF/bootstrap.jsp").include(request, response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ private String getToAddress(String type, String siteId) {
toAddress = sakaiProxy.getConfigString(Constants.PROP_SUPPLEMENTAL_B_ADDRESS, null);
} else {
toAddress = sakaiProxy.getConfigString(Constants.PROP_TECHNICAL_ADDRESS, null);
if (toAddress==null){
toAddress = sakaiProxy.getConfigString(Constants.MAIL_SUPPORT, null);
}
}
return toAddress;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class Constants {
public final static String SUPPLEMENTAL_B = "supplementalb";

public final static String PROP_TECHNICAL_ADDRESS = "feedback.technicalAddress";
public final static String MAIL_SUPPORT = "mail.support";
public final static String PROP_HELP_ADDRESS = "feedback.helpAddress";
public final static String PROP_SUGGESTIONS_ADDRESS = "feedback.suggestionsAddress";
public final static String PROP_SUPPLEMENTAL_A_ADDRESS = "feedback.supplementalAAddress";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,8 @@ public int getAttachmentLimit() {
public Locale getLocale() {
return rb.getLocale();
}

public String getServerName() {
return serverConfigurationService.getServerName();
}
}
1 change: 1 addition & 0 deletions feedback/src/webapp/WEB-INF/bootstrap.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
maxAttachmentsMB: ${maxAttachmentsMB},
showContentPanel: ${showContentPanel},
showHelpPanel: ${showHelpPanel},
mailSupport: '${mailSupport}',
showTechnicalPanel: ${showTechnicalPanel},
showSuggestionsPanel: ${showSuggestionsPanel},
showSupplementalAPanel: ${showSupplementalAPanel},
Expand Down
22 changes: 22 additions & 0 deletions feedback/src/webapp/WEB-INF/templates/home.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@

{{#if showHelpPanel}}
<div class="feedback-box" id="feedback-ask-help">
<h3>{{translate 'ask_title'}}</h3>
<ul>{{translate 'ask_explanation'}}</ul>
{{#if enableTechnical}}
<p><a id="feedback-report-helpdesk-link" href="javascript:;">{{translate 'technical_link'}}</a></p>
{{else}}
{{#if mailSupport}}
<p><a id="feedback-report-helpdesk-link" href="javascript:;">{{translate 'technical_link'}}</a></p>
{{else}}
<p class='information'>{{translate 'no_technical_address'}}</p>
{{/if}}
{{/if}}
<div class="feedback-box-header">
<span class="fa fa-fw {{translate 'ask_icon_no_translate'}}" aria-hidden="true"></span>
<h3>{{translate 'ask_title'}}</h3>
Expand All @@ -68,6 +79,17 @@

{{#if showTechnicalPanel}}
<div class="feedback-box" id="feedback-tech-problem">
<h3>{{translate 'technical_title'}}</h3>
<ul>{{translate 'technical_explanation'}}</ul>
{{#if enableTechnical}}
<p><a id="feedback-report-technical-link" href="javascript:;">{{translate 'technical_link'}}</a></p>
{{else}}
{{#if mailSupport}}
<p><a id="feedback-report-technical-link" href="javascript:;">{{translate 'technical_link'}}</a></p>
{{else}}
<p class='information'>{{translate 'no_technical_address'}}</p>
{{/if}}
{{/if}}
<div class="feedback-box-header">
<span class="fa fa-fw {{translate 'technical_icon_no_translate'}}" aria-hidden="true"></span>
<h3>{{translate 'technical_title'}}</h3>
Expand Down
3 changes: 2 additions & 1 deletion feedback/src/webapp/js/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
supplementaryInfo: feedback.supplementaryInfo,
helpPagesUrl: feedback.helpPagesUrl,
helpPagesTarget: feedback.helpPagesTarget,
mailSupport: feedback.mailSupport,
loggedIn: loggedIn, showContentPanel : feedback.showContentPanel,
showHelpPanel : feedback.showHelpPanel,
showTechnicalPanel : feedback.showTechnicalPanel,
Expand Down Expand Up @@ -123,7 +124,7 @@
});
}

if (feedback.supplementaryInfo.length > 0) {
if (feedback.supplementaryInfo.length == 0 && feedback.mailSupport==null) {
$('#feedback-supplementary-info').show();
}

Expand Down

0 comments on commit 8c99f7e

Please sign in to comment.