Skip to content

Commit

Permalink
Merge pull request #1 from UW-Madison-DoIT/parameterize_earning_state…
Browse files Browse the repository at this point in the history
…ment_url

HRSPLT-137 : Move link to preference for payroll info
  • Loading branch information
vertein committed Mar 13, 2014
2 parents 454fc0b + 5d103ff commit 860b74e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class HrsControllerBase {
protected final Logger logger = LoggerFactory.getLogger(getClass());

private String notificationPreferences = "notification";
private String helpUrlPreferences = "helpUrl";
protected static final String helpUrlPreferences = "helpUrl";
private HrsUrlDao hrsUrlDao;


Expand All @@ -60,7 +60,7 @@ public void setHrsUrlDao(HrsUrlDao hrsUrlDao) {
@ModelAttribute("helpUrl")
public final String getNavLinks(PortletRequest request) {
final PortletPreferences preferences = request.getPreferences();
return preferences.getValue(this.helpUrlPreferences, "#");
return preferences.getValue(helpUrlPreferences, "#");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package edu.wisc.portlet.hrs.web.payroll;

import javax.portlet.PortletPreferences;
import javax.portlet.PortletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import edu.wisc.hr.dao.person.ContactInfoDao;
import edu.wisc.hr.dm.person.PersonInformation;

import org.jasig.springframework.security.portlet.authentication.PrimaryAttributeUtils;

import edu.wisc.portlet.hrs.web.HrsControllerBase;

/**
Expand All @@ -44,6 +48,17 @@ public class PayrollInformationController extends HrsControllerBase {
public void setContactInfoDao(ContactInfoDao contactInfoDao) {
this.contactInfoDao = contactInfoDao;
}

/**
* Gets the URL to a page describing your earning statement
* @param request the request
* @return the value of the portlet preference
*/
@ModelAttribute("understandingEarningUrl")
public final String getUnderstandingEarningUrl(PortletRequest request) {
final PortletPreferences preferences = request.getPreferences();
return preferences.getValue("understandingEarningUrl",null);
}

@RequestMapping
public String viewContactInfo(ModelMap model, PortletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@
</div>
<hrs:pagerNavBar position="bottom" />
</div>
<div class="dl-link">
<a href="https://uwservice.wisc.edu/hrs/earnings-statement.php" target="_blank">Understanding Your Earnings Statement</a>
</div>
<c:if test="${not empty understandingEarningUrl}">
<div class="dl-link">
<a href="${understandingEarningUrl}" target="_blank">Understanding Your Earnings Statement</a>
</div>
</c:if>
</div>
<div id="${n}dl-tax-statements" class="dl-tax-statements ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide">
<div class="tax-description">
Expand Down

0 comments on commit 860b74e

Please sign in to comment.