diff --git a/CHANGELOG.md b/CHANGELOG.md index bb93161..8724e11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ## [UNRELEASED] +### Added + - GLPI 11 compatibility +- Rework main menu ### Fixes diff --git a/front/menu.php b/front/menu.php index 603f5df..2ece589 100644 --- a/front/menu.php +++ b/front/menu.php @@ -43,26 +43,29 @@ global $CFG_GLPI; $plugin_dir = $CFG_GLPI['root_doc'] . '/plugins/jamf'; + $links = []; if (Session::haveRight('plugin_jamf_mobiledevice', CREATE)) { $links[] = [ - 'name' => _x('menu', 'Import devices', 'jamf'), - 'url' => PluginJamfImport::getSearchURL(), - ]; - $links[] = [ - 'name' => _x('menu', 'Merge existing devices', 'jamf'), - 'url' => $plugin_dir . '/front/merge.php', + 'name' => _x('menu', 'Import devices', 'jamf'), + 'url' => PluginJamfImport::getSearchURL(), + 'description' => __('Discover the devices in your Jamf Pro instance to ensure data integrity and prevent the creation of unwanted assets.', 'jamf'), + 'action' => __s('Import', 'jamf'), + 'pics' => $plugin_dir . '/pics/import.png', ]; -} - -if (Session::haveRight('config', UPDATE)) { $links[] = [ - 'name' => _x('menu', 'Configuration', 'jamf'), - 'url' => Config::getFormURL() . '?forcetab=PluginJamfConfig$1', + 'name' => _x('menu', 'Merge existing devices', 'jamf'), + 'url' => $plugin_dir . '/front/merge.php', + 'description' => __('Compare imported devices with those already present in GLPI using unique identifiers and facilitate the consolidation.', 'jamf'), + 'action' => __s('Merge', 'jamf'), + 'pics' => $plugin_dir . '/pics/merge.png', ]; } TemplateRenderer::getInstance()->display('@jamf/menu.html.twig', [ - 'links' => $links, + 'links' => $links, + 'can_configure' => Session::haveRight('config', UPDATE), + 'config_url' => Config::getFormURL() . '?forcetab=PluginJamfConfig$1', ]); + Html::footer(); diff --git a/public/pics/import.png b/public/pics/import.png new file mode 100644 index 0000000..68eb8a8 Binary files /dev/null and b/public/pics/import.png differ diff --git a/public/pics/merge.png b/public/pics/merge.png new file mode 100644 index 0000000..56f7339 Binary files /dev/null and b/public/pics/merge.png differ diff --git a/templates/menu.html.twig b/templates/menu.html.twig index d14a4a9..1d7c430 100644 --- a/templates/menu.html.twig +++ b/templates/menu.html.twig @@ -27,31 +27,32 @@ # ------------------------------------------------------------------------- #} -{% if links|length > 0 %} -
| {{ _x('plugin_info', 'Jamf plugin', 'jamf') }} | -
|---|
| - {{ link.name }} - | -
{{ _x('error', 'You do not have access to any Jamf plugin items', 'jamf') }}
-{{ _x('error', 'Please check your profile permissions', 'jamf') }}
+