From 5a2fc65e8dd49de14f51faa575c53e038e1f959b Mon Sep 17 00:00:00 2001 From: db483 Date: Tue, 20 Feb 2024 19:08:12 +0000 Subject: [PATCH] KFSPTS-30975 restrict who can edit the processor net id field (#1560) --- .../java/edu/cornell/kfs/module/purap/CUPurapConstants.java | 1 + .../authorization/IWantDocumentPresentationController.java | 2 ++ .../module/purap/document/web/struts/IWantDocumentForm.java | 6 ++++++ .../WEB-INF/tags/module/purap/iWantDocumentOverview.tag | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/cornell/kfs/module/purap/CUPurapConstants.java b/src/main/java/edu/cornell/kfs/module/purap/CUPurapConstants.java index 2bbb47eaf9..8c72f88b3a 100644 --- a/src/main/java/edu/cornell/kfs/module/purap/CUPurapConstants.java +++ b/src/main/java/edu/cornell/kfs/module/purap/CUPurapConstants.java @@ -125,6 +125,7 @@ public static final class IWantPresentationModes { //while also ensuring the existing functionality for all other edit modes was retained. public static final String I_WANT_DOC_MULTIPLE_PAGE_IS_ALLOWED = "multiplePageIsAllowed"; public static final String I_WANT_DOC_FULL_PAGE_IS_ALLOWED = "fullPageIsAllowed"; + public static final String I_WANT_DOC_EDIT_PROC_NET_ID = "editProcessorNetId"; public static final String IWNT_DOC_TYPE = "IWNT"; public static final String IWNT_STEP_PARAMETER = "step"; diff --git a/src/main/java/edu/cornell/kfs/module/purap/document/authorization/IWantDocumentPresentationController.java b/src/main/java/edu/cornell/kfs/module/purap/document/authorization/IWantDocumentPresentationController.java index 3dec3c7a55..abb7ad4360 100644 --- a/src/main/java/edu/cornell/kfs/module/purap/document/authorization/IWantDocumentPresentationController.java +++ b/src/main/java/edu/cornell/kfs/module/purap/document/authorization/IWantDocumentPresentationController.java @@ -143,6 +143,8 @@ public Set getEditModes(Document document) { editModes.add(CUPurapConstants.I_WANT_DOC_MULTIPLE_PAGE_IS_ALLOWED); editModes.add(CUPurapConstants.I_WANT_DOC_FULL_PAGE_IS_ALLOWED); } + + editModes.add(CUPurapConstants.I_WANT_DOC_EDIT_PROC_NET_ID); return editModes; } diff --git a/src/main/java/edu/cornell/kfs/module/purap/document/web/struts/IWantDocumentForm.java b/src/main/java/edu/cornell/kfs/module/purap/document/web/struts/IWantDocumentForm.java index c57dd0228e..a5b9eefd19 100644 --- a/src/main/java/edu/cornell/kfs/module/purap/document/web/struts/IWantDocumentForm.java +++ b/src/main/java/edu/cornell/kfs/module/purap/document/web/struts/IWantDocumentForm.java @@ -11,6 +11,7 @@ import org.kuali.kfs.sys.document.web.struts.FinancialSystemTransactionalDocumentFormBase; import org.kuali.kfs.core.api.config.property.ConfigContext; import org.kuali.kfs.core.api.util.KeyValue; +import org.kuali.kfs.kew.api.WorkflowDocument; import java.util.ArrayList; import java.util.HashMap; @@ -366,6 +367,11 @@ protected ExtraButton createCreateDVButton() { clearButton.setExtraButtonParams("_blank"); return clearButton; } + + public boolean isDocEnroute() { + final WorkflowDocument workflowDocument = getDocument().getDocumentHeader().getWorkflowDocument(); + return ObjectUtils.isNotNull(workflowDocument) && workflowDocument.isEnroute(); + } public String getPresentationMode() { return presentationMode; diff --git a/src/main/webapp/WEB-INF/tags/module/purap/iWantDocumentOverview.tag b/src/main/webapp/WEB-INF/tags/module/purap/iWantDocumentOverview.tag index e15d7edda9..bfb0cca197 100644 --- a/src/main/webapp/WEB-INF/tags/module/purap/iWantDocumentOverview.tag +++ b/src/main/webapp/WEB-INF/tags/module/purap/iWantDocumentOverview.tag @@ -5,6 +5,9 @@ + + +
@@ -92,7 +95,7 @@ universalId="" userNameFieldName="document.processorName" userName="${KualiForm.document.processorName}" - readOnly="${not fullEntryMode}" + readOnly="${processorNetIdReadOnly}" fieldConversions="principalName:document.processorNetId,name:document.processorName" hasErrors="${hasErrors}" onblur="loadProcessorInfo('document.processorNetId', 'document.processorName')"/>