diff --git a/api/protocols.php b/api/protocols.php index 224f193..ac3e179 100644 --- a/api/protocols.php +++ b/api/protocols.php @@ -140,6 +140,9 @@ $protocol->standort = isset($p['location']) ? (string) $p['location'] : $protocol->subnet = isset($p['subnet']) ? (string) $p['subnet'] : ''; $protocol->status = isset($p['status']) ? (int) $p['status'] : NetDiagProtocol::STATUS_DRAFT; $protocol->note = isset($p['note']) ? (string) $p['note'] : ''; +// tms explizit setzen — die Spalte ist NOT NULL ohne brauchbaren NULL-Default +// (explicit_defaults_for_timestamp=1), createCommon würde sonst NULL einfügen. +$protocol->tms = dol_now(); if ($exists > 0) { $result = $protocol->update($user, 1); @@ -168,6 +171,7 @@ foreach ($devicesIn as $d) { $dev->vendor = isset($d['vendor']) ? (string) $d['vendor'] : ''; $dev->devicetype = isset($d['deviceType']) ? (string) $d['deviceType'] : ''; $dev->note = isset($d['note']) ? (string) $d['note'] : ''; + $dev->tms = dol_now(); if ($dev->create($user, 1) <= 0) { $db->rollback(); netdiag_api_error('Gerät speichern fehlgeschlagen: '.$dev->error, 500); @@ -191,6 +195,7 @@ foreach ($measIn as $m) { $meas->result = isset($m['result']) ? json_encode($m['result'], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) : null; $meas->measure_status = isset($m['measureStatus']) ? (int) $m['measureStatus'] : 0; $meas->date_measure = !empty($m['dateMeasure']) ? (int) $m['dateMeasure'] : dol_now(); + $meas->tms = dol_now(); if ($meas->create($user, 1) <= 0) { $db->rollback(); netdiag_api_error('Messung speichern fehlgeschlagen: '.$meas->error, 500);