1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.web;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.kpme.core.service.HrServiceLocator;
20 import org.kuali.rice.core.api.config.property.ConfigContext;
21 import org.kuali.rice.kew.api.KewApiServiceLocator;
22 import org.kuali.rice.kns.web.struts.form.KualiForm;
23
24 public class KPMEForm 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 String getPrincipalId() {
41 return principalId;
42 }
43
44 public void setPrincipalId(String principalId) {
45 this.principalId = principalId;
46 }
47
48 public String getDocumentId() {
49 return documentId;
50 }
51
52 public void setDocumentId(String documentId) {
53 this.documentId = documentId;
54 }
55
56 public String getWorkflowUrl(){
57 return ConfigContext.getCurrentContextConfig().getProperty("workflow.url");
58 }
59
60 public String getDocumentStatus() {
61 String documentStatus = StringUtils.EMPTY;
62
63 if (StringUtils.isNotBlank(getDocumentId())) {
64 documentStatus = KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(getDocumentId()).getLabel();
65 }
66
67 return documentStatus;
68 }
69
70 public boolean isTimeEnabled() {
71 return HrServiceLocator.getHRPermissionService().canViewTimeTabs();
72 }
73
74 public boolean isLeaveEnabled() {
75 return HrServiceLocator.getHRPermissionService().canViewLeaveTabsWithNEStatus()
76 || HrServiceLocator.getHRPermissionService().canViewLeaveTabsWithEStatus();
77 }
78
79 public boolean isEdossirEnabled() {
80 return HrServiceLocator.getHRPermissionService().canViewEdossierTabs();
81 }
82 }