use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class PurchasingAccountsPayableDocumentPresentationController method canEdit.
/**
* None of the PURAP documents allowing editing by adhoc requests
*
* @see org.kuali.kfs.krad.document.authorization.DocumentPresentationControllerBase#canEdit(org.kuali.kfs.krad.document.Document)
*/
@Override
public boolean canEdit(Document document) {
Person currentUser = GlobalVariables.getUserSession().getPerson();
WorkflowDocument kwf = document.getDocumentHeader().getWorkflowDocument();
// Adding this check so that the initiator will always be able to edit the document (before initial submission)
if (kwf.getInitiatorPrincipalId().equals(currentUser.getPrincipalId()) && (kwf.isInitiated() || kwf.isSaved())) {
return true;
}
if (!document.getDocumentHeader().getWorkflowDocument().isCompletionRequested() && SpringContext.getBean(FinancialSystemWorkflowHelperService.class).isAdhocApprovalRequestedForPrincipal(document.getDocumentHeader().getWorkflowDocument(), GlobalVariables.getUserSession().getPrincipalId())) {
return false;
}
return super.canEdit(document);
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CheckReconciliationMaintainableImpl method doRouteStatusChange.
/**
* @see org.kuali.kfs.kns.maintenance.KualiMaintainableImpl#doRouteStatusChange(org.kuali.kfs.kns.bo.DocumentHeader)
*/
public void doRouteStatusChange(DocumentHeader documentHeader) {
WorkflowDocument workflowDocument = documentHeader.getWorkflowDocument();
if (workflowDocument.isProcessed() && !KFSConstants.MAINTENANCE_NEW_ACTION.equalsIgnoreCase(getMaintenanceAction())) {
DocumentService documentService = SpringContext.getBean(DocumentService.class);
MaintenanceDocument document;
try {
document = (MaintenanceDocument) documentService.getByDocumentHeaderId(documentHeader.getDocumentNumber());
CheckReconciliation oldCr = (CheckReconciliation) document.getOldMaintainableObject().getBusinessObject();
CheckReconciliation newCr = (CheckReconciliation) document.getNewMaintainableObject().getBusinessObject();
if (ObjectUtils.isNotNull(oldCr) && !oldCr.getStatus().equalsIgnoreCase(newCr.getStatus())) {
Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
newCr.setStatusChangeDate(currentDate);
// KFSUPGRADE-377
if (CRConstants.CANCELLED.equalsIgnoreCase(newCr.getStatus())) {
newCr.setCancelDocHdrId(documentHeader.getDocumentNumber());
}
}
} catch (WorkflowException e) {
throw new RuntimeCacheException(e);
}
}
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuAdvanceDepositAccountingLineAuthorizer method isDocumentStoppedInRouteNode.
/**
* Determines if document is in org review node for approval.
*
* @param nodeName
* @param accountingDocument
* @return true if in org review node for approval, false otherwise
*/
public boolean isDocumentStoppedInRouteNode(String nodeName, AccountingDocument accountingDocument) {
WorkflowDocument workflowDoc = accountingDocument.getDocumentHeader().getWorkflowDocument();
Set<String> currentRouteLevels = accountingDocument.getDocumentHeader().getWorkflowDocument().getCurrentNodeNames();
if (currentRouteLevels.contains(nodeName) && workflowDoc.isApprovalRequested()) {
return true;
}
return false;
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuAdvanceDepositDocumentPresentationController method getEditModes.
@Override
public Set<String> getEditModes(Document document) {
Set<String> editModes = super.getEditModes(document);
if (document instanceof AmountTotaling) {
editModes.add(KFSConstants.AMOUNT_TOTALING_EDITING_MODE);
}
editModes.add(KFSConstants.BANK_ENTRY_VIEWABLE_EDITING_MODE);
AccountingDocument accountingDocument = (AccountingDocument) document;
WorkflowDocument workflowDocument = accountingDocument.getDocumentHeader().getWorkflowDocument();
if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
editModes.add(CUKFSAuthorizationConstants.AdvanceDepositEditMode.EDITABLE_ADVANCE_DEPOSITS);
}
return editModes;
}
use of org.kuali.rice.kew.api.WorkflowDocument in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDocumentPresentationController method addTravelSystemGeneratedEntryMode.
/**
* If the DV was generated from a connection with the Cornell Travel System, enforces special edit rules regarding information on the disbursement voucher.
*
* Added condition that DV is not in the Payment Method Reviewers' queue, as the check amount needs to be editable for that circustance.
*
* @param document the disbursement voucher document authorization is being sought on
* @param editModes the edit modes so far, which can be added to
*/
protected void addTravelSystemGeneratedEntryMode(Document document, Set<String> editModes) {
final CuDisbursementVoucherDocument dvDocument = (CuDisbursementVoucherDocument) document;
final WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
final Set<String> currentRouteLevels = workflowDocument.getCurrentNodeNames();
boolean isAssociatedWithTrip = SpringContext.getBean(CULegacyTravelService.class).isCULegacyTravelIntegrationInterfaceAssociatedWithTrip(dvDocument);
if (isAssociatedWithTrip && !currentRouteLevels.contains(KFSConstants.RouteLevelNames.PAYMENT_METHOD)) {
LOG.info("Checking travel system generated entry permissions.");
editModes.add(CUKFSAuthorizationConstants.DisbursementVoucherEditMode.TRAVEL_SYSTEM_GENERATED_ENTRY);
}
}
Aggregations