diff --git a/ToDo.adoc b/ToDo.adoc index 1dd41ea76e..5af5e5bf31 100644 --- a/ToDo.adoc +++ b/ToDo.adoc @@ -1,5 +1,4 @@ ==== Aktuell: -- History-Entries für EmployeeValidityAttrDO werden nicht ordentlich geschrieben. - JCR: Tool for removing or recovering orphaned nodes. - Favoriten bei Scriptausführung für Parameter. - KI-Anteil in Zeitberichten @@ -15,7 +14,6 @@ - Kalendereinträge und Subscriptions. - LoginProtection: Increases penalty time for DAV only after 5 tries. -- Auftragsbuch nächtlich persistieren (als json-zip) für Forecast-Vergleiche. - Apple for Webauthn4j - Abwesenheiten - Fakturaquote Monatsbericht @@ -36,10 +34,7 @@ History - ProjektEdit: History enthält keine neuen Kost2DOs/Arten (Einträge sind aber da). - CronReindexingHourlyJob ohne Effekt. - Reindizierung der letzten n einträge nicht migriert (sinnvoll?). -- history-entries bei EmployeeValidityAttrDO nichtssagend. -- HistoryEntry: EmployeeValidityAttrDO.insert muss sinnvoll für Anzeige formatiert werden. - PFHistoryMasterDO: Indexe setzen, wenn Einträge wieder gehen. -- XML-Import für Testsystem - UserRightId: ClassBridge müsste eigentlich in die Felder der benutzenden DOs - reindexing settings implementieren. Aktuell wird nur komplett gemass-indexed. - History of AddressCampaignValueDO's (AddressCampaignValueDao.convertToDisplayHistoryEntries removed) diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeValidSinceAttrHistoryAdapter.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeValidSinceAttrHistoryAdapter.kt index ec7a3684b8..ba80ed3e23 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeValidSinceAttrHistoryAdapter.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeValidSinceAttrHistoryAdapter.kt @@ -52,11 +52,11 @@ class EmployeeValidSinceAttrHistoryAdapter : HistoryFormatAdapter() { }) } displayHistoryEntry.attributes.forEach { attr -> - val displayPropname = attr.displayPropertyName ?: "" - attr.displayPropertyName = if (attr.displayPropertyName.isNullOrEmpty()) { + val displayPropname = attr.displayPropertyName + attr.displayPropertyName = if (displayPropname.isNullOrEmpty()) { prefix } else { - "$prefix.${attr.displayPropertyName}" + "$prefix.$displayPropname" } } } diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/kost/KostZuweisungExport.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/kost/KostZuweisungExport.kt index 89fc3ef3a8..633cc1c495 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/kost/KostZuweisungExport.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/kost/KostZuweisungExport.kt @@ -216,7 +216,7 @@ class KostZuweisungExport { } var konto: KontoDO? = null if (rechnung is RechnungDO) { - konto = kontoCache.getKontoIfNotInitialized(rechnung.konto) + konto = kontoCache.getKonto(rechnung) } else if (rechnung is EingangsrechnungDO) { konto = kontoCache.getKontoIfNotInitialized(rechnung.konto) } diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsSanityCheck.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsSanityCheck.kt index 415e77fc5c..8dbdbca6ff 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsSanityCheck.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/fibu/orderbooksnapshots/OrderbookSnapshotsSanityCheck.kt @@ -49,7 +49,7 @@ class OrderbookSnapshotsSanityCheck(val orderbookSnapshotsService: OrderbookSnap val orders = orderbookSnapshotsService.readSnapshot(date) val lastUpdate = orders?.maxOf { it.lastUpdate ?: Date(0L) } val highestOrderNumber = orders?.maxOf { it.nummer ?: -1 } - jobExecutionContext.addMessage("Snapshot for date $date (${it.size.formatBytes()}) is readable: ${orders?.size?.format()} orders, highest order number=${highestOrderNumber.format()} lastUpdate=${lastUpdate.isoString()}.") + jobExecutionContext.addMessage("Snapshot for date $date (${it.size.formatBytes()}) is readable: ${orders?.size?.format()} orders, highest order number=${highestOrderNumber.format()}, last update of any order=${lastUpdate.isoString()}.") } catch (e: Exception) { jobExecutionContext.addError("Error reading snapshot for date $date: $e") } diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/jobs/CronSanityCheckJob.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/jobs/CronSanityCheckJob.kt index a440335a52..ca816b2bd7 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/jobs/CronSanityCheckJob.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/jobs/CronSanityCheckJob.kt @@ -95,7 +95,7 @@ class CronSanityCheckJob { .add(Html.P("Your ProjectForge system")) } msg.content = contextList.getReportAsHtml(showAllMessages = false, intro) - msg.contentType = Mail.CONTENTTYPE_TEXT + msg.contentType = Mail.CONTENTTYPE_HTML val attachments = listOf(MailAttachment(FILENAME, contextList.getReportAsHtml().toByteArray())) sendMail.send(msg, null, attachments) } diff --git a/projectforge-business/src/main/kotlin/org/projectforge/business/scripting/MyScriptDao.kt b/projectforge-business/src/main/kotlin/org/projectforge/business/scripting/MyScriptDao.kt index d1ffd4a9f1..9163c52568 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/business/scripting/MyScriptDao.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/business/scripting/MyScriptDao.kt @@ -64,7 +64,7 @@ open class MyScriptDao : AbstractScriptDao() { } } obj.executableByGroupIds?.split(",")?.forEach { groupId -> - groupId.toLongOrNull()?.let { gid -> + groupId.trim().toLongOrNull()?.let { gid -> if (userGroupCache.isUserMemberOfGroup(userId, gid)) { // Logged-in user is member of this group listed in executableByGroupIds return true diff --git a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntry.kt b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntry.kt index aec0deb085..d6e1d3c909 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntry.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntry.kt @@ -40,6 +40,10 @@ class DisplayHistoryEntry { var modifiedByUserId: Long? = null var modifiedByUser: String? = null var operationType: EntityOpType? = null + set(value) { + field = value + operation = HistoryFormatService.translate(value) + } var operation: String? = null var attributes = mutableListOf() @@ -53,7 +57,6 @@ class DisplayHistoryEntry { entry.modifiedByUserId = modifiedByUser?.id entry.modifiedByUser = modifiedByUser?.getFullname() ?: historyEntry.modifiedBy entry.operationType = historyEntry.entityOpType - entry.operation = HistoryFormatService.translate(historyEntry.entityOpType) } } } diff --git a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntryAttr.kt b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntryAttr.kt index bdb5e7a700..8b598947c2 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntryAttr.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/DisplayHistoryEntryAttr.kt @@ -26,6 +26,10 @@ package org.projectforge.framework.persistence.history class DisplayHistoryEntryAttr { var id: Long? = null var operationType: PropertyOpType? = null + set(value) { + field = value + operation = HistoryFormatService.translate(value) + } var operation: String? = null var propertyName: String? = null var displayPropertyName: String? = null @@ -39,7 +43,6 @@ class DisplayHistoryEntryAttr { return DisplayHistoryEntryAttr().also { it.id = attr.id it.operationType = attr.opType - it.operation = HistoryFormatService.translate(attr.opType) it.propertyName = HistoryFormatUtils.getPlainPropertyName(attr) it.displayPropertyName = attr.displayPropertyName if (it.displayPropertyName == null && entityClass != null) { diff --git a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatService.kt b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatService.kt index f7f31f881f..436bd1b90f 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatService.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatService.kt @@ -105,7 +105,6 @@ class HistoryFormatService { // Add the operation as attribute, if a propertyPrefix is given. displayHistoryEntry.attributes.add(DisplayHistoryEntryAttr().also { attr -> attr.operationType = PropertyOpType.Insert - attr.operation = context.requiredDisplayHistoryEntry.operation attr.displayPropertyName = propertyPrefix attr.newValue = attr.operation }) diff --git a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatUserRightAdapter.kt b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatUserRightAdapter.kt index 2223ec3dbc..b8692f03f2 100644 --- a/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatUserRightAdapter.kt +++ b/projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/history/HistoryFormatUserRightAdapter.kt @@ -54,7 +54,6 @@ class HistoryFormatUserRightAdapter( } attr.newValue = if (valueI18nKey != null) translate(valueI18nKey) else right.value?.toString() attr.operationType = propertyOpType - attr.operation = HistoryFormatService.translate(propertyOpType) } } } diff --git a/projectforge-jcr/src/main/kotlin/org/projectforge/jcr/JCRCheckSanityCheckJob.kt b/projectforge-jcr/src/main/kotlin/org/projectforge/jcr/JCRCheckSanityCheckJob.kt index 8433f44749..54c545e773 100644 --- a/projectforge-jcr/src/main/kotlin/org/projectforge/jcr/JCRCheckSanityCheckJob.kt +++ b/projectforge-jcr/src/main/kotlin/org/projectforge/jcr/JCRCheckSanityCheckJob.kt @@ -37,6 +37,10 @@ import javax.jcr.Node private val log = KotlinLogging.logger {} +/** + * Checks the sanity of the JCR repository. + * This job is scheduled by the cron expression in the application.properties file. + */ @Component open class JCRCheckSanityCheckJob : AbstractJob("JCR Check Sanity") { @Autowired