diff --git a/app/devices/devices.php b/app/devices/devices.php
index a56bc56a35..ed9adcceb5 100644
--- a/app/devices/devices.php
+++ b/app/devices/devices.php
@@ -150,12 +150,15 @@
//get the list
$sql = "select d.*, d2.device_label as alternate_label ";
$sql .= "from v_devices as d, v_devices as d2 ";
+ if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
+ $sql .= ", v_domains as d3 ";
+ }
$sql .= "where ( ";
$sql .= " d.device_uuid_alternate = d2.device_uuid ";
$sql .= " or d.device_uuid_alternate is null and d.device_uuid = d2.device_uuid ";
$sql .= ") ";
if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) {
- //echo __line__."
\n";
+ $sql .= " and d.domain_uuid = d3.domain_uuid ";
}
else {
$sql .= "and (";
@@ -285,19 +288,19 @@
echo " \n";
}
if ($_GET['show'] == "all" && permission_exists('device_all')) {
- echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param);
+ echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param);
}
- echo th_order_by('device_mac_address', $text['label-device_mac_address'], $order_by, $order);
- echo th_order_by('device_label', $text['label-device_label'], $order_by, $order);
+ echo th_order_by('device_mac_address', $text['label-device_mac_address'], $order_by, $order, null, null, $param);
+ echo th_order_by('device_label', $text['label-device_label'], $order_by, $order, null, null, $param);
if ($device_alternate) {
- echo th_order_by('device_template', $text['label-device_uuid_alternate'], $order_by, $order);
+ echo th_order_by('device_template', $text['label-device_uuid_alternate'], $order_by, $order, null, null, $param);
}
- echo th_order_by('device_vendor', $text['label-device_vendor'], $order_by, $order);
- echo th_order_by('device_template', $text['label-device_template'], $order_by, $order);
+ echo th_order_by('device_vendor', $text['label-device_vendor'], $order_by, $order, null, null, $param);
+ echo th_order_by('device_template', $text['label-device_template'], $order_by, $order, null, null, $param);
echo "