Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WORKFLOW-202: Add a confirmation message to the archive task #19

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ task.config.message.numeric.field=The field "{0}" must be a number.

task.information.notarchived.message=The archival will happen on {0} (type: {1}).
task.information.archived.message=The archival happened on {0} (type: {1}).

task.confirm_action=Please confirm the archiving of the resource.
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ task.config.message.numeric.field=Le champ "{0}" doit \u00eatre num\u00e9rique.

task.information.notarchived.message=L''archivage aura lieu le {0} (type: {1}).
task.information.archived.message=L''archivage a eu lieu le {0} (type: {1}).

task.confirm_action=Veuillez confirmer l'archivage de la ressource.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public class ArchiveTaskComponent extends NoFormTaskComponent
{
// TEMPLATES
private static final String TEMPLATE_TASK_ARCHIVE_CONFIG = "admin/plugins/workflow/modules/archive/task_archive_config.html";

private static final String TEMPLATE_CONFIRM_TASK_ARCHIVE = "admin/plugins/workflow/modules/archive/confirm_task_archive.html";

// MARKS
private static final String MARK_LIST_TYPE = "type_list";
private static final String MARK_CONFIG = "config";
Expand Down Expand Up @@ -232,4 +233,14 @@ public String getDisplayTaskInformation( int nIdHistory, HttpServletRequest requ
return I18nService.getLocalizedString( MESSAGE_INFORMATION_NOT_ARCHIVED, params, locale );
}
}

@Override
public String getDisplayTaskForm( int nIdResource, String strResourceType, HttpServletRequest request, Locale locale, ITask task )
{
Map<String, Object> model = new HashMap< >( );

HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_CONFIRM_TASK_ARCHIVE , locale, model );

return template.getHtml( );
}
}
2 changes: 1 addition & 1 deletion webapp/WEB-INF/conf/plugins/workflow_context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
p:beanName="workflow.taskArchive"
p:configBeanName="workflow.taskArchiveConfig"
p:taskForAutomaticAction="true"
p:configRequired="true" p:formTaskRequired="false" />
p:configRequired="true" p:formTaskRequired="true" />
<bean id="workflow.taskTypeConfirmAction"
class="fr.paris.lutece.plugins.workflowcore.business.task.TaskType"
p:key="taskTypeConfirmAction"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<@row>
<@columns class="col-sm-12 offset-lg-3 col-lg-6">
<@callOut color='info' titleLevel='h4' >
#i18n{module.workflow.archive.task.confirm_action}
</@callOut>
</@columns>
</@row>
<@input type='hidden' name='workflow_action_redirection' value='list' />