From c90e5094455511e5282ec3429741e8517ef1884b Mon Sep 17 00:00:00 2001 From: priojk Date: Mon, 13 Feb 2023 10:09:48 +0100 Subject: [PATCH] NEW: Possibility to link to German pages in help --- htdocs/main.inc.php | 17 ++++++++++++----- htdocs/mrp/mo_movements.php | 2 +- htdocs/mrp/mo_production.php | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1ea68780746..dc9d9d90c02 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -15,6 +15,7 @@ * Copyright (C) 2020 Charlene Benke * Copyright (C) 2021 Frédéric France * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2023 Joachim Küter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1397,7 +1398,7 @@ if (!function_exists("llxHeader")) { * @param string $head Optionnal head lines * @param string $title HTML title * @param string $help_url Url links to help page - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $target Target to use on links * @param int $disablejs More content into html header @@ -1958,7 +1959,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr * @param array $arrayofcss Array of css files to add in header * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @param string $helppagename Name of wiki page for help ('' by default). - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @return void */ @@ -2091,7 +2092,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $helppresent = ''; if (empty($helppagename)) { - $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios'; + $helppagename = 'EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios|DE:Benutzerdokumentation'; } else { $helppresent = 'helppresent'; } @@ -2888,7 +2889,7 @@ function top_menu_search() * * @param array $menu_array_before Table of menu entries to show before entries of menu handler. This param is deprectaed and must be provided to ''. * @param string $helppagename Name of wiki page for help ('' by default). - * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now. * @param array $menu_array_after Table of menu entries to show after entries of menu handler @@ -3176,7 +3177,7 @@ function main_area($title = '') /** * Return helpbaseurl, helppage and mode * - * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff...' or 'http://localpage') + * @param string $helppagename Page name ('EN:xxx,ES:eee,FR:fff,DE:ddd...' or 'http://localpage') * @param Translate $langs Language * @return array Array of help urls */ @@ -3206,6 +3207,12 @@ function getHelpParamFor($helppagename, $langs) $helppage = $reg[1]; } } + if (preg_match('/^de/i', $langs->defaultlang)) { + $helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s'; + if (preg_match('/DE:([^|]+)/i', $helppagename, $reg)) { + $helppage = $reg[1]; + } + } if (empty($helppage)) { // If help page not already found $helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s'; if (preg_match('/EN:([^|]+)/i', $helppagename, $reg)) { diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index c0357aa5e4b..a82f36c913e 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -257,7 +257,7 @@ $productlot = new ProductLot($db); $warehousestatic = new Entrepot($db); $userstatic = new User($db); -$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication'; +$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication|DE:Modul_Fertigungsauftrag'; llxHeader('', $langs->trans('Mo'), $help_url); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index b274f4b89df..4e149201ba3 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -431,7 +431,7 @@ $tmpwarehouse = new Entrepot($db); $tmpbatch = new Productlot($db); $tmpstockmovement = new MouvementStock($db); -$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication'; +$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication|DE:Modul_Fertigungsauftrag'; llxHeader('', $langs->trans('Mo'), $help_url, '', 0, 0, array('/mrp/js/lib_dispatch.js.php')); $newToken = newToken();