From 37276cae5f52c6d95c4d19977ec76fda7eb2a07c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:27:50 +0200 Subject: [PATCH 01/12] FIX: payment card: misleading message when delete button disabled --- htdocs/compta/paiement/card.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 59cb153bb54..004de242952 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -522,8 +522,14 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { } } +$params = array(); + +if (! empty($title_button)) { + $params['attr'] = array('title' => $title_button); +} + if ($user->socid == 0 && $action == '') { - print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete); + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $user->rights->facture->paiement && !$disable_delete, $params); } print ''; From e5f9cdd1f47bf392081eafcbeb057c0b26fea283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Aug 2023 18:56:51 +0200 Subject: [PATCH 02/12] fix export --- htdocs/install/upgrade2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index b9544de7f24..522f8c40c17 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4122,6 +4122,7 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/menus/standard/auguria_frontoffice.php', '/core/menus/standard/eldy_backoffice.php', '/core/menus/standard/eldy_frontoffice.php', + '/core/modules/export/exports_csv.modules.php', '/core/modules/mailings/contacts2.modules.php', '/core/modules/mailings/contacts3.modules.php', '/core/modules/mailings/contacts4.modules.php', From ea91aadbdc0bf78c36e1e61e79ea3d29f1ba8029 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Thu, 31 Aug 2023 15:33:17 +0200 Subject: [PATCH 03/12] Fix #25752 fatal error on supplier payment --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 04182b53a66..aab16079aef 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7072,7 +7072,7 @@ class Form $arrayofdateof = $adddateof; } foreach ($arrayofdateof as $valuedateof) { - $tmpadddateof = $valuedateof['adddateof']; + $tmpadddateof = $valuedateof['adddateof'] != '' ? $valuedateof['adddateof'] : 0; $tmplabeladddateof = $valuedateof['labeladddateof']; $tmparray = dol_getdate($tmpadddateof); if (empty($tmplabeladddateof)) { From 392f7415d7979c65da452ac8e6db5b211e9105ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2023 22:25:43 +0200 Subject: [PATCH 04/12] css --- htdocs/opensurvey/wizard/index.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/opensurvey/wizard/index.php b/htdocs/opensurvey/wizard/index.php index 4542ecfa3bd..ef7a35dd303 100644 --- a/htdocs/opensurvey/wizard/index.php +++ b/htdocs/opensurvey/wizard/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013 Laurent Destailleur * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Regis Houssin - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France * * 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 @@ -55,13 +55,18 @@ print '
'; print '
'; print '
'; print '
'; -print ''; +print ''; print '
'; print '
'; print '
'; -print ''; +print ''; print '
'; print '
'; +print '
'; print '
'; print ''; From a16dc7ac5cc40318dd222d9b807462ef8fa9ea17 Mon Sep 17 00:00:00 2001 From: tnegre Date: Wed, 30 Aug 2023 11:46:33 +0200 Subject: [PATCH 05/12] FIX date survey : button to add dates would not work. Session would store cells numbers which would stay to 10 for next surveys created. --- htdocs/opensurvey/wizard/choix_date.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index d8f89b18e16..d2e76cb0f18 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -179,6 +179,7 @@ if (GETPOST('confirmation')) { // Add survey into database if (!$erreur && $erreurNb == 0) { $_SESSION["toutchoix"] = substr("$choixdate", 1); + unset($_SESSION["nbrecaseshoraires"]); ajouter_sondage(); } @@ -215,7 +216,7 @@ llxHeader('', $langs->trans("OpenSurvey"), "", '', 0, 0, $arrayofjs, $arrayofcss //nombre de cases par défaut if (!isset($_SESSION["nbrecaseshoraires"])) { $_SESSION["nbrecaseshoraires"] = 5; -} elseif (GETPOST('ajoutcases') && $_SESSION["nbrecaseshoraires"] == 5) { +} elseif ((GETPOST('ajoutcases') || GETPOST("ajoutcases_y")) && $_SESSION["nbrecaseshoraires"] == 5) { $_SESSION["nbrecaseshoraires"] = 10; } From d0c5fc77322857bebc75d72911ae02a0dded50fc Mon Sep 17 00:00:00 2001 From: tnegre Date: Wed, 30 Aug 2023 12:18:06 +0200 Subject: [PATCH 06/12] FIX: when adding new times on a survey, all hours would be erased. --- htdocs/opensurvey/wizard/choix_date.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index d2e76cb0f18..d7bbe577734 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -218,8 +218,20 @@ if (!isset($_SESSION["nbrecaseshoraires"])) { $_SESSION["nbrecaseshoraires"] = 5; } elseif ((GETPOST('ajoutcases') || GETPOST("ajoutcases_y")) && $_SESSION["nbrecaseshoraires"] == 5) { $_SESSION["nbrecaseshoraires"] = 10; + //On sauvegarde les heures deja entrées + if (issetAndNoEmpty('totalchoixjour', $_SESSION) === true) { + $nbofchoice = count($_SESSION["totalchoixjour"]); + for ($i = 0; $i < $nbofchoice; $i++) { + //affichage des 5 cases horaires + for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { + $horairesi = GETPOST("horaires".$i); + $_SESSION["horaires$i"][$j] = $horairesi[$j]; + } + } + } } + //valeurs de la date du jour actuel $jourAJ = date("j"); $moisAJ = date("n"); @@ -408,7 +420,7 @@ if (issetAndNoEmpty('choixjourajout')) { $k = $i + 1; if (issetAndNoEmpty('horaires'.$i) === true && issetAndNoEmpty($i, $_POST['horaires'.$i]) === true) { for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { - $horairesi = GETPOST("horaires".$i); + $horairesi = GETPOST("horaires".$i, 'array'); $_SESSION["horaires$i"][$j] = $horairesi[$j]; } } @@ -453,7 +465,7 @@ if (issetAndNoEmpty('reporterhoraires')) { } } -//report des horaires dans toutes les cases +//effacer les horaires dans toutes les cases if (issetAndNoEmpty('resethoraires')) { $nbofchoice = count($_SESSION["totalchoixjour"]); for ($i = 0; $i < $nbofchoice; $i++) { From fdfa9ca39df1dd51c29c69266c93f9062e9aaaa6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2023 22:48:13 +0200 Subject: [PATCH 07/12] Fix CSS --- htdocs/opensurvey/wizard/choix_date.php | 27 +++++++++++++++---------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index d7bbe577734..62e262ca6f9 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -360,11 +360,13 @@ print ''."\n"; print '
'."\n"; print '
'."\n"; print ''."\n"; // The div class=center has no effect on table, so we must keep the align=center for table -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''."\n"; print '
'.$motmois.' '.$_SESSION["annee"].'
'; -print ''; -print '
'; +print '
'.$motmois.' '.$_SESSION["annee"].'
'; +print ''; +print '
'; print '
'."\n"; print '
'."\n"; @@ -493,7 +495,7 @@ for ($i = 0; $i < $nbrejourmois + $premierjourmois; $i++) { for ($j = 0; $j < $nbofchoice; $j++) { // show red buttons if (date("j", $_SESSION["totalchoixjour"][$j]) == $numerojour && date("n", $_SESSION["totalchoixjour"][$j]) == $_SESSION["mois"] && date("Y", $_SESSION["totalchoixjour"][$j]) == $_SESSION["annee"]) { - print ''."\n"; + print ''."\n"; $dejafait = $numerojour; } } @@ -503,10 +505,10 @@ for ($i = 0; $i < $nbrejourmois + $premierjourmois; $i++) { if (isset($dejafait) === false || $dejafait != $numerojour) { // green button if (($numerojour >= $jourAJ && $_SESSION["mois"] == $moisAJ && $_SESSION["annee"] == $anneeAJ) || ($_SESSION["mois"] > $moisAJ && $_SESSION["annee"] == $anneeAJ) || $_SESSION["annee"] > $anneeAJ) { - print ''."\n"; + print ''."\n"; } else { // grey button - print ''.$numerojour.''."\n"; + print ''.$numerojour.''."\n"; } } } @@ -543,12 +545,13 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) { print ''."\n"; - //affichage de la liste des jours choisis + // Show list of selected days + $nbofchoice = count($_SESSION["totalchoixjour"]); for ($i = 0; $i < $nbofchoice; $i++) { print ''."\n"; - print ''.dol_print_date($_SESSION["totalchoixjour"][$i], 'daytext').' ('.dol_print_date($_SESSION["totalchoixjour"][$i], '%A').')'; + print ''.dol_print_date($_SESSION["totalchoixjour"][$i], 'daytext').' ('.dol_print_date($_SESSION["totalchoixjour"][$i], '%A').')'; //affichage des cases d'horaires for ($j = 0; $j < $_SESSION["nbrecaseshoraires"]; $j++) { @@ -568,7 +571,9 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) || $erreur) { // show buttons to cancel, delete days or create survey print ''."\n"; print ''."\n"; - print ''."\n"; + print ''; + print ''; + print ''."\n"; print''."\n"; print ''."\n"; print '


'."\n"; From 73463765d5917f63ba4abd78b7cb85543fc8ebc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2023 16:13:48 +0200 Subject: [PATCH 08/12] FIX fatal error with some parameters --- htdocs/core/tpl/extrafields_list_search_param.tpl.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index 7e58e106882..2ab5749b4e0 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -31,8 +31,14 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr $param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); $val = ''; } - if ($val != '') { - $param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val); + if ($val !== '') { + if (is_array($val)) { + foreach ($val as $val2) { + $param .= '&'.$search_options_pattern.$tmpkey.'[]='.urlencode($val2); + } + } else { + $param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val); + } } } } From 86b77b507e4b1e42b562e393fa1213318b3654b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Aug 2023 23:42:45 +0200 Subject: [PATCH 09/12] Fix reposition --- htdocs/admin/mails_templates.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 6976682dc1f..6d0267f802a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1185,7 +1185,7 @@ if ($num) { print ''.img_edit().''; } if ($iserasable) { - print ''.img_delete().''; + print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin } print ''; @@ -1290,7 +1290,7 @@ if ($num) { print ''.img_edit().''; } if ($iserasable) { - print ''.img_delete().''; + print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin } print ''; From 21a03edafd52b84f0eb882dfb66741c67428bea7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Aug 2023 22:51:21 +0200 Subject: [PATCH 10/12] Clean code --- htdocs/install/upgrade2.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 522f8c40c17..0f7b20d3f19 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4122,7 +4122,12 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/menus/standard/auguria_frontoffice.php', '/core/menus/standard/eldy_backoffice.php', '/core/menus/standard/eldy_frontoffice.php', - '/core/modules/export/exports_csv.modules.php', + '/core/modules/export/export_excel.modules.php', + '/core/modules/export/export_csv.modules.php', + '/core/modules/export/exportcsv.modules.php', + '/core/modules/export/export_excel2007new.modules.php', + '/core/modules/facture/pdf_crabe.modules.php', + '/core/modules/facture/pdf_oursin.modules.php', '/core/modules/mailings/contacts2.modules.php', '/core/modules/mailings/contacts3.modules.php', '/core/modules/mailings/contacts4.modules.php', @@ -4131,12 +4136,6 @@ function migrate_delete_old_files($db, $langs, $conf) '/core/modules/mailings/peche.modules.php', '/core/modules/mailings/poire.modules.php', '/core/modules/mailings/kiwi.modules.php', - '/core/modules/facture/pdf_crabe.modules.php', - '/core/modules/facture/pdf_oursin.modules.php', - '/core/modules/export/export_excel.modules.php', - '/core/modules/export/export_csv.modules.php', - '/core/modules/export/exportcsv.modules.php', - '/core/modules/export/export_excel2007new.modules.php', '/core/boxes/box_members.php', '/api/class/api_generic.class.php', From 5581deed7e71e78fbc05695bd0223e2d3792eb22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2023 00:34:40 +0200 Subject: [PATCH 11/12] FIX Bad message on menu to go to setup of accounting custom groups --- htdocs/accountancy/admin/categories_list.php | 5 ++++- htdocs/admin/dict.php | 1 - htdocs/core/class/html.formaccounting.class.php | 4 ++-- htdocs/langs/en_US/accountancy.lang | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index e77b97fe92d..7b7148f89ce 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2023 Laurent Destailleur * Copyright (C) 2011-2021 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -852,6 +852,9 @@ if ($resql) { print "\n"; $i++; } + } else { + $colspan = 11; + print ''.$langs->trans("None").''; } } else { dol_print_error($db); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9a68194f28c..267c1da4159 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2639,7 +2639,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $maxlength = ''; if (in_array($fieldlist[$field], array('libelle', 'label'))) { switch ($tabname) { - case 'c_accounting_category': case 'c_ecotaxe': case 'c_email_senderprofile': case 'c_forme_juridique': diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index d4d618586e5..9c72c98721c 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -235,7 +235,7 @@ class FormAccounting extends Form public function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable - global $db, $langs, $user, $mysoc; + global $db, $langs, $mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) { dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined'); @@ -293,7 +293,7 @@ class FormAccounting extends Form $out .= ''; //if ($user->admin && $help) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } else { - $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code); + $out = $langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("AccountingCategories")); } } else { dol_print_error($this->db); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 6f573f0f7d2..6e40a75854a 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -450,7 +450,7 @@ ConfirmMassDeleteBookkeepingWritingQuestion=This will delete the transaction fro ## Error SomeMandatoryStepsOfSetupWereNotDone=Some mandatory steps of setup was not done, please complete them -ErrorNoAccountingCategoryForThisCountry=No accounting account group available for country %s (See Home - Setup - Dictionaries) +ErrorNoAccountingCategoryForThisCountry=No accounting account group available for country %s (See %s - %s - %s) ErrorInvoiceContainsLinesNotYetBounded=You try to journalize some lines of the invoice %s, but some other lines are not yet bounded to accounting account. Journalization of all invoice lines for this invoice are refused. ErrorInvoiceContainsLinesNotYetBoundedShort=Some lines on invoice are not bound to accounting account. ExportNotSupported=The export format setuped is not supported into this page From d2a9fe70c61d658ac40b4f8fa874890d1cf7ae2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Sep 2023 00:36:53 +0200 Subject: [PATCH 12/12] Fix phpcs --- htdocs/compta/paiement/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 004de242952..91045ae3370 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -523,9 +523,8 @@ if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { } $params = array(); - if (! empty($title_button)) { - $params['attr'] = array('title' => $title_button); + $params['attr'] = array('title' => $title_button); } if ($user->socid == 0 && $action == '') {