diff --git a/pages/components.php b/pages/components.php index 28d9822..a38cdfd 100644 --- a/pages/components.php +++ b/pages/components.php @@ -15,19 +15,26 @@ if (!$user->hasPermission("MACHINEMANAGER_VIEW")) { $writeaccess = $user->hasPermission("MACHINEMANAGER_EDIT"); -$components = $database->select("components", ["compid", "serial", "machineid", "model", "manufacturer", "capacity"]); - $attachto = false; if (!empty($VARS["attachto"]) && Machine::exists($VARS["attachto"])) { $attachto = $VARS["attachto"]; + $components = $database->select("components", ["compid", "serial", "machineid", "model", "manufacturer", "capacity"], ["machineid" => null]); +} else { + $components = $database->select("components", ["compid", "serial", "machineid", "model", "manufacturer", "capacity"]); } ?> -