Dolibarr-Modul NetDiag — Netzwerk-Diagnose-Protokolle, JSON-API für die NetDiag-App
Find a file
Eduard Wisch ddb7161b00
All checks were successful
Deploy netdiag / deploy (push) Successful in 14s
Sync-500 behoben: tms-Feld auf notnull=0 [deploy]
protocols.php (POST) gab bei JEDEM Sync HTTP 500 zurueck — 0 Protokolle
wurden je gespeichert.

Ursache: protocol/device/measurement-Klassen deklarierten das tms-Feld im
$fields-Array als 'notnull' => 1. Dolibarrs createCommon() bricht ab (-1),
wenn ein notnull-Feld den Wert NULL hat und kein 'default' gesetzt ist.
tms wird von der App nie gesetzt (die DB fuellt es per CURRENT_TIMESTAMP),
also schlug jedes Insert fehl, bevor es ueberhaupt an die DB ging.

Fix: tms auf 'notnull' => 0 — so wie es der Dolibarr-Modul-Builder auch
generiert. Die DB-Spalte bleibt NOT NULL DEFAULT CURRENT_TIMESTAMP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:28:58 +02:00
.forgejo/workflows Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
admin Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
api API-Endpoint applog.php — Debug-Log der mobilen App empfangen [deploy] 2026-05-19 17:39:31 +02:00
class Sync-500 behoben: tms-Feld auf notnull=0 [deploy] 2026-05-19 18:28:58 +02:00
core/modules Modul-ID auf 500300 — 500100 kollidierte mit globalnotify [deploy] 2026-05-19 12:15:33 +02:00
langs Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
lib Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
sql API-Endpoint applog.php — Debug-Log der mobilen App empfangen [deploy] 2026-05-19 17:39:31 +02:00
ChangeLog.md Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
netdiag_object_tab.php Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
netdiagindex.php Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
netdiagprotocol_card.php Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00
README.md Initiales Commit — Dolibarr-Modul NetDiag [deploy] 2026-05-19 12:12:11 +02:00

NetDiag — Netzwerk-Diagnose für Dolibarr

Dolibarr-Modul für die Ablage von Netzwerk-Diagnose-Protokollen. Erfasst per mobiler App (siehe Projekt NetzwerkDiagnose/app) gefundene Geräte, Ports und Messungen und hängt die Protokolle dauerhaft an Kunde und Auftrag.

Funktionen

  • Datenmodell: Protokoll → Geräte → Messungen (llx_netdiag_*)
  • Tab Netzwerk-Diagnose an Kunde (thirdparty) und Auftrag (commande)
  • JSON-API unter /custom/netdiag/api/ für die mobile App (JWT-Auth)
  • PDF-Protokoll, wird im Dokumentenarchiv (ECM) abgelegt
  • Rechtesystem: netdiag → protocol → read/write/delete
  • Mehrsprachig (de_DE, en_US)
  • QR-Code zum App-Download in der Modul-Einrichtung

Installation

  1. Verzeichnis netdiag/ nach htdocs/custom/ auf den Dolibarr-Server kopieren.
  2. In Dolibarr: Einrichtung → Module → NetDiag aktivieren.
  3. Beim Aktivieren werden die Tabellen llx_netdiag_protocol, llx_netdiag_device, llx_netdiag_measurement angelegt und ein JWT-Schlüssel erzeugt.
  4. Benutzern das Recht NetDiag → Protokolle lesen/schreiben geben.

API-Endpunkte

Alle unter https://<dolibarr>/custom/netdiag/api/:

Endpunkt Methode Zweck
auth.php POST {login,password} Anmeldung → {token,expiresIn,user}
customers.php GET ?q= / ?id= Kundensuche / Kundendetail
orders.php GET ?open=1&q= / ?id= Auftragsliste / Auftragsdetail
protocols.php GET ?id= Protokoll mit Geräten + Messungen
protocols.php POST {action:"sync",protocol:{…}} Protokoll anlegen/aktualisieren (idempotent über clientUuid)
pdf.php GET ?id=&jwt= Protokoll-PDF streamen

Authentifizierung per Authorization: Bearer <token> oder ?jwt=<token>.

Einrichtung

Einrichtung → Module → NetDiag → Einstellungen:

  • Token-Gültigkeit (Sekunden)
  • App-Download-URL (APK) — wird als QR-Code angezeigt

Lizenz

GPLv3