1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.base.web;
17
18 import org.kuali.hr.time.service.base.TkServiceLocator;
19 import org.kuali.hr.time.util.TKContext;
20 import org.kuali.hr.time.util.TKUser;
21 import org.kuali.rice.core.api.config.property.ConfigContext;
22 import org.kuali.rice.kns.web.struts.form.KualiForm;
23
24 public class TkForm extends KualiForm {
25
26 private static final long serialVersionUID = -3945893347262537122L;
27
28 private String methodToCall;
29 private String principalId;
30 private String documentId;
31
32 public String getMethodToCall() {
33 return methodToCall;
34 }
35
36 public void setMethodToCall(String methodToCall) {
37 this.methodToCall = methodToCall;
38 }
39
40 public TKUser getUser() {
41 return TKContext.getUser();
42 }
43
44 public String getPrincipalId() {
45 return principalId;
46 }
47
48 public void setPrincipalId(String principalId) {
49 this.principalId = principalId;
50 }
51
52 public String getDocumentId() {
53 return documentId;
54 }
55
56 public void setDocumentId(String documentId) {
57 this.documentId = documentId;
58 }
59
60 public String getWorkflowUrl(){
61 return ConfigContext.getCurrentContextConfig().getProperty("workflow.url");
62 }
63
64 public String getDocumentIdFromContext(){
65 return TKContext.getCurrentTimesheetDocumentId();
66 }
67
68 public String getDocumentStatus() {
69 return TKContext.getCurrentTimesheetDocument().getDocumentHeader().getDocumentStatus();
70 }
71
72 public String getLeaveCalendarDocumentStatus() {
73 return TKContext.getCurrentLeaveCalendarDocument().getDocumentHeader().getDocumentStatus();
74 }
75
76 public boolean getLeaveEnabled() {
77 boolean canViewLeaveTab= false;
78 canViewLeaveTab = this.getViewLeaveTabsWithNEStatus() || TkServiceLocator.getPermissionsService().canViewLeaveTabsWithEStatus();
79 return canViewLeaveTab;
80 }
81
82 public boolean getTimeEnabled() {
83 return TkServiceLocator.getPermissionsService().canViewTimeTabs();
84 }
85
86 public String getLeaveDocumentIdFromContext(){
87 return TKContext.getCurrentLeaveCalendarDocumentId();
88 }
89
90 public boolean getViewLeaveTabsWithNEStatus() {
91 return TkServiceLocator.getPermissionsService().canViewLeaveTabsWithNEStatus();
92 }
93 }