Merge pull request #23891 from bloxera/new_helplink_de

NEW: Possibility to link to German pages in help
This commit is contained in:
Laurent Destailleur 2023-02-13 18:13:51 +01:00 committed by GitHub
commit 0f294d3d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 7 deletions

View File

@ -15,6 +15,7 @@
* Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com> * Copyright (C) 2020 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2023 Joachim Küter <git-jk@bloxera.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 $head Optionnal head lines
* @param string $title HTML title * @param string $title HTML title
* @param string $help_url Url links to help page * @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 * For other external page: http://server/url
* @param string $target Target to use on links * @param string $target Target to use on links
* @param int $disablejs More content into html header * @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 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 $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). * @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 * For other external page: http://server/url
* @return void * @return void
*/ */
@ -2091,7 +2092,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$helppresent = ''; $helppresent = '';
if (empty($helppagename)) { 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 { } else {
$helppresent = 'helppresent'; $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 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). * @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 * 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 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 * @param array $menu_array_after Table of menu entries to show after entries of menu handler
@ -3177,7 +3178,7 @@ function main_area($title = '')
/** /**
* Return helpbaseurl, helppage and mode * 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 * @param Translate $langs Language
* @return array Array of help urls * @return array Array of help urls
*/ */
@ -3207,6 +3208,12 @@ function getHelpParamFor($helppagename, $langs)
$helppage = $reg[1]; $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 if (empty($helppage)) { // If help page not already found
$helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s'; $helpbaseurl = 'http://wiki.dolibarr.org/index.php/%s';
if (preg_match('/EN:([^|]+)/i', $helppagename, $reg)) { if (preg_match('/EN:([^|]+)/i', $helppagename, $reg)) {

View File

@ -257,7 +257,7 @@ $productlot = new ProductLot($db);
$warehousestatic = new Entrepot($db); $warehousestatic = new Entrepot($db);
$userstatic = new User($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); llxHeader('', $langs->trans('Mo'), $help_url);

View File

@ -431,7 +431,7 @@ $tmpwarehouse = new Entrepot($db);
$tmpbatch = new Productlot($db); $tmpbatch = new Productlot($db);
$tmpstockmovement = new MouvementStock($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')); llxHeader('', $langs->trans('Mo'), $help_url, '', 0, 0, array('/mrp/js/lib_dispatch.js.php'));
$newToken = newToken(); $newToken = newToken();