NEW: Possibility to link to German pages in help

This commit is contained in:
priojk 2023-02-13 10:09:48 +01:00
parent ec45afb05f
commit c90e509445
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) 2021 Frédéric France <frederic.france@netlogic.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
* 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)) {

View File

@ -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);

View File

@ -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();