Update prioritized NEXT tasks and related UI behavior

This commit is contained in:
2026-02-19 08:12:25 +01:00
parent ebd4740b7e
commit d9be0e1482
5 changed files with 25 additions and 23 deletions

View File

@@ -86,6 +86,7 @@ $pageTitle = $isEdit ? "Gerätetyp bearbeiten: " . htmlspecialchars($deviceType[
<textarea id="comment" name="comment" rows="3"
placeholder="z.B. Rack-Mount, 48 RJ45 + 4 SFP"><?php echo htmlspecialchars($deviceType['comment'] ?? ''); ?></textarea>
</div>
<?php if (!$isEdit): ?>
<div class="form-group">
<label for="seed_ports">Ports automatisch anlegen</label>
<input type="number" id="seed_ports" name="seed_ports" min="0" step="1"
@@ -106,6 +107,7 @@ $pageTitle = $isEdit ? "Gerätetyp bearbeiten: " . htmlspecialchars($deviceType[
</select>
<small>Wird beim automatischen Erstellen neuer Ports als Startwert gesetzt.</small>
</div>
<?php endif; ?>
</fieldset>
<!-- =========================

View File

@@ -21,7 +21,8 @@ $deviceTypeId = (int)($_POST['id'] ?? 0);
$name = trim($_POST['name'] ?? '');
$category = $_POST['category'] ?? 'other';
$comment = trim($_POST['comment'] ?? '');
$seedPortCount = max(0, (int)($_POST['seed_ports'] ?? 0));
$isCreate = $deviceTypeId <= 0;
$seedPortCount = $isCreate ? max(0, (int)($_POST['seed_ports'] ?? 0)) : 0;
$defaultPortTypeId = normalizeNullableInt($_POST['default_port_type_id'] ?? null);
$portRows = is_array($_POST['port_rows'] ?? null) ? $_POST['port_rows'] : [];
$rawShapes = trim($_POST['shape_definition'] ?? '');
@@ -131,7 +132,9 @@ if ($deviceTypeId > 0) {
}
}
seedDeviceTypePorts($sql, $deviceTypeId, $seedPortCount, $defaultPortTypeId);
if ($isCreate) {
seedDeviceTypePorts($sql, $deviceTypeId, $seedPortCount, $defaultPortTypeId);
}
syncDeviceTypePorts($sql, $deviceTypeId, $portRows);
$_SESSION['success'] = $deviceTypeId ? "Gerätetyp gespeichert" : "Fehler beim Speichern";