1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.web;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.kuali.rice.kim.api.KimConstants;
23 import org.kuali.rice.kim.api.identity.Person;
24 import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm;
25 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
26 import org.kuali.rice.krad.service.ModuleService;
27
28
29
30
31
32 public class TimeMaintenanceForm extends KualiMaintenanceForm {
33
34
35
36
37 private static final long serialVersionUID = 1L;
38
39
40
41
42 @Override
43 protected String getPersonInquiryUrlLink(Person user, String linkBody) {
44 StringBuffer urlBuffer = new StringBuffer();
45
46 if(user != null && StringUtils.isNotEmpty(linkBody) ) {
47 ModuleService moduleService = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(Person.class);
48 Map<String, String[]> parameters = new HashMap<String, String[]>();
49 parameters.put(KimConstants.AttributeConstants.PRINCIPAL_ID, new String[] { user.getPrincipalId() });
50 String inquiryUrl = moduleService.getExternalizableBusinessObjectInquiryUrl(Person.class, parameters);
51 if(!StringUtils.equals(KimConstants.EntityTypes.SYSTEM, user.getEntityTypeCode())){
52 urlBuffer.append("<a href='");
53 urlBuffer.append(inquiryUrl);
54 urlBuffer.append("' ");
55 urlBuffer.append("target='_blank'");
56 urlBuffer.append("title='Person Inquiry'>");
57 urlBuffer.append(linkBody);
58 urlBuffer.append("</a>");
59
60
61 urlBuffer.append(" (");
62 urlBuffer.append(user.getName());
63 urlBuffer.append(")");
64 } else{
65 urlBuffer.append(linkBody);
66 }
67 }
68
69 return urlBuffer.toString();
70 }
71
72 }