diff --git a/CHANGELOG.md b/CHANGELOG.md index 714326e..7bfcef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [UNRELEASED] +### Added + +- Rework main menu + ### Fixes - SQL error when merging the Jamf device linked to a GLPI asset diff --git a/front/menu.php b/front/menu.php index def095d..4701130 100644 --- a/front/menu.php +++ b/front/menu.php @@ -46,22 +46,25 @@ $links = []; if (Session::haveRight('plugin_jamf_mobiledevice', CREATE)) { $links[] = [ - 'name' => _x('menu', 'Import devices', 'jamf'), - 'url' => PluginJamfImport::getSearchURL(), + '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', ]; $links[] = [ - 'name' => _x('menu', 'Merge existing devices', 'jamf'), - 'url' => "{$plugin_dir}/front/merge.php", - ]; -} -if (Session::haveRight('config', UPDATE)) { - $links[] = [ - 'name' => _x('menu', 'Configuration', 'jamf'), - 'url' => Config::getFormURL() . '?forcetab=PluginJamfConfig', + '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/pics/import.png b/pics/import.png new file mode 100644 index 0000000..68eb8a8 Binary files /dev/null and b/pics/import.png differ diff --git a/pics/merge.png b/pics/merge.png new file mode 100644 index 0000000..56f7339 Binary files /dev/null and b/pics/merge.png differ diff --git a/templates/menu.html.twig b/templates/menu.html.twig index a7c936e..1c08e89 100644 --- a/templates/menu.html.twig +++ b/templates/menu.html.twig @@ -29,31 +29,32 @@ */ #} -{% if links|length > 0 %} -
- - - - - - - - {% for link in links %} - - - - {% endfor %} - -
{{ _x('plugin_info', 'Jamf plugin', 'jamf') }}
- {{ link.name }} -
-
-{% else %} -
-