Skip to content

Commit

Permalink
KFSPTS-30975 restrict who can edit the processor net id field (#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
db483 authored and cah292 committed Feb 21, 2024
1 parent fda8fd2 commit 5a2fc65
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public Set<String> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<c:set var="docHeaderAttributes" value="${DataDictionary.DocumentHeader.attributes}"/>
<c:set var="iWantDocAttributes" value="${DataDictionary.IWantDocument.attributes}"/>
<c:set var="fullEntryMode" value="${KualiForm.documentActions[KRADConstants.KUALI_ACTION_CAN_EDIT]}"/>
<c:set var="canEditProcessorNetId" value="${(not empty KualiForm.editingMode['editProcessorNetId'])}" scope="request"/>
<c:set var="docEnroute" value="${KualiForm.docEnroute}"/>
<c:set var="processorNetIdReadOnly" value="${!fullEntryMode || !canEditProcessorNetId || !docEnroute}" scope="request"/>

<div class="tab-container" align="center">
<html:hidden property="document.documentHeader.documentNumber"/>
Expand Down Expand Up @@ -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')"/>
Expand Down

0 comments on commit 5a2fc65

Please sign in to comment.