mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature-2.7/RM-6337_AccessionVisibilityBackport' into 'release/V2.7'
Backport fix from master See merge request records-management/records-management!1019
This commit is contained in:
@@ -811,31 +811,47 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
public boolean isNextDispositionActionEligible(NodeRef nodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
// Get the disposition instructions
|
||||
DispositionSchedule di = getDispositionSchedule(nodeRef);
|
||||
NodeRef nextDa = getNextDispositionActionNodeRef(nodeRef);
|
||||
DispositionAction nextDa = getNextDispositionAction(nodeRef);
|
||||
if (di != null &&
|
||||
this.nodeService.hasAspect(nodeRef, ASPECT_DISPOSITION_LIFECYCLE) &&
|
||||
nextDa != null)
|
||||
{
|
||||
// If it has an asOf date and it is greater than now the action is eligible
|
||||
Date asOf = (Date)this.nodeService.getProperty(nextDa, PROP_DISPOSITION_AS_OF);
|
||||
if (asOf != null &&
|
||||
asOf.before(new Date()))
|
||||
// for accession step we can have also AND between step conditions
|
||||
Boolean combineSteps = false;
|
||||
if (nextDa.getName().equals("accession"))
|
||||
{
|
||||
result = true;
|
||||
NodeRef accessionNodeRef = di.getDispositionActionDefinitionByName("accession").getNodeRef();
|
||||
if (accessionNodeRef != null) {
|
||||
Boolean combineStepsProp = (Boolean)this.nodeService.getProperty(accessionNodeRef, PROP_COMBINE_DISPOSITION_STEP_CONDITIONS);
|
||||
if (combineStepsProp != null)
|
||||
{
|
||||
combineSteps = combineStepsProp;
|
||||
}
|
||||
|
||||
if (!result)
|
||||
}
|
||||
}
|
||||
Date asOf = (Date)this.nodeService.getProperty(nextDa.getNodeRef(), PROP_DISPOSITION_AS_OF);
|
||||
Boolean asOfDateInPast = false;
|
||||
if (asOf != null)
|
||||
{
|
||||
DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa);
|
||||
asOfDateInPast = asOf.before(new Date());
|
||||
}
|
||||
if (asOfDateInPast && !combineSteps)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(!asOfDateInPast && combineSteps)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
DispositionAction da = new DispositionActionImpl(serviceRegistry, nextDa.getNodeRef());
|
||||
DispositionActionDefinition dad = da.getDispositionActionDefinition();
|
||||
if (dad != null)
|
||||
{
|
||||
boolean firstComplete = dad.eligibleOnFirstCompleteEvent();
|
||||
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(nextDa, ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL);
|
||||
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(nextDa.getNodeRef(), ASSOC_EVENT_EXECUTIONS, RegexQNamePattern.MATCH_ALL);
|
||||
for (ChildAssociationRef assoc : assocs)
|
||||
{
|
||||
NodeRef eventExecution = assoc.getChildRef();
|
||||
@@ -866,8 +882,6 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ package org.alfresco.module.org_alfresco_module_rm.jscript.app;
|
||||
|
||||
import static org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel.READ_RECORDS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_COMBINE_DISPOSITION_STEP_CONDITIONS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_RS_DISPOSITION_EVENTS;
|
||||
import static org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel.PROP_DISPOSITION_EVENT_COMBINATION;
|
||||
import static org.alfresco.service.cmr.security.AccessStatus.ALLOWED;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -485,6 +485,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JS
|
||||
HashMap properties = ((HashMap) rmNodeValues.get("properties"));
|
||||
properties.put("combineDispositionStepConditions", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_COMBINE_DISPOSITION_STEP_CONDITIONS));
|
||||
properties.put("incompleteDispositionEvent", details.getEventName());
|
||||
properties.put("dispositionEventCombination", nodeService.getProperty(dispositionService.getNextDispositionAction(nodeRef).getDispositionActionDefinition().getNodeRef(), PROP_DISPOSITION_EVENT_COMBINATION));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user