From 70f272d9512d8c56619e77febe9d397abe1ab6b6 Mon Sep 17 00:00:00 2001 From: Eduard Wisch Date: Wed, 8 Apr 2026 15:51:49 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Ref-Format=20und=20Dark-Theme-Kompatibil?= =?UTF-8?q?it=C3=A4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bericht-Ref nutzt jetzt date('ymd-His') statt dol_print_date mit kaputten %i/%s Tokens (ergab 'BR260408-15%49%47') - CSS verwendet Dolibarr-Variablen (--colorbacktitle1, --colortext etc) statt fester Hex-Werte, damit Dark-Theme automatisch passt Co-Authored-By: Claude Opus 4.6 (1M context) [deploy] --- class/bericht.class.php | 2 +- css/bericht.css | 131 +++++++++++++++++++++++++++++++--------- 2 files changed, 103 insertions(+), 30 deletions(-) diff --git a/class/bericht.class.php b/class/bericht.class.php index bbba124..5d5353b 100644 --- a/class/bericht.class.php +++ b/class/bericht.class.php @@ -50,7 +50,7 @@ class Bericht extends CommonObject $this->fk_user_creat = $user->id; if (empty($this->ref)) { - $this->ref = 'BR'.dol_print_date($this->datec, '%y%m%d-%H%i%s'); + $this->ref = 'BR'.date('ymd-His', $this->datec); } $sql = "INSERT INTO ".$this->db->prefix()."bericht (" diff --git a/css/bericht.css b/css/bericht.css index 12afce7..3ebdda9 100644 --- a/css/bericht.css +++ b/css/bericht.css @@ -1,4 +1,6 @@ -/* Bericht-Modul Stylesheet */ +/* Bericht-Modul Stylesheet + * Nutzt Dolibarr CSS-Variablen, damit Light- und Dark-Theme automatisch passen. + */ .bericht-overview-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; } @@ -14,31 +16,48 @@ .bericht-attachments, .bericht-pages { - background: #f7f7f9; - border: 1px solid #e3e3e7; + background: var(--colorbacktitle1, #f7f7f9); + color: var(--colortext, inherit); + border: 1px solid var(--colorboxbordertitle1, #e3e3e7); border-radius: 6px; padding: 10px; max-height: 80vh; overflow-y: auto; } .bericht-attachments h4, -.bericht-pages h4 { margin: 0 0 8px 0; font-size: 13px; text-transform: uppercase; color: #555; } +.bericht-pages h4 { + margin: 0 0 8px 0; + font-size: 13px; + text-transform: uppercase; + color: var(--colortextlink, #555); +} .bericht-att-group { margin-bottom: 10px; } -.bericht-att-group-title { font-weight: 600; font-size: 11px; color: #777; padding: 4px 0; border-bottom: 1px solid #ddd; } +.bericht-att-group-title { + font-weight: 600; + font-size: 11px; + opacity: 0.7; + padding: 4px 0; + border-bottom: 1px solid var(--colorboxbordertitle1, #ddd); +} .bericht-att-item { display: flex; align-items: center; gap: 6px; padding: 4px 2px; cursor: pointer; font-size: 12px; + color: var(--colortext, inherit); } -.bericht-att-item:hover { background: #eef; } +.bericht-att-item:hover { background: var(--colorbackhmenu1, rgba(255,255,255,0.05)); } .att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.att-size { font-size: 10px; } +.att-size { font-size: 10px; opacity: 0.6; } .att-icon { font-size: 14px; } .bericht-upload { margin-top: 10px; } +/* Mittlere Spalte: Editor-Canvas — bewusst dunkler Hintergrund (auch im Light-Mode), + * weil ein Canvas auf grauer Fläche besser sichtbar ist. + */ .bericht-canvas-area { - background: #2a2a2e; + background: var(--colorbackbody, #2a2a2e); + border: 1px solid var(--colorboxbordertitle1, transparent); border-radius: 6px; padding: 10px; min-height: 80vh; @@ -46,61 +65,115 @@ } .bericht-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; - background: #fff; padding: 6px; border-radius: 4px; margin-bottom: 8px; + background: var(--colorbacktitle1, #fff); + color: var(--colortext, inherit); + padding: 6px; + border-radius: 4px; + margin-bottom: 8px; + border: 1px solid var(--colorboxbordertitle1, transparent); } -.bericht-toolbar button, .bericht-toolbar .tool-btn { - background: #fff; border: 1px solid #ccc; border-radius: 4px; - padding: 4px 10px; cursor: pointer; font-size: 16px; +.bericht-toolbar button, +.bericht-toolbar .tool-btn { + background: var(--butactionbg, transparent); + color: var(--colortext, inherit); + border: 1px solid var(--colorboxbordertitle1, #ccc); + border-radius: 4px; + padding: 4px 10px; + cursor: pointer; + font-size: 16px; +} +.bericht-toolbar .tool-btn.active { + background: var(--colorbackhmenu1, #5cb85c); + color: var(--colortextbackhmenu, #fff); + border-color: var(--colortextlink, #4cae4c); +} +.bericht-toolbar .sep { + width: 1px; + background: var(--colorboxbordertitle1, #ddd); + height: 24px; + margin: 0 6px; +} +.bericht-toolbar label { + display: flex; align-items: center; gap: 4px; + font-size: 12px; + color: var(--colortext, inherit); } -.bericht-toolbar .tool-btn.active { background: #5cb85c; color: #fff; border-color: #4cae4c; } -.bericht-toolbar .sep { width: 1px; background: #ddd; height: 24px; margin: 0 6px; } -.bericht-toolbar label { display: flex; align-items: center; gap: 4px; font-size: 12px; } .bericht-canvas-wrap { flex: 1; position: relative; overflow: auto; - background: #444; padding: 10px; border-radius: 4px; + background: var(--colorbackvmenu1, #444); + padding: 10px; border-radius: 4px; display: flex; align-items: flex-start; justify-content: center; } #pdf-canvas { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.4); } #fabric-canvas.fabric-overlay { position: absolute !important; pointer-events: auto; } .bericht-page-note { margin-top: 8px; } -.bericht-page-note label { display: block; color: #fff; font-size: 12px; margin-bottom: 4px; } -.bericht-page-note textarea { width: 100%; box-sizing: border-box; } +.bericht-page-note label { + display: block; + color: var(--colortextbackhmenu, inherit); + font-size: 12px; + margin-bottom: 4px; +} +.bericht-page-note textarea { + width: 100%; + box-sizing: border-box; + background: var(--inputbackgroundcolor, #fff); + color: var(--inputtextcolor, #000); + border: 1px solid var(--colorboxbordertitle1, #ccc); +} .page-list { display: flex; flex-direction: column; gap: 6px; } .page-thumb { - background: #fff; border: 2px solid #ddd; border-radius: 4px; + background: var(--colorbacktitle1, #fff); + color: var(--colortext, inherit); + border: 2px solid var(--colorboxbordertitle1, #ddd); + border-radius: 4px; padding: 6px; cursor: pointer; position: relative; transition: border-color 0.15s; } -.page-thumb:hover { border-color: #888; } -.page-thumb.active { border-color: #337ab7; box-shadow: 0 0 0 2px rgba(51,122,183,0.3); } +.page-thumb:hover { border-color: var(--colortextlink, #888); } +.page-thumb.active { + border-color: var(--colortextlink, #337ab7); + box-shadow: 0 0 0 2px var(--colorbackhmenu1, rgba(51,122,183,0.3)); +} .page-thumb-inner { - height: 100px; background: #f0f0f0; + height: 100px; + background: var(--colorbackvmenu1, #f0f0f0); display: flex; align-items: center; justify-content: center; - font-size: 24px; color: #999; + font-size: 24px; opacity: 0.6; } .page-thumb-actions { position: absolute; top: 4px; right: 4px; } -.thumb-del { background: rgba(255,255,255,0.9); border: 1px solid #ccc; border-radius: 3px; cursor: pointer; } +.thumb-del { + background: var(--colorbacktitle1, rgba(255,255,255,0.9)); + color: var(--colortext, inherit); + border: 1px solid var(--colorboxbordertitle1, #ccc); + border-radius: 3px; + cursor: pointer; +} .bericht-actions { - margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; + margin-top: 16px; + display: flex; gap: 8px; justify-content: flex-end; } .bericht-toast { position: fixed; top: 20px; right: 20px; background: #5cb85c; color: #fff; padding: 12px 20px; - border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.2); + border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.4); z-index: 9999; animation: fadeIn 0.2s; } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } } .bericht-setup-section { - background: #fff; border: 1px solid #e3e3e7; - border-radius: 6px; padding: 16px; margin-bottom: 16px; + background: var(--colorbacktitle1, #fff); + color: var(--colortext, inherit); + border: 1px solid var(--colorboxbordertitle1, #e3e3e7); + border-radius: 6px; + padding: 16px; + margin-bottom: 16px; } -.bericht-setup-section h3 { margin-top: 0; } +.bericht-setup-section h3 { margin-top: 0; color: var(--colortextlink, inherit); } @media (max-width: 1100px) { .bericht-layout { grid-template-columns: 1fr; }