Fix issues cause by new location and other misc (#9490)

* Fix issues cause by new location and other misc
fix some queries so we return devices with null locations
remove unnecessary query of all ports on ports page lists
make locations menu available to non-admins for the legacy menu
fix a few issues with the old network-map

* fix graphs

* fix oxidized query
This commit is contained in:
Tony Murray
2018-11-29 13:04:11 -06:00
committed by GitHub
parent 8509c94ebf
commit 7c4fac489a
7 changed files with 31 additions and 27 deletions

View File

@@ -179,28 +179,29 @@ if (count($devices_groups) > 0) {
unset($group);
echo '</ul></li>';
}
if (Auth::user()->hasGlobalAdmin()) {
if ($config['show_locations']) {
if ($config['show_locations_dropdown']) {
$locations = getlocations();
if (count($locations) > 0) {
echo('
if ($config['show_locations']) {
if ($config['show_locations_dropdown']) {
$locations = getlocations();
if (count($locations) > 0) {
echo('
<li role="presentation" class="divider"></li>
<li class="dropdown-submenu">
<a href="#"><i class="fa fa-map-marker fa-fw fa-lg" aria-hidden="true"></i> Geo Locations</a>
<ul class="dropdown-menu scrollable-menu">
<li><a href="locations"><i class="fa fa-map-marker fa-fw fa-lg" aria-hidden="true"></i> All Locations</a></li>
');
foreach ($locations as $location) {
echo(' <li><a href="devices/location=' . $location['id'] . '/"><i class="fa fa-building fa-fw fa-lg" aria-hidden="true"></i> ' . htmlentities($location['location']) . ' </a></li>');
}
echo('
foreach ($locations as $location) {
echo(' <li><a href="devices/location=' . $location['id'] . '/"><i class="fa fa-building fa-fw fa-lg" aria-hidden="true"></i> ' . htmlentities($location['location']) . ' </a></li>');
}
echo('
</ul>
</li>
');
}
}
}
}
if (Auth::user()->hasGlobalAdmin()) {
echo '
<li role="presentation" class="divider"></li>';
if (is_module_enabled('poller', 'mib')) {