Skip to content

Commit

Permalink
KFSPTS-32444 Fix editing of IWNT Proc Assistant NetID (#1640)
Browse files Browse the repository at this point in the history
  • Loading branch information
cah292 committed Aug 26, 2024
1 parent 667c56a commit ca24356
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public Set<String> getEditModes(Document document, Person user, Set<String> edit
result.remove(CUPurapConstants.IWNT_DOC_RETURN_TO_SSC);
}

if (!canEditProcurementAssistantNetId(user)) {
result.remove(CUPurapConstants.I_WANT_DOC_EDIT_PROCUREMENT_ASSISTANT_NET_ID);
}

return result;
}

Expand Down Expand Up @@ -209,6 +213,10 @@ private boolean isInProcurementAssistantNode(Document document) {
return false;
}

private boolean canEditProcurementAssistantNetId(Person currentUser) {
return isCurrentUserProcurementContractAssistant(currentUser);
}

private boolean isCurrentUserInRole(String namespace, String roleName, Person currentUser) {
List<String> roleIds = new ArrayList<String>();
roleIds.add(getRoleService().getRoleIdByNamespaceCodeAndName(namespace, roleName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.kuali.kfs.sys.service.impl.KfsParameterConstants;

import edu.cornell.kfs.module.purap.CUPurapConstants;
import edu.cornell.kfs.module.purap.CUPurapConstants.IWantRouteNodes;
import edu.cornell.kfs.module.purap.CUPurapParameterConstants;
import edu.cornell.kfs.module.purap.document.IWantDocument;
import edu.cornell.kfs.sys.CUKFSConstants;
Expand Down Expand Up @@ -148,13 +149,15 @@ public Set<String> getEditModes(Document document) {
}

editModes.add(CUPurapConstants.I_WANT_DOC_EDIT_PROC_NET_ID);
editModes.add(CUPurapConstants.I_WANT_DOC_EDIT_PROCUREMENT_ASSISTANT_NET_ID);
editModes.add(CUPurapConstants.IWNT_DOC_DISPLAY_NOTE_OPTIONS);

if (isContractFunctionalityEnabled()) {
editModes.add(CUPurapConstants.IWNT_DOC_DISPLAY_CONTRACT_TAB);
editModes.add(CUPurapConstants.IWNT_DOC_EDIT_CONTRACT_INDICATOR);

if (workflowDocument.isEnroute() && workflowDocument.getCurrentNodeNames().contains(
IWantRouteNodes.PROCUREMENT_CONTRACT_ASSISTANT)) {
editModes.add(CUPurapConstants.I_WANT_DOC_EDIT_PROCUREMENT_ASSISTANT_NET_ID);
}
}

return editModes;
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/tags/module/purap/iWantContract.tag
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<c:set var="displayContractTab" value="${(not empty KualiForm.editingMode['displayContractTab'])}" scope="request"/>
<c:set var="contractIndicatorReadOnly" value="${(empty KualiForm.editingMode['editContractIndicator'])}" scope="request"/>
<c:set var="docEnroute" value="${KualiForm.docEnroute}"/>
<c:set var="canEditProcessingAssistantNetId" value="${(not empty KualiForm.editingMode['editProcurementAssistantNetId'])}" scope="request"/>
<c:set var="procurementAssistantNetIdReadOnly" value="${!fullEntryMode || !canEditProcessingAssistantNetId || !docEnroute}" scope="request"/>
<c:set var="canEditProcurementAssistantNetId" value="${(not empty KualiForm.editingMode['editProcurementAssistantNetId'])}" scope="request"/>
<c:set var="procurementAssistantNetIdReadOnly" value="${!fullEntryMode || !canEditProcurementAssistantNetId || !docEnroute}" scope="request"/>

<c:if test="${displayContractTab}">
<kul:tab tabTitle="Jaggaer Contract" defaultOpen="true">
Expand Down

0 comments on commit ca24356

Please sign in to comment.