1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.authorization;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.ole.sys.OLEConstants;
20 import org.kuali.ole.sys.businessobject.FinancialSystemDocumentHeader;
21 import org.kuali.ole.sys.document.authorization.AccountingDocumentPresentationControllerBase;
22 import org.kuali.rice.kew.api.WorkflowDocument;
23 import org.kuali.rice.krad.document.Document;
24
25 public class ProcurementCardDocumentPresentationController extends AccountingDocumentPresentationControllerBase {
26
27
28
29
30 @Override
31 public boolean canCancel(Document document) {
32 return false;
33 }
34
35
36
37
38 @Override
39 public boolean canCopy(Document document) {
40 return false;
41 }
42
43
44
45
46 @Override
47 public boolean canDisapprove(Document document) {
48 return false;
49 }
50
51
52
53
54 @Override
55 public boolean canEdit(Document document) {
56 WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
57
58 boolean canRouteReviewFullEdit = false;
59 for (String routeNode : workflowDocument.getCurrentNodeNames() ) {
60 if ( StringUtils.equalsIgnoreCase(routeNode, OLEConstants.RouteLevelNames.ACCOUNT_REVIEW_FULL_EDIT ) ) {
61 canRouteReviewFullEdit = true;
62 break;
63 }
64 }
65
66
67
68 if (canRouteReviewFullEdit
69 && (((FinancialSystemDocumentHeader) document.getDocumentHeader()).getFinancialDocumentInErrorNumber() == null)
70 && workflowDocument.isApprovalRequested()
71 && !workflowDocument.isAcknowledgeRequested()) {
72 return true;
73 }
74
75 return super.canEdit(document);
76 }
77 }