fix: Ref-Format und Dark-Theme-Kompatibilität
All checks were successful
Deploy bericht / deploy (push) Successful in 1s

- 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) <noreply@anthropic.com>
[deploy]
This commit is contained in:
Eduard Wisch 2026-04-08 15:51:49 +02:00
parent 07a36f447e
commit 70f272d951
2 changed files with 103 additions and 30 deletions

View file

@ -50,7 +50,7 @@ class Bericht extends CommonObject
$this->fk_user_creat = $user->id; $this->fk_user_creat = $user->id;
if (empty($this->ref)) { 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 (" $sql = "INSERT INTO ".$this->db->prefix()."bericht ("

View file

@ -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; } .bericht-overview-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
@ -14,31 +16,48 @@
.bericht-attachments, .bericht-attachments,
.bericht-pages { .bericht-pages {
background: #f7f7f9; background: var(--colorbacktitle1, #f7f7f9);
border: 1px solid #e3e3e7; color: var(--colortext, inherit);
border: 1px solid var(--colorboxbordertitle1, #e3e3e7);
border-radius: 6px; border-radius: 6px;
padding: 10px; padding: 10px;
max-height: 80vh; max-height: 80vh;
overflow-y: auto; overflow-y: auto;
} }
.bericht-attachments h4, .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 { 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 { .bericht-att-item {
display: flex; align-items: center; gap: 6px; display: flex; align-items: center; gap: 6px;
padding: 4px 2px; cursor: pointer; font-size: 12px; 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-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; } .att-icon { font-size: 14px; }
.bericht-upload { margin-top: 10px; } .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 { .bericht-canvas-area {
background: #2a2a2e; background: var(--colorbackbody, #2a2a2e);
border: 1px solid var(--colorboxbordertitle1, transparent);
border-radius: 6px; border-radius: 6px;
padding: 10px; padding: 10px;
min-height: 80vh; min-height: 80vh;
@ -46,61 +65,115 @@
} }
.bericht-toolbar { .bericht-toolbar {
display: flex; flex-wrap: wrap; gap: 4px; align-items: center; 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 { .bericht-toolbar button,
background: #fff; border: 1px solid #ccc; border-radius: 4px; .bericht-toolbar .tool-btn {
padding: 4px 10px; cursor: pointer; font-size: 16px; 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 { .bericht-canvas-wrap {
flex: 1; position: relative; overflow: auto; 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; display: flex; align-items: flex-start; justify-content: center;
} }
#pdf-canvas { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.4); } #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; } #fabric-canvas.fabric-overlay { position: absolute !important; pointer-events: auto; }
.bericht-page-note { margin-top: 8px; } .bericht-page-note { margin-top: 8px; }
.bericht-page-note label { display: block; color: #fff; font-size: 12px; margin-bottom: 4px; } .bericht-page-note label {
.bericht-page-note textarea { width: 100%; box-sizing: border-box; } 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-list { display: flex; flex-direction: column; gap: 6px; }
.page-thumb { .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; padding: 6px; cursor: pointer; position: relative;
transition: border-color 0.15s; transition: border-color 0.15s;
} }
.page-thumb:hover { border-color: #888; } .page-thumb:hover { border-color: var(--colortextlink, #888); }
.page-thumb.active { border-color: #337ab7; box-shadow: 0 0 0 2px rgba(51,122,183,0.3); } .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 { .page-thumb-inner {
height: 100px; background: #f0f0f0; height: 100px;
background: var(--colorbackvmenu1, #f0f0f0);
display: flex; align-items: center; justify-content: center; 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; } .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 { .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 { .bericht-toast {
position: fixed; top: 20px; right: 20px; position: fixed; top: 20px; right: 20px;
background: #5cb85c; color: #fff; padding: 12px 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; z-index: 9999; animation: fadeIn 0.2s;
} }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } } @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }
.bericht-setup-section { .bericht-setup-section {
background: #fff; border: 1px solid #e3e3e7; background: var(--colorbacktitle1, #fff);
border-radius: 6px; padding: 16px; margin-bottom: 16px; 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) { @media (max-width: 1100px) {
.bericht-layout { grid-template-columns: 1fr; } .bericht-layout { grid-template-columns: 1fr; }