From f5262ceefade921c23d9c03b952c6a1f72ad00b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Oct 2024 15:25:19 +0200 Subject: [PATCH 1/4] Prepare 20.0.1 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 2a3c0a7e4e8..ec66d6cf58b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -35,7 +35,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '20.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '20.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 728ca6a2e6c6a84343387103891656778cd3012f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Oct 2024 15:28:48 +0200 Subject: [PATCH 2/4] Prepare 20.0.1 --- ChangeLog | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6f2c15dfe29..ee320d33ba3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,56 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 20.0.1 compared to 20.0.0 ***** + +FIX: #30960 show and search extrafields (#31026) +FIX: #31076 Bad position of hooks +FIX: #31152 +FIX: #31237 (#31239) +FIX: #31241 (#31245) +FIX: accounting transfer when nb of lines is not zero but amount is zero +FIX: Add same security test when nuploading files from API than from GUI (#31114) +FIX: allow "class" into search string in website module +FIX: autoselect the fiscal period by default +FIX: avoid odt errors (#31126) +FIX: Backport fix fatal error on price with some truncating setup +FIX: better compatibility with some old extrafield syntax filter +FIX: box_actions.php still uses fk_user_done which no longer exists (#31190) +FIX: Browser Notification ko with firefox +FIX: custom CSS for WebPortal (#31022) +FIX: Debug calculation of the delay of purchase order +FIX: Debug option WORKFLOW_TICKET_LINK_CONTRACT. Bad id stored. Bad +FIX: dolFICalculatePaymentReference for Finland in functions_fi.lib.php (#31281) +FIX: Duplicate trigger printFieldPreListTitle +FIX: edit contract of intervention broken by CSRF protection +FIX: error return missing in mo creation when qty to consume is <= 0 (#31134) +FIX: Extrafields does not appear on form +FIX: FATAL ERROR abusively triggered due to incomplete regex (#31052) +FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167) +FIX: late order search option (v18+) (#30692) +FIX: late propal search option (v18+) (#30687) +FIX: Maxi debug edit/delete accounting transaction +FIX: member must be found to search the linked partnership (WebPortal) (#30977) +FIX: Missing picto on user link +FIX: mysql error during dump for enable sandbox M999999 (#31116) +FIX: OAuth generation of token for Microsoft, Stripe and Generic +FIX: param id in website account list from third-party card (#30975) +FIX: Position of box for shipping address in PDF +FIX: Protection to avoid an extrafield to be mandatory if computed +FIX: removed unreachable code (#31141) +FIX: Remove wrong button +FIX: retrieving user specific constant +FIX: Revert storing of ticket files into event dir, too many troubles. +FIX: Selection of country - state in resource +FIX: State dropdown is not working on User card #31198 (#31205) +FIX: Tool to convert into utf8 or utf8mb4 +FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165) +FIX: Warning visible when it should not +FIX: webhook must send POST in body. Add WEBHOOK_POST_SEND_DATA_IN_BODY +FIX: when qty is not an integer, apply price() (#31138) +FIX: Wrong price for BOM with workstation (#31142) +FIX: determine multi-currency price on object line create tpl (#28021) + ***** ChangeLog for 20.0.0 compared to 19.0 ***** From 7faa9bad6777310993bbcf9f29fb2e66d5530c83 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:42:17 +0200 Subject: [PATCH 3/4] Fix 20.0 Action buttion url autocomplete (button dropdown part04) (#31266) * Fix dol get action buttion url autocomplette * change mailto * change mailto * Remove anonymous function * Remove anonymous function * Update functions.lib.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/functions.lib.php | 53 +++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 669aa6689d1..b8bb9d7f3a1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12264,6 +12264,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * $arrayforbutaction = array( * 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), * 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')), + * 30 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleOtherAction', 'urlraw' => '# || external Url || javascript: || tel: || mailto:' ), * ); ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right @@ -12329,17 +12330,18 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $langs->load($subbutton['lang']); } - if (!empty($subbutton['urlroot'])) { - $tmpurl = $subbutton['urlroot'].(empty($params['backtopage']) ? '' : '&backtopage='.urlencode($params['backtopage'])); + if (!empty($subbutton['urlraw'])) { + $tmpurl = $subbutton['urlraw']; // Use raw url, no url completion, use only what developer send } else { - $tmpurl = DOL_URL_ROOT.$subbutton['url'].(empty($params['backtopage']) ? '' : '&backtopage='.urlencode($params['backtopage'])); + $tmpurl = !empty($subbutton['urlroot']) ? $subbutton['urlroot'] : $subbutton['url']; + $tmpurl = dolCompletUrlForDropdownButton($tmpurl, $params, empty($subbutton['urlroot'])); } $subbuttonparam = array(); if (!empty($subbutton['attr'])) { $subbuttonparam['attr'] = $subbutton['attr']; } - $subbuttonparam['isDropDown'] = (empty($params['isDropDown']) ? $subbutton['isDropDown'] : $params['isDropDown']); + $subbuttonparam['isDropDown'] = (empty($params['isDropDown']) ? ($subbutton['isDropDown']??false) : $params['isDropDown']); $out .= dolGetButtonAction('', $langs->trans($subbutton['label']), 'default', $tmpurl, $subbutton['id'] ?? '', $subbutton['perm'], $subbuttonparam); } @@ -12351,10 +12353,11 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $langs->load($subbutton['lang']); } - if (!empty($subbutton['urlroot'])) { - $tmpurl = $subbutton['urlroot'].(empty($params['backtopage']) ? '' : '&backtopage='.urlencode($params['backtopage'])); + if (!empty($subbutton['urlraw'])) { + $tmpurl = $subbutton['urlraw']; // Use raw url, no url completion, use only what developer send } else { - $tmpurl = DOL_URL_ROOT.$subbutton['url'].(empty($params['backtopage']) ? '' : '&backtopage='.urlencode($params['backtopage'])); + $tmpurl = !empty($subbutton['urlroot']) ? $subbutton['urlroot'] : $subbutton['url']; + $tmpurl = dolCompletUrlForDropdownButton($tmpurl, $params, empty($subbutton['urlroot'])); } $out .= dolGetButtonAction('', $langs->trans($subbutton['label']), 'default', $tmpurl, '', $subbutton['perm'], $params); @@ -12489,6 +12492,42 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = } } + +/** + * An function to complete dropdown url in dolGetButtonAction + * + * @param string $url the Url to complete + * @param array|array $params params of dolGetButtonAction function + * @param bool $addDolUrlRoot to add root url + * @return string + */ +function dolCompletUrlForDropdownButton(string $url, array $params, bool $addDolUrlRoot = true) +{ + if (empty($url)) { + return ''; + } + + $parsedUrl = parse_url($url); + if ((isset($parsedUrl['scheme']) && in_array($parsedUrl['scheme'], ['javascript', 'mailto', 'tel'])) || strpos($url, '#') === 0) { + return $url; + } + + if (!empty($parsedUrl['query'])) { + // Use parse_str() function to parse the string passed via URL + parse_str($parsedUrl['query'], $urlQuery); + if (!isset($urlQuery['backtopage']) && isset($params['backtopage'])) { + $url.= '&backtopage='.urlencode($params['backtopage']); + } + } + + if (!isset($parsedUrl['scheme']) && $addDolUrlRoot) { + $url = DOL_URL_ROOT.$url; + } + + return $url; +} + + /** * Add space between dolGetButtonTitle * From 21eb8e585f88ea8306f9a093ff7a59bbffe1b9be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Oct 2024 20:48:37 +0200 Subject: [PATCH 4/4] Fix detection of text browser with w3m --- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/main.inc.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 360cbb05edf..0961223b02e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -603,8 +603,12 @@ function getBrowserInfo($user_agent) $version = end($reg); } elseif (preg_match('/l[iy]n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { // MS products at end - $name = 'lynxlinks'; + $name = 'textbrowser'; $version = empty($reg[3]) ? '' : $reg[3]; + } elseif (preg_match('/w3m\/([\d\.]+)/i', $user_agent, $reg)) { + // MS products at end + $name = 'textbrowser'; + $version = empty($reg[1]) ? '' : $reg[1]; } if ($tablet) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7a8f3cebb37..737053673f0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -510,7 +510,7 @@ if (GETPOST('theme', 'aZ09')) { } // Set global MAIN_OPTIMIZEFORTEXTBROWSER (must be before login part) -if (GETPOSTINT('textbrowser') || (!empty($conf->browser->name) && $conf->browser->name == 'lynxlinks')) { // If we must enable text browser +if (GETPOSTINT('textbrowser') || (!empty($conf->browser->name) && $conf->browser->name == 'textbrowser')) { // If we must enable text browser $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = 2; }