1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.authorization;
17
18 import org.kuali.ole.module.purap.PurapAuthorizationConstants;
19 import org.kuali.ole.module.purap.PurapConstants.PurchaseOrderStatuses;
20 import org.kuali.ole.module.purap.document.PurchaseOrderDocument;
21 import org.kuali.ole.module.purap.document.PurchaseOrderRetransmitDocument;
22 import org.kuali.rice.krad.document.Document;
23
24 import java.util.Set;
25
26
27 public class PurchaseOrderRetransmitDocumentPresentationController extends PurchaseOrderDocumentPresentationController {
28
29 @Override
30 public boolean canSave(Document document) {
31 return false;
32 }
33
34 @Override
35 public Set<String> getEditModes(Document document) {
36 Set<String> editModes = super.getEditModes(document);
37 PurchaseOrderRetransmitDocument poDocument = (PurchaseOrderRetransmitDocument) document;
38 if (poDocument.isShouldDisplayRetransmitTab()) {
39 editModes.add(PurapAuthorizationConstants.PurchaseOrderEditMode.DISPLAY_RETRANSMIT_TAB);
40 }
41 return editModes;
42 }
43
44
45 @Override
46 protected boolean canPreviewPrintPo(PurchaseOrderDocument poDocument) {
47 boolean canPreviewPrintPo = super.canPreviewPrintPo(poDocument);
48 if (canPreviewPrintPo) {
49 return !(poDocument.getDocumentHeader().getWorkflowDocument().isEnroute() && PurchaseOrderStatuses.APPDOC_CHANGE_IN_PROCESS
50 .equals(poDocument.getApplicationDocumentStatus()));
51 }
52 return canPreviewPrintPo;
53 }
54 }