From 1dae21e6084774c0181c2e4e5cb8ed0a56cfb3cc Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 9 Mar 2021 18:44:06 +0100 Subject: [PATCH 01/19] FIX: Buttons to disable bindings not working --- htdocs/accountancy/admin/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 00922f90454..64ebf2d1ab0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -7,6 +7,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Ferran Marcet * * 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 @@ -385,11 +386,11 @@ foreach ($list_binding as $key) print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -398,11 +399,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -411,11 +412,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } From ccf71cd980bf12c34bae4708faba2f853b21849f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 10 Mar 2021 11:56:44 +0100 Subject: [PATCH 02/19] fix modulebuilder boxes showboxes --- htdocs/core/class/html.formother.class.php | 4 +++- htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c71029769f2..090d1d796eb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1076,7 +1076,7 @@ class FormOther { if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user } - +//var_dump($boxidactivatedforuser); // Define selectboxlist $arrayboxtoactivatelabel = array(); if (!empty($user->conf->$confuserzone)) @@ -1209,6 +1209,7 @@ class FormOther if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES; $ii = 0; + foreach ($boxactivated as $key => $box) { if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; @@ -1220,6 +1221,7 @@ class FormOther //print 'box_order '.$boxactivated[$ii]->box_order.'
'; // Show box $box->loadBox($box_max_lines); + //var_dump($key,$box); $boxlista .= $box->showBox(null, null, 1); } } diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index e356792ed42..46fe523600d 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -206,6 +206,6 @@ class mymodulewidget1 extends ModeleBoxes { // You may make your own code here… // … or use the parent's class function using the provided head and contents templates - parent::showBox($this->info_box_head, $this->info_box_contents); + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } From bd6aae71a2522cb373a1758675547b11ac7d5bd3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 10 Mar 2021 11:58:21 +0100 Subject: [PATCH 03/19] fix modulebuilder boxes showboxes --- htdocs/core/class/html.formother.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 090d1d796eb..c71029769f2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1076,7 +1076,7 @@ class FormOther { if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user } -//var_dump($boxidactivatedforuser); + // Define selectboxlist $arrayboxtoactivatelabel = array(); if (!empty($user->conf->$confuserzone)) @@ -1209,7 +1209,6 @@ class FormOther if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES; $ii = 0; - foreach ($boxactivated as $key => $box) { if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; @@ -1221,7 +1220,6 @@ class FormOther //print 'box_order '.$boxactivated[$ii]->box_order.'
'; // Show box $box->loadBox($box_max_lines); - //var_dump($key,$box); $boxlista .= $box->showBox(null, null, 1); } } From b798535af9ddf8c02049eef1267d23e9de78d33a Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 10 Mar 2021 14:15:03 +0100 Subject: [PATCH 04/19] FIX create sociales : keep values error form --- htdocs/compta/paiement_charge.php | 5 +++-- htdocs/compta/sociales/card.php | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 715a0851c65..7ed5baafcab 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -248,7 +248,7 @@ if ($action == 'create') print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; print ''; @@ -296,6 +296,7 @@ if ($action == 'create') print ''.price($objp->amount - $sumpaid).""; print ''; + if ($sumpaid < $objp->amount) { $namef = "amount_".$objp->id; @@ -304,7 +305,7 @@ if ($action == 'create') print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d2609fd4ff5..1b5bf72727f 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -45,7 +45,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks')); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); @@ -91,7 +91,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) { if ($action == 'classin' && $user->rights->tax->charges->creer) { $object->fetch($id); - $object->setProject(GETPOST('projectid')); + $object->setProject(GETPOST('fk_project')); } if ($action == 'setlib' && $user->rights->tax->charges->creer) @@ -375,21 +375,21 @@ if ($action == 'create') print ''.$langs->trans("Project").''; - $numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + $numproject = $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1); print ''; } // Payment Mode print ''.$langs->trans('PaymentMode').''; - $form->select_types_paiements($mode_reglement_id, 'mode_reglement_id'); + $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id'); print ''; // Bank Account if (!empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + $form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 1); print ''; } @@ -482,7 +482,7 @@ if ($id > 0) $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { From c209d9b45ef3b9f0b8f13c570a54c9e777935aa1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Mar 2021 15:29:05 +0100 Subject: [PATCH 05/19] Update paiement_charge.php --- htdocs/compta/paiement_charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 7ed5baafcab..aed2708e56c 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -305,7 +305,7 @@ if ($action == 'create') print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'"); $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { From 05532ca6b7092210695d92e3f07d70a874cb1b1b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:35:13 +0100 Subject: [PATCH 06/19] FIX missing video mime --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 052e5e3efc9..02b7b209124 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8387,8 +8387,9 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) // Audio if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { $mime = 'audio'; $imgmime = 'audio.png'; $famime = 'file-audio-o'; } // Video - if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.webm$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.(ogv|ogg)$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.xvid$/i', $tmpfile)) { $mime = 'video/xvid'; $imgmime = 'video.png'; $famime = 'file-video-o'; } From 290f49a3e07d9524bf3e99b4db3b3492b1b41989 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:39:36 +0100 Subject: [PATCH 07/19] FIX wrong extension --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 02b7b209124..6ffd88ea45b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8388,7 +8388,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) if (preg_match('/\.(mp3|ogg|au|wav|wma|mid)$/i', $tmpfile)) { $mime = 'audio'; $imgmime = 'audio.png'; $famime = 'file-audio-o'; } // Video if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.(ogv|ogg)$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } From 5375add08c9e982ee9155552c6619a0a14c244d6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Mar 2021 08:41:56 +0100 Subject: [PATCH 08/19] FIX just add mp4 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6ffd88ea45b..b63f9d72f26 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8389,7 +8389,7 @@ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) // Video if (preg_match('/\.mp4$/i', $tmpfile)) { $mime = 'video/mp4'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.ogv$/i', $tmpfile)) { $mime = 'video/ogg'; $imgmime = 'video.png'; $famime = 'file-video-o'; } - if (preg_match('/\.(webm|wbm)$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } + if (preg_match('/\.webm$/i', $tmpfile)) { $mime = 'video/webm'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.avi$/i', $tmpfile)) { $mime = 'video/x-msvideo'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.divx$/i', $tmpfile)) { $mime = 'video/divx'; $imgmime = 'video.png'; $famime = 'file-video-o'; } if (preg_match('/\.xvid$/i', $tmpfile)) { $mime = 'video/xvid'; $imgmime = 'video.png'; $famime = 'file-video-o'; } From 9956373a1474a6fa697148c510d6937add12e3d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Mar 2021 12:42:26 +0100 Subject: [PATCH 09/19] Backport the log to detect module that claim a new token. --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 78ed3d82bda..437e024a3ae 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -421,6 +421,7 @@ if (!defined('NOTOKENRENEWAL')) // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number $_SESSION['newtoken'] = $token; + dol_syslog("NEW TOKEN reclaimed by : " . $_SERVER['PHP_SELF'], LOG_DEBUG); } //dol_syslog("aaaa - ".defined('NOCSRFCHECK')." - ".$dolibarr_nocsrfcheck." - ".$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN." - ".$_SERVER['REQUEST_METHOD']." - ".GETPOST('token', 'alpha').' '.$_SESSION['token']); From cab0e0ee052b7074d5901aceb414fe54d9b4e25f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Mar 2021 12:45:45 +0100 Subject: [PATCH 10/19] Prepare 13.0.2 --- 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 1cc471e0244..7a68d2c3099 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 7a2e28497d3ff5010592ffb96885b76c43d528c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Mar 2021 13:14:53 +0100 Subject: [PATCH 11/19] fix number is already used doesn't propose new code with elephant --- htdocs/core/modules/societe/mod_codeclient_elephant.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index c7a2d600ede..b6113558822 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -303,6 +303,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode { $this->error = $result; return -6; + } else { + $is_dispo = $this->verif_dispo($db, $code, $soc, $type); + if ($is_dispo <> 0) { + $result = -3; + } } } From 815a7683a252740629c5202868c40ee88525d492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Mar 2021 16:48:43 +0100 Subject: [PATCH 12/19] force getnextref if project create fail --- htdocs/projet/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 711d1b02935..db710e2715d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -223,7 +223,7 @@ if (empty($reshook)) else { $db->rollback(); - + unset($_POST["ref"]); $action = 'create'; } } From 401c209a76ab9d018c69d55cc02b4354da48f621 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Mar 2021 23:54:52 +0100 Subject: [PATCH 13/19] Prepare 13.0.2 --- ChangeLog | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6556db79da2..5eb26da852f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,51 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 13.0.2 compared to 13.0.1 ***** + +FIX: 11.0 - $this->socid injected in query without checking for empty value +FIX: #16096 #16085 Any call of ajax pages must provide the token +FIX: #16296 +FIX: #16325 +FIX: #16341 : Fetch the Product ExtraFields in Shippment lines +FIX: #16366 +FIX: #16393 Do not sanitize +FIX: #16420 #16423 #16488 #16477 +FIX: #16431 +FIX: #16465 +FIX: #16480 +FIX: #16485 +FIX: #16487 +FIX: #16503 +FIX: #16530 +FIX: #16533 +FIX: Add "Now" link on social charges creation card +FIX: avoid undefined url and missing token +FIX: Bad project filter in ticket list +FIX: Buttons to disable bindings not working +FIX: class not found when creating recuring invoice from invoice+discount +FIX: File attachment on lots +FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice +FIX: hourglass and hide button to pay +FIX: massaction validate invoice do not regenerate pdf +FIX: missing mp4 video mime +FIX: picto on shipment to reset qty to 0. Some quantities were not reset. +FIX: Protection to avoid #16504 +FIX: rounding amount on card updating +FIX: Rounding amount on social charges card updating +FIX: select list dependencies now work for ModuleBuilder sellist field +FIX: Status in popup of member in widget +FIX: status on tooltip on widgets +FIX: Timezone management for datetime on list of events +FIX: Timezone management for datetime with modulebuilder and extrafields +FIX: Total_ht not show in contract link element +FIX: use post instead get +FIX: use var "saved_url" instead global var "$url" +FIX: Various payment - Missing fields for check transmitter & bank name +FIX: warning if setup of chart of account is not yet done. +FIX: wrong extension + + ***** ChangeLog for 13.0.1 compared to 13.0.0 ***** FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already. From 7bbcf4aa00007f0caffa0244b679c99d7d34f9bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Mar 2021 11:21:14 +0100 Subject: [PATCH 14/19] FIX #16629 --- htdocs/public/ticket/create_ticket.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 1c81faca1ad..678d45f70ca 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -307,7 +307,9 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) { //setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); // Make a redirect to avoid to have ticket submitted twice if we make back - setEventMessages($langs->trans('MesgInfosPublicTicketCreatedWithTrackId', ''.$object->track_id.'', ''.$object->ref.''), null, 'warnings'); + $messagetoshow = $langs->trans('MesgInfosPublicTicketCreatedWithTrackId', '{s1}', '{s2}'); + $messagetoshow = str_replace(array('{s1}', '{s2}'), array(''.$object->track_id.'', ''.$object->ref.''), $messagetoshow); + setEventMessages($messagetoshow, null, 'warnings'); setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); header("Location: index.php"); exit; From 614720fc0a898fbbdedbd013926b4f68362c86d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Mar 2021 14:51:36 +0100 Subject: [PATCH 15/19] FIX #16671 Can not generate zip file of documents in backup tool --- htdocs/admin/tools/export_files.php | 3 ++- test/phpunit/FilesLibTest.php | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 6e0b0508a07..5ec1d5d56f7 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -113,7 +113,8 @@ $utils = new Utils($db); if ($compression == 'zip') { $file .= '.zip'; - $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.back|\.old|\.log|[\\\/]temp[\\\/]|documents[\\\/]admin[\\\/]documents[\\\/])/i'); + $excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; + $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles); if ($ret < 0) { if ($ret == -2) { diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index d80abac42fe..ef84b8db752 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -425,6 +425,13 @@ class FilesLibTest extends PHPUnit\Framework\TestCase $result=dol_uncompress($fileout, $dirout); print __METHOD__." result=".join(',', $result)."\n"; $this->assertEquals(0, count($result), "Pb with dol_uncompress_file of file ".$fileout); + + $excludefiles = '/(\.back|\.old|\.log|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i'; + if (preg_match($excludefiles, 'a/temp/b')) { echo '----- Regex OK -----'."\n"; } + $result=dol_compress_dir($dirout, $conf->admin->dir_temp.'/testdir.zip', 'zip', $excludefiles); + print __METHOD__." result=".$result."\n"; + print join(', ', $conf->logbuffer); + $this->assertGreaterThanOrEqual(1, $result, "Pb with dol_compress_dir of ".$dirout." into ".$conf->admin->dir_temp.'/testdir.zip'); } /** From 8243ffc174603084237bf6f6ce4f395811e7d617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Mar 2021 14:53:40 +0100 Subject: [PATCH 16/19] Changelog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5eb26da852f..e685669f01d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,8 @@ FIX: #16487 FIX: #16503 FIX: #16530 FIX: #16533 +FIX: #16629 +FIX: #16671 Can not generate zip file of documents in backup tool FIX: Add "Now" link on social charges creation card FIX: avoid undefined url and missing token FIX: Bad project filter in ticket list From 631aad94e78bdf5e996e5b97a2d2c628aa9b3192 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Mon, 15 Mar 2021 15:05:01 +0100 Subject: [PATCH 17/19] FIX PHP version requirement in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d26bbb05ad9..833bd2a633b 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "vendor-dir" : "htdocs/includes" }, "require" : { - "php" : ">=5.5.0", + "php" : ">=5.6.0", "ext-curl" : "*", "ckeditor/ckeditor" : "4.12.1", "mike42/escpos-php" : "2.2", From 76cf3da449e16cefe5a1f9df567e8513bb0c6f78 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 15 Mar 2021 18:10:59 +0100 Subject: [PATCH 18/19] FIX: Cannot delete a batch material from item receipts --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 6a42ad77aa3..13989286e33 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -411,7 +411,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn $product = $supplierorderdispatch->fk_product; $price = GETPOST('price'); $comment = $supplierorderdispatch->comment; - $eatby = $supplierorderdispatch->fk_product; + $eatby = $supplierorderdispatch->eatby; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; From 95ede60de22dd9f8de3aef5e8e92d438ab1d54f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Mar 2021 14:46:00 +0100 Subject: [PATCH 19/19] Fix css --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index fe81b57dbf5..ae7cbee0cf0 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -465,7 +465,7 @@ if ($num > 0) print $object->priority; print ''; - print ''; + print ''; if ($obj->jobtype == 'method') { $text = $langs->trans("CronClass");