From b0771ab3a2d551e41636fa9374afcc9f8e68efc8 Mon Sep 17 00:00:00 2001 From: "pierre.sciorella" Date: Tue, 17 Dec 2019 15:18:37 +0100 Subject: [PATCH] WFALERTF-3: fix missing months/year in periods --- .../alertforms/resources/alertforms_messages.properties | 2 ++ .../alertforms/resources/alertforms_messages_fr.properties | 2 ++ .../modules/alertforms/util/constants/AlertConstants.java | 2 ++ .../workflow/modules/alertforms/web/AlertTaskComponent.java | 2 ++ .../workflow/modules/alertforms/task_alert_history.html | 6 +++++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages.properties b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages.properties index 7ae1895..98fc6b6 100644 --- a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages.properties +++ b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages.properties @@ -44,6 +44,8 @@ task_alert_config.label_task_retrieval_type=Fetch the reference date from task.alertTaskHistory.information.title=Alert. Change of state for this response task.alertTaskHistory.information.in=In task.alertTaskHistory.information.days=day(s) +task.alertTaskHistory.information.months=month(s) +task.alertTaskHistory.information.years=year(s) task.alertTaskHistory.information.resourceWillChangeState=The response will change of state task.alertTaskHistory.information.resourceHasChangedState=The response has changed of state task.alertTaskHistory.information.resourceNotChangedState=The response has not changed of state diff --git a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages_fr.properties b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages_fr.properties index 374e799..d80f34f 100644 --- a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages_fr.properties +++ b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/resources/alertforms_messages_fr.properties @@ -44,6 +44,8 @@ task_alert_config.label_task_retrieval_type=R\u00e9cup\u00e9rer la date de r\u00 task.alertTaskHistory.information.title=Alerte. Changement d'\u00e9tat de la fiche task.alertTaskHistory.information.in=Dans task.alertTaskHistory.information.days=jour(s) +task.alertTaskHistory.information.months=mois +task.alertTaskHistory.information.years=année(s) task.alertTaskHistory.information.resourceWillChangeState=La fiche va changer d'\u00e9tat task.alertTaskHistory.information.resourceHasChangedState=La fiche a chang\u00e9 d'\u00e9tat task.alertTaskHistory.information.resourceNotChangedState=Pas de changement d'\u00e9tat diff --git a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/util/constants/AlertConstants.java b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/util/constants/AlertConstants.java index f85b8b3..2ffe2d8 100644 --- a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/util/constants/AlertConstants.java +++ b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/util/constants/AlertConstants.java @@ -71,6 +71,8 @@ public final class AlertConstants public static final String MARK_STATE_BEFORE = "state_before"; public static final String MARK_STATE_AFTER = "state_after"; public static final String MARK_DAYS_BETWEEN = "days_between"; + public static final String MARK_MONTHS_BETWEEN = "months_between"; + public static final String MARK_YEARS_BETWEEN = "years_between"; public static final String MARK_ALERT_ACTIVE = "alert_active"; public static final String MARK_ALERT_EXECUTED = "alert_executed"; public static final String MARK_NB_DAYS_ALERT = "nb_days_alert"; diff --git a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/web/AlertTaskComponent.java b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/web/AlertTaskComponent.java index d22e0e6..15451a1 100644 --- a/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/web/AlertTaskComponent.java +++ b/src/java/fr/paris/lutece/plugins/workflow/modules/alertforms/web/AlertTaskComponent.java @@ -124,6 +124,8 @@ public String getDisplayTaskInformation( int nIdHistory, HttpServletRequest requ Period period = Period.between( ldtNow.toLocalDate( ), ldtRefAlert.toLocalDate( ) ); model.put( AlertConstants.MARK_DAYS_BETWEEN, period.getDays( ) ); + model.put( AlertConstants.MARK_MONTHS_BETWEEN, period.getMonths( ) ); + model.put( AlertConstants.MARK_YEARS_BETWEEN, period.getYears( ) ); model.put( AlertConstants.MARK_ALERT_ACTIVE, alert.isActive( ) ); model.put( AlertConstants.MARK_ALERT_EXECUTED, alert.isExecuted( ) ); diff --git a/webapp/WEB-INF/templates/admin/plugins/workflow/modules/alertforms/task_alert_history.html b/webapp/WEB-INF/templates/admin/plugins/workflow/modules/alertforms/task_alert_history.html index 5c6db9f..12e9894 100644 --- a/webapp/WEB-INF/templates/admin/plugins/workflow/modules/alertforms/task_alert_history.html +++ b/webapp/WEB-INF/templates/admin/plugins/workflow/modules/alertforms/task_alert_history.html @@ -1,7 +1,11 @@
<#if alert_active> - #i18n{module.workflow.alertforms.task.alertTaskHistory.information.in} ${days_between!''} #i18n{module.workflow.alertforms.task.alertTaskHistory.information.days}
+ #i18n{module.workflow.alertforms.task.alertTaskHistory.information.in} + ${years_between!''} #i18n{module.workflow.alertforms.task.alertTaskHistory.information.years} + ${months_between!''} #i18n{module.workflow.alertforms.task.alertTaskHistory.information.months} + ${days_between!''} #i18n{module.workflow.alertforms.task.alertTaskHistory.information.days} +
#i18n{module.workflow.alertforms.task.alertTaskHistory.information.resourceWillChangeState} :
${state_before.name!''} ${state_after.name!''} <#else>