diff --git a/dspace/config/input-forms.xml b/dspace/config/input-forms.xml index b9819355f7d9..f4cc8c92218d 100644 --- a/dspace/config/input-forms.xml +++ b/dspace/config/input-forms.xml @@ -1240,10 +1240,9 @@ creator person true - + onebox Autores de la obra - Debe indicarse el/los autores de la obra !Objeto Fisico diff --git a/dspace/config/spring/api/workflow-actions.xml b/dspace/config/spring/api/workflow-actions.xml index e28d67476bb1..e835ac903a28 100644 --- a/dspace/config/spring/api/workflow-actions.xml +++ b/dspace/config/spring/api/workflow-actions.xml @@ -7,6 +7,7 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> + @@ -101,6 +102,12 @@ + + + + + + diff --git a/dspace/config/spring/xmlui/workflow-actions-xmlui.xml b/dspace/config/spring/xmlui/workflow-actions-xmlui.xml index 39df48d42b2f..d77554b046ed 100644 --- a/dspace/config/spring/xmlui/workflow-actions-xmlui.xml +++ b/dspace/config/spring/xmlui/workflow-actions-xmlui.xml @@ -18,6 +18,7 @@ + diff --git a/dspace/config/workflow.xml b/dspace/config/workflow.xml index ab41dc94fd36..b402c6cd7c96 100644 --- a/dspace/config/workflow.xml +++ b/dspace/config/workflow.xml @@ -86,7 +86,7 @@ - + diff --git a/dspace/modules/additions/src/main/java/ar/edu/unlp/sedici/dspace/xmlworkflow/state/actions/userassignment/SelectIfAdmin.java b/dspace/modules/additions/src/main/java/ar/edu/unlp/sedici/dspace/xmlworkflow/state/actions/userassignment/SelectIfAdmin.java new file mode 100644 index 000000000000..77afe4c777c6 --- /dev/null +++ b/dspace/modules/additions/src/main/java/ar/edu/unlp/sedici/dspace/xmlworkflow/state/actions/userassignment/SelectIfAdmin.java @@ -0,0 +1,61 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package ar.edu.unlp.sedici.dspace.xmlworkflow.state.actions.userassignment; + +import org.dspace.authorize.AuthorizeException; +import org.dspace.core.*; +import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem; +import org.dspace.xmlworkflow.*; +import org.dspace.xmlworkflow.state.Step; +import org.dspace.xmlworkflow.state.actions.userassignment.ClaimAction; +import ar.edu.unlp.sedici.util.AuthorizeUtil; + +import java.io.IOException; +import java.sql.SQLException; + +/** + * Processing class for an action where x number of users + * have to accept a task from a designated pool + * + * @author Bram De Schouwer (bram.deschouwer at dot com) + * @author Kevin Van de Velde (kevin at atmire dot com) + * @author Ben Bosman (ben at atmire dot com) + * @author Mark Diggory (markd at atmire dot com) + */ +public class SelectIfAdmin extends ClaimAction { + + @Override + public boolean isValidUserSelection(Context context, XmlWorkflowItem wfi, boolean hasUI) throws WorkflowConfigurationException, SQLException { + //A user claim action always needs to have a UI, since somebody needs to be able to claim it + if(hasUI){ + if (AuthorizeUtil.epersonInGroup(context, 2 ,context.getCurrentUser())||AuthorizeUtil.epersonInGroup(context, 1 ,context.getCurrentUser())) { + return true; + } + return super.isValidUserSelection(context, wfi, hasUI); + }else + return true; + + } + + @Override + public void activate(Context context, XmlWorkflowItem wfItem) throws SQLException, IOException, AuthorizeException { + Step owningStep = getParent().getStep(); + // Create pooled tasks for the Sedici Submitter + if (AuthorizeUtil.epersonInGroup(context, 2 ,context.getCurrentUser())||AuthorizeUtil.epersonInGroup(context, 1 ,context.getCurrentUser())){ + RoleMembers rol = new RoleMembers(); + rol.addEPerson(context.getCurrentUser()); + XmlWorkflowManager.createPoolTasks(context, wfItem, rol, owningStep, getParent()); + alertUsersOnActivation(context, wfItem, rol); + } + else + super.activate(context, wfItem); + + + } + +} \ No newline at end of file