fix: Modul-Beschreibung + Rechte-Labels via Sprachdatei [deploy]
All checks were successful
Deploy Eplan / deploy (push) Successful in 9s

- Module500037Desc/DescLong aus eplan.lang statt hardcodierter deutscher
  Strings im Modul-Descriptor
- Rechte-Labels via EplanRightRead/Write/Admin übersetzbar
- QR-Code-Block auf Auftragstab (aus vorheriger Sitzung)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Eduard Wisch 2026-04-19 09:48:49 +02:00
parent 8860a97b75
commit 4f09c6e55c
4 changed files with 39 additions and 8 deletions

View file

@ -57,18 +57,35 @@ if (!empty($pwa_url)) {
$pwa_link = $pwa_url . '/?auftrag=' . urlencode($object->ref) . '&kunde=' . urlencode($object->thirdparty->name ?? '') . '&auftrag_id=' . $object->id;
print '<div style="background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%); border-radius: 10px; padding: 20px; margin: 16px 0; color: #fff; box-sizing: border-box;">';
print '<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;">';
print '<div>';
print '<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;">';
print '<div style="flex: 1; min-width: 220px;">';
print '<strong style="font-size: 16px;">Aufmaß für ' . dol_escape_htmltag($object->ref) . '</strong>';
if (!empty($object->thirdparty->name)) {
print '<br><span style="opacity: 0.8; font-size: 13px;">' . dol_escape_htmltag($object->thirdparty->name) . '</span>';
}
print '</div>';
print '<br><span style="opacity: 0.7; font-size: 12px; margin-top: 8px; display: inline-block;">QR mit Handy scannen oder Button klicken — Auftrag wird automatisch verknüpft.</span>';
print '<div style="margin-top: 12px;">';
print '<a href="' . dol_escape_htmltag($pwa_link) . '" target="_blank" rel="noopener" ';
print 'style="display: inline-block; background: #fff; color: #1565C0; padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 700; text-decoration: none;">';
print '<i class="fas fa-drafting-compass" style="margin-right: 6px;"></i>Aufmaß starten</a>';
print '</div>';
print '</div>';
// QR-Code (clientseitig generiert, kein externer Tracking-Service)
print '<div id="eplan-qr" style="background: #fff; padding: 8px; border-radius: 8px; flex-shrink: 0;"></div>';
print '</div>';
print '</div>';
// qrcode-generator (selbsthosting wäre besser, aber CDN ist akzeptabel —
// bei fehlender Internet-Verbindung bleibt zumindest der Text-Link nutzbar)
print '<script src="https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.min.js"></script>';
print '<script>(function(){';
print ' if (typeof qrcode !== "function") return;';
print ' var q = qrcode(0, "M");';
print ' q.addData(' . json_encode($pwa_link, JSON_UNESCAPED_SLASHES) . ');';
print ' q.make();';
print ' var el = document.getElementById("eplan-qr");';
print ' if (el) el.innerHTML = q.createSvgTag({cellSize: 4, margin: 0});';
print '})();</script>';
} else {
print '<div class="warning" style="margin: 16px 0;">';
print '<i class="fas fa-exclamation-triangle"></i> ElektroPlan PWA-URL nicht konfiguriert. ';

View file

@ -17,8 +17,10 @@ class modEplan extends DolibarrModules
$this->family = "other";
$this->module_position = '91';
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Aufmaß-Tab auf Aufträgen und Kundenkarten — Verknüpfung zur ElektroPlan PWA.";
$this->descriptionlong = "Fügt Aufträgen und Kundenkarten einen Reiter 'Aufmaß' hinzu. Zeigt verknüpfte Grundrisse, öffnet die ElektroPlan PWA mit Auftrags-Kontext und ermöglicht PDF-Export direkt als Dolibarr-Dokument.";
// Beschreibung: Dolibarr nimmt automatisch Module500037Desc/DescLong
// aus eplan.lang wenn vorhanden — Hardcoded ist nur Fallback.
$this->description = "Module500037Desc";
$this->descriptionlong = "Module500037DescLong";
$this->editor_name = 'Alles Watt läuft';
$this->editor_url = '';
@ -63,21 +65,21 @@ class modEplan extends DolibarrModules
$r = 0;
$this->rights[$r][0] = $this->numero + 0;
$this->rights[$r][1] = 'Aufmaß einsehen';
$this->rights[$r][1] = 'EplanRightRead';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'read';
$r++;
$this->rights[$r][0] = $this->numero + 1;
$this->rights[$r][1] = 'Aufmaß bearbeiten';
$this->rights[$r][1] = 'EplanRightWrite';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'write';
$r++;
$this->rights[$r][0] = $this->numero + 2;
$this->rights[$r][1] = 'Eplan Einstellungen verwalten';
$this->rights[$r][1] = 'EplanRightAdmin';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'admin';

View file

@ -1,6 +1,12 @@
# Eplan — Deutsch
Module500037Name = Eplan
Module500037Desc = Verknüpfung zur ElektroPlan PWA — Raumaufmaß mit Bluetooth-Laser
Module500037DescLong = Fügt Aufträgen und Kundenkarten einen Reiter "Aufmaß" hinzu. Zeigt verknüpfte Grundrisse, öffnet die ElektroPlan PWA mit Auftrags-Kontext und ermöglicht PDF-Export direkt als Dolibarr-Dokument.
# Rechte
EplanRightRead = Aufmaß einsehen
EplanRightWrite = Aufmaß bearbeiten
EplanRightAdmin = Eplan-Einstellungen verwalten
EplanSetup = Eplan Einstellungen
EplanPwaUrl = PWA-URL

View file

@ -1,6 +1,12 @@
# Eplan — English
Module500037Name = Eplan
Module500037Desc = Link to ElektroPlan PWA — Room measurement with Bluetooth laser
Module500037DescLong = Adds an "Aufmass" tab to orders and customer cards. Shows linked floor plans, opens the ElektroPlan PWA with order context and allows PDF export directly as a Dolibarr document.
# Rights
EplanRightRead = View measurement
EplanRightWrite = Edit measurement
EplanRightAdmin = Manage Eplan settings
EplanSetup = Eplan Settings
EplanPwaUrl = PWA URL