Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2026-02-20
### Fixed
- Tab icons
- Errors with permissions
- Map styles

## [2.0.0] - 2026-01-19
### Added
- GLPI 11 compatibility
Expand Down
22 changes: 19 additions & 3 deletions inc/geolocation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public static function geolocationRedefineMenu($menus)

public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!Session::haveRight(self::$rightname, READ)) {
return '';
}

if (in_array($item->getType(), PluginGeolocationConfig::getUsedItemtypes())) {
return self::createTabEntry(self::getTypeName());
}
Expand Down Expand Up @@ -176,7 +180,7 @@ public static function show($itemtype)
$typename = class_exists($itemtype) ? $itemtype::getTypeName($data['data']['totalcount']) : $itemtype;

echo "<div class='card border-top-0 rounded-0 search-as-map'>";
echo "<div class='card-body px-0' id='map_container'>";
echo "<div class='card-body px-0 shadow-sm rounded-3' id='map_container' style='overflow:hidden; margin: 10px; border: 1px solid #ddd;'>";
echo "<small class='text-muted p-1'>" . __('Search results for localized items only') . "</small>";
$js = "$(function() {
var map = initMap($('#map_container'), 'map', 'full');
Expand Down Expand Up @@ -302,6 +306,18 @@ public function showMap()
{
$rand = mt_rand();

echo "<style>
.search-as-map, #map_container, [id^='setlocation_container_'] {
border-radius: 12px !important;
box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
border: 1px solid #e1e4e8 !important;
overflow: hidden;
}
.leaflet-container {
background: #f8f9fa !important;
}
</style>";

echo "<div id='setlocation_container_{$rand}'></div>";
$js = "
$(function(){
Expand Down Expand Up @@ -400,7 +416,7 @@ function onMapClick(e) {

// Geolocation may be disabled in the browser (e.g. geo.enabled = false in firefox)
if (!navigator.geolocation) {
map_elt = initMap($('#setlocation_container_{$rand}'), 'setlocation_{$rand}', '200px');
map_elt = initMap($('#setlocation_container_{$rand}'), 'setlocation_{$rand}', '450px');
finalizeMap();
return;
}
Expand All @@ -427,7 +443,7 @@ function onMapClick(e) {
});
finalizeMap();
}, function() {
map_elt = initMap($('#setlocation_container_{$rand}'), 'setlocation_{$rand}', '200px');
map_elt = initMap($('#setlocation_container_{$rand}'), 'setlocation_{$rand}', '450px');
finalizeMap();
}, {enableHighAccuracy: true});
});";
Expand Down