1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.workschedule.service;
17
18 import java.util.List;
19
20 import org.kuali.hr.time.util.TKContext;
21 import org.kuali.hr.time.workschedule.WorkSchedule;
22 import org.kuali.rice.kns.lookup.HtmlData;
23 import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl;
24 import org.kuali.rice.krad.bo.BusinessObject;
25
26 public class WorkScheduleLookupableHelper extends
27 KualiLookupableHelperServiceImpl {
28
29
30
31 private static final long serialVersionUID = 1L;
32
33 @Override
34 public List<HtmlData> getCustomActionUrls(BusinessObject businessObject,
35 List pkNames) {
36 List<HtmlData> customActionUrls = super.getCustomActionUrls(
37 businessObject, pkNames);
38 if (TKContext.getUser().isSystemAdmin() || TKContext.getUser().isGlobalViewOnly()) {
39 WorkSchedule workSchedule = (WorkSchedule) businessObject;
40 final String className = this.getBusinessObjectClass().getName();
41 final Long hrWorkScheduleId = workSchedule.getHrWorkSchedule();
42 HtmlData htmlData = new HtmlData() {
43
44 @Override
45 public String constructCompleteHtmlTag() {
46 return "<a target=\"_blank\" href=\"inquiry.do?businessObjectClassName="
47 + className
48 + "&methodToCall=start&hrWorkScheduleId="
49 + hrWorkScheduleId + "\">view</a>";
50 }
51 };
52 customActionUrls.add(htmlData);
53 } else if (customActionUrls.size() != 0) {
54 customActionUrls.remove(0);
55 }
56 return customActionUrls;
57 }
58
59 }