868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
34a37e406 DataTransferPlugin: WIP: notification e-mail about files being deleted.
868d6abb7
2025 -> 2026868d6abb75cd191a892911ac8e45058932cf9074
diff --git a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
index 21f267ea3..ea94025f9 100644
--- a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
+++ b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
@@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
-// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2026 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
63081666f
Source file headers: 2024-> 2025.63081666f620fb87315f01b817e560e0b2f6a33a
diff --git a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
index 39b63badf..21f267ea3 100644
--- a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
+++ b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
@@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
-// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
b6092df09
Copyright 2023 -> 2024b6092df0927c4a3b161e888445f31dcab57493f2
diff --git a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
index 008a9404e..39b63badf 100644
--- a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
+++ b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
@@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
-// Copyright (C) 2001-2023 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2024 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
ab45d51fa
Copyright 2001-2022 -> 2001-2023.ab45d51fa419ede6174b31d69987f96d4b841ff9
diff --git a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
index be401458f..008a9404e 100644
--- a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
+++ b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
@@ -3,7 +3,7 @@
// Project ProjectForge Community Edition
// www.projectforge.org
//
-// Copyright (C) 2001-2022 Micromata GmbH, Germany (www.micromata.com)
+// Copyright (C) 2001-2023 Micromata GmbH, Germany (www.micromata.com)
//
// ProjectForge is dual-licensed.
//
34a37e406
DataTransferPlugin: WIP: notification e-mail about files being deleted.34a37e406b51e0bc996717a641bd25f0e0be5a94
diff --git a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
index 7d5938a16..be401458f 100644
--- a/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
+++ b/plugins/org.projectforge.plugins.datatransfer/src/main/kotlin/org/projectforge/plugins/datatransfer/DataTransferUtils.kt
@@ -23,15 +23,29 @@
package org.projectforge.plugins.datatransfer
+import org.projectforge.framework.i18n.I18nHelper
import org.projectforge.framework.i18n.TimeLeft
import org.projectforge.framework.i18n.translate
+import org.projectforge.framework.jcr.Attachment
import org.projectforge.framework.time.PFDateTime
import java.util.*
object DataTransferUtils {
- fun expiryTimeLeft(lastUpdate: Date?, expiryDays: Int?): String {
+ fun expiryTimeLeft(attachment: Attachment, expiryDays: Int?, locale: Locale? = null): String {
+ return expiryTimeLeft(attachment.lastUpdate ?: attachment.created, expiryDays, locale)
+ }
+
+ private fun expiryTimeLeft(lastUpdate: Date?, expiryDays: Int?, locale: Locale?): String {
lastUpdate ?: return ""
val expiryDate = PFDateTime.from(lastUpdate).plusDays((expiryDays ?: 30).toLong()).utilDate
- return TimeLeft.getMessage(expiryDate, pastMessage = translate("plugins.datatransfer.expired"))
+ return if (locale != null) {
+ TimeLeft.getMessage(
+ expiryDate,
+ locale,
+ pastMessage = I18nHelper.getLocalizedMessage(locale, "plugins.datatransfer.expired")
+ )
+ } else {
+ TimeLeft.getMessage(expiryDate, pastMessage = translate("plugins.datatransfer.expired"))
+ }
}
}