Attachments Liste wird jetzt angezeigt und attachment in iframe

This commit is contained in:
2026-03-20 17:32:13 +01:00
parent 581c6d9ecc
commit 71621ad8ac
3 changed files with 45 additions and 12 deletions
+15 -2
View File
@@ -153,7 +153,6 @@ buchungenServer <- function(id, conn, aktiver_filter = reactive("alle")) {
})
## * Attachments anzeigen ----
output$attachments_ui <- renderUI({
req(selected_trans_id())
att <- dbxSelect(conn, paste0(
@@ -162,8 +161,22 @@ buchungenServer <- function(id, conn, aktiver_filter = reactive("alle")) {
if (nrow(att) == 0) return(p("Keine Anhänge vorhanden."))
tagList(lapply(seq_len(nrow(att)), function(i) {
ext <- tools::file_ext(att$original_name[i])
filename <- paste0("attachments/", att$id[i], ".", ext)
# Observer direkt hier registrieren
observeEvent(input[[paste0("open_att_", att$id[i])]], {
showModal(modalDialog(
tags$iframe(src = filename, width = "100%", height = "600px", style = "border:none;"),
title = att$original_name[i],
size = "l",
easyClose = TRUE,
footer = modalButton("Schließen")
))
}, ignoreInit = TRUE, once = FALSE)
div(
tags$a(att$original_name[i], href = att$path[i], target = "_blank"),
actionLink(ns(paste0("open_att_", att$id[i])), att$original_name[i]),
actionLink(ns(paste0("del_att_", att$id[i])), "✕",
style = "color:red; margin-left:8px;")
)