From 04091169dab12429e88430b9f2eb3cf0f8fd9e90 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 13 Oct 2021 02:48:42 +0200 Subject: [PATCH 01/35] Accountancy - Show message for admin if accountancy hidden options are activated to help to resolve some problems --- htdocs/accountancy/admin/index.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index f8c0c95d3c1..4f4bff526c8 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2019 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -260,6 +260,22 @@ $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; print load_fiche_titre($title, $linkback, 'accountancy'); +// Show message if accountancy hidden options are activated to help to resolve some problems +if (!$user->admin) { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + print '
' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; + } + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + print '
' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
'; + } + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + print '
' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '
'; + } + if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { + print '
' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '
'; + } +} + print '
'; print ''; print ''; From 3c33770f00955c4460ab7a7739bfa614d5974628 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 13 Oct 2021 15:30:49 +0200 Subject: [PATCH 02/35] Fix member creation from thirdparty extrafields --- htdocs/adherents/card.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7199423669a..e54ac0bc31a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -790,10 +790,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (!empty($socid)) { - $object = new Societe($db); - if ($socid > 0) $object->fetch($socid); + $soc = new Societe($db); + if ($socid > 0) $soc->fetch($socid); - if (!($object->id > 0)) { + if (!($soc->id > 0)) { $langs->load("errors"); print($langs->trans('ErrorRecordNotFound')); exit; @@ -877,7 +877,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Company - print ''.$langs->trans("Company").''; + print ''.$langs->trans("Company").''; // Civility print ''.$langs->trans("UserTitle").''; @@ -901,32 +901,32 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // EMail print ''.($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '' : '').''; - print ''.img_picto('', 'object_email').' '; + print ''.img_picto('', 'object_email').' '; // Address print ''.$langs->trans("Address").''; - print ''; + print ''; print ''; // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; - print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); + print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $soc->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6); print ' '; - print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); + print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $soc->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); print ''; // Country $object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id; print ''.$langs->trans('Country').''; - print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id'); + print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $soc->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''; // State if (empty($conf->global->MEMBER_DISABLE_STATE)) { print ''.$langs->trans('State').''; - if ($object->country_id) { - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code); + if ($soc->country_id) { + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code); } else { print $countrynotdefined; } @@ -935,7 +935,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Pro phone print ''.$langs->trans("PhonePro").''; - print ''.img_picto('', 'object_phoning').' '; + print ''.img_picto('', 'object_phoning').' '; // Personal phone print ''.$langs->trans("PhonePerso").''; From 316bc16634ffc8abb76bae5cb3b8c8e7af59a86d Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 15 Oct 2021 15:05:13 +0800 Subject: [PATCH 03/35] Update card.php --- htdocs/fourn/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 80f868f3484..8a148bbb666 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2406,6 +2406,15 @@ if ($action == 'create') { // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } + if ($object->paye) { $resteapayer = 0; } From 0cb19726740a7e78c7e3e8a34e81f37bf3acde86 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 15 Oct 2021 15:07:48 +0800 Subject: [PATCH 04/35] Update card.php --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 83c8ec8d718..5541725a480 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3844,6 +3844,15 @@ if ($action == 'create') { // $resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + + // Multicurrency + if (!empty($conf->multicurrency->enabled)) { + $multicurrency_totalpaye = $object->getSommePaiement(1); + $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); + $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); + $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); + } if ($object->paye) { $resteapayer = 0; From fb79aaeb0c2a4d187cc6aaa3c40430c975c125a2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 15 Oct 2021 07:19:49 +0000 Subject: [PATCH 05/35] Fixing style errors. --- htdocs/compta/facture/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5541725a480..56e66b9f759 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3844,7 +3844,7 @@ if ($action == 'create') { // $resteapayer=bcadd($object->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); // $resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); $resteapayer = price2num($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); - + // Multicurrency if (!empty($conf->multicurrency->enabled)) { $multicurrency_totalpaye = $object->getSommePaiement(1); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 8a148bbb666..79a93cf3b0c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2414,7 +2414,7 @@ if ($action == 'create') { $multicurrency_resteapayer = price2num($object->multicurrency_total_ttc - $multicurrency_totalpaye - $multicurrency_totalcreditnotes - $multicurrency_totaldeposits, 'MT'); $resteapayer = price2num($multicurrency_resteapayer / $object->multicurrency_tx, 'MT'); } - + if ($object->paye) { $resteapayer = 0; } From bd7e3e57cabfe767948758bfc08928cb34e7c107 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Fri, 15 Oct 2021 16:56:38 +0200 Subject: [PATCH 06/35] FIX 13.0: end date required to edit a ticket message --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2a0371d4615..0bbcf20a796 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -503,7 +503,7 @@ if (empty($reshook) && $action == 'update') $object->note_private = trim(GETPOST("note", "restricthtml")); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); - if (!$datef && $percentage == 100) + if (!$datef && $percentage == 100 && !preg_match('/^TICKET_MSG/', $object->code)) { $error++; $donotclearsession = 1; setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors'); From a0c81d6230211579790c37cc87679b34b5f8a5f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 13:23:59 +0200 Subject: [PATCH 07/35] Prepare 13.0.5 --- 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 a24a404262e..d32f29a9d3d 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.4'); // 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.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (!defined('EURO')) define('EURO', chr(128)); From 946bca3b625576af9ef82f157a6a99dfeccdc21a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2021 13:26:39 +0200 Subject: [PATCH 08/35] Prepare 13.0.5 --- ChangeLog | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 281c8733ce6..58f5e78155b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,38 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 13.0.4 compared to 13.0.2 ***** + +***** ChangeLog for 13.0.5 compared to 13.0.4 ***** + +FIX: 13.0: class CommandeFournisseurDispatch provides trigger for UPDATE but not for CREATE / DELETE +FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice +FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility +FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT) +FIX: Accountancy - Some problems of length with general & subledger account +FIX: add DISTINCT +FIX: an approved holiday can be canceled by an admin. +FIX: autocalculation of the supplier price in main currency. +FIX: better sql request +FIX: cannot add time spend when column ref is not displayed +FIX: compatibility postgre sql +FIX: holiday card: hooks uninitialized +FIX: Invoice - Missing button to reopen an abandoned situation invoice +FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts +FIX: list of categories in stats of supplier invoices +FIX: Manage credit note on situation invoice for calculate margin +FIX: method_exists needs object at first param +FIX: move fetch_optionnal into $ac_static->fetch() +FIX: multicompany transverse mode compatibility +FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref) +FIX: postgre filter select search extrafield +FIX: products/services card: hidden extrafields were overridden +FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object +FIX: task time: can't filter by user with pgsql + show error message +FIX: task time: keep on using natural_search +FIX: wrong users count in multicompany transverse mode + + +***** ChangeLog for 13.0.4 compared to 13.0.3 ***** FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules). FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()` From 102c8a5772fa6c944e685c926768efffb7ff8b8f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:02:28 +0200 Subject: [PATCH 09/35] FIX User salary card - translation problem --- htdocs/user/bank.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 0eaf3d533a9..efd1d477a24 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -324,7 +324,8 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $ret .= ''; print $ret; } else { - print dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + $label_exp_tax_cat = dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); + print $langs->trans($label_exp_tax_cat); //print $form->editfieldval("DefaultCategoryCar", 'default_c_exp_tax_cat', $object->default_c_exp_tax_cat, $object, $user->rights->user->user->creer, 'string', ($object->default_c_exp_tax_cat != '' ? $object->default_c_exp_tax_cat : '')); } print ''; From e9ecb2e1eebe19f57a2f41c99fe206c50b1d9b88 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:11:34 +0200 Subject: [PATCH 10/35] Translation --- htdocs/user/bank.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index efd1d477a24..c77d9bd1232 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -1,12 +1,12 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2002-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Peter Fontaine + * Copyright (C) 2015-2016 Marcos García + * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2021 Gauthier VERDOL * * 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 @@ -357,7 +357,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print '
'; - // Nbre max d'elements des petites listes + // Max number of elements in small lists $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Latest payments of salaries From fb301362023d3f7581302ef7c5193eb844b3d7e9 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 17 Oct 2021 08:12:28 +0200 Subject: [PATCH 11/35] Translation --- htdocs/langs/en_US/banks.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index a0b7942d446..6c770163f29 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -182,3 +182,4 @@ BankColorizeMovementName2=Background color for credit movement IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning. NoBankAccountDefined=No bank account defined NoRecordFoundIBankcAccount=No record found in bank account. Commonly, this occurs when a record has been deleted manually from the list of transaction in the bank account (for example during a reconciliation of the bank account). Another reason is that the payment was recorded when the module "%s" was disabled. +AlreadyOneBankAccount=Already one bank account defined From 30ba753b344a2243d0de946c1a9b9742791b87f1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 14:02:37 +0200 Subject: [PATCH 12/35] css --- htdocs/admin/accountant.php | 2 +- htdocs/admin/company_socialnetworks.php | 2 +- htdocs/admin/openinghours.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 24df7e0cb68..9bed1bb19f3 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -115,7 +115,7 @@ print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 2d4b2e6d128..63b23c06c42 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -110,7 +110,7 @@ print '
'; print '
'; print ''; print ''; -print ''; +print ''; print "\n"; diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 2e262a1bb7e..0696de2a5c6 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') { print ''; print '
'.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").''.$langs->trans("SocialNetworksInformation").''.$langs->trans("Url").''.$langs->trans("SocialNetworkId").'
'; - print ''."\n"; + print ''."\n"; print '
'.$langs->trans("Day").''.$langs->trans("Value").'
'.$langs->trans("Day").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc")); From 78523e852d6b99c3680cf6586beaa0dc5a94b295 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 14:04:49 +0200 Subject: [PATCH 13/35] css --- htdocs/admin/company_socialnetworks.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 63b23c06c42..eafda362486 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -104,8 +104,6 @@ print '
'; print ''; print ''; -// Social networks -print '
'; print '
'; print ''; From 7bcc76c1aa2fadfd4c3a701eea5a4777ebf0e51a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 19:39:56 +0200 Subject: [PATCH 14/35] Fix margin rates and mark rates are 2 different columns --- htdocs/core/tpl/objectline_edit.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 9094daaa2d1..3ce3fffd28d 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -296,7 +296,8 @@ $coldisplay++; echo ''; } $coldisplay++; - } elseif (!empty($conf->global->DISPLAY_MARK_RATES)) { + } + if (!empty($conf->global->DISPLAY_MARK_RATES)) { $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) { From 5221c9e38f947006838c31394fd041ccdb77b7b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Oct 2021 17:17:08 +0200 Subject: [PATCH 15/35] Fix editline --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index eec14c85a99..5f924cbbaa2 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2524,7 +2524,7 @@ if ($action == 'create') { print '
'; -if ($action != 'create' && $action != 'edit') { +if ($action != 'create' && $action != 'edit' && $action != 'editline') { $object = new ExpenseReport($db); $object->fetch($id, $ref); From dce1e56a78a83273089f3a7082b508ac233ccc5a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 05:44:22 +0200 Subject: [PATCH 16/35] FIX #18912 Accountancy - SQL error when custom group is added without country defined --- htdocs/accountancy/admin/categories_list.php | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 9a8a84893fe..4891aae2e3f 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2021 Alexandre Spangaro * * 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 @@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account $tabsqlsort = array(); $tabsqlsort[32] = "position ASC"; -// Nom des champs en resultat de select pour affichage du dictionnaire +// Name of the fields in the result of select to display the dictionary $tabfield = array(); $tabfield[32] = "code,label,range_account,category_type,formula,position,country"; -// Nom des champs d'edition pour modification d'un enregistrement +// Name of editing fields for record modification $tabfieldvalue = array(); $tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id"; -// Nom des champs dans la table pour insertion d'un enregistrement +// Name of the fields in the table for inserting a record $tabfieldinsert = array(); $tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country"; -// Nom du rowid si le champ n'est pas de type autoincrement +// Name of the rowid if the field is not of type autoincrement // Example: "" if id field is "rowid" and has autoincrement on // "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid = array(); @@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($value == 'range_account' && empty($_POST['range_account'])) { continue; } - if ($value == 'country' || $value == 'country_id') { + if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) { continue; } if (!GETPOSTISSET($value) || GETPOST($value) == '') { @@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { if ($fieldnamekey == 'category_type') { $fieldnamekey = 'Calculated'; } + if ($fieldnamekey == 'country') { + $fieldnamekey = 'Country'; + } setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors'); } @@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { } } - // Si verif ok et action modify, on modifie la ligne + // If check ok and action modify, we modify the line if ($ok && GETPOST('actionmodify', 'alpha')) { if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; @@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto); print ''.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'

'; -// Confirmation de la suppression de la ligne +// Confirmation of the deletion of the line if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } -// Complete requete recherche valeurs avec critere de tri +// Complete search query with sorting criteria $sql = $tabsql[$id]; if ($search_country_id > 0) { @@ -634,14 +637,14 @@ if ($resql) { // Title of lines print '
'; foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees - $showfield = 1; // By defaut + // Determines the name of the field in relation to the possible names + // in data dictionaries + $showfield = 1; // By default $class = "left"; $sortable = 1; $valuetoshow = ''; - $valuetoshow = ucfirst($fieldlist[$field]); // By defaut + $valuetoshow = ucfirst($fieldlist[$field]); // By default $valuetoshow = $langs->trans($valuetoshow); // try to translate if ($fieldlist[$field] == 'source') { $valuetoshow = $langs->trans("Contact"); From 2ff75dfab4cccdb334b4b6952009fe632024899c Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 09:43:05 +0200 Subject: [PATCH 17/35] FIX 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1 --- htdocs/comm/action/card.php | 2 +- htdocs/ticket/class/ticket.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 0bbcf20a796..2a0371d4615 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -503,7 +503,7 @@ if (empty($reshook) && $action == 'update') $object->note_private = trim(GETPOST("note", "restricthtml")); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); - if (!$datef && $percentage == 100 && !preg_match('/^TICKET_MSG/', $object->code)) + if (!$datef && $percentage == 100) { $error++; $donotclearsession = 1; setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors'); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 20d63cea600..1c53217d4b3 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1657,7 +1657,7 @@ class Ticket extends CommonObject $actioncomm->userassigned = array($user->id); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; - $actioncomm->percentage = 100; + $actioncomm->percentage = -1; $actioncomm->elementtype = 'ticket'; $actioncomm->fk_element = $this->id; From aff8d9c24a966bc2750a03653247b7cde82db214 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 09:46:20 +0200 Subject: [PATCH 18/35] FIX 13.0 PR #18993: add comment on modified part --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1c53217d4b3..91d50e903a3 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1657,7 +1657,7 @@ class Ticket extends CommonObject $actioncomm->userassigned = array($user->id); $actioncomm->userownerid = $user->id; $actioncomm->datep = $now; - $actioncomm->percentage = -1; + $actioncomm->percentage = -1; // percentage is not relevant for punctual events $actioncomm->elementtype = 'ticket'; $actioncomm->fk_element = $this->id; From 9685695577df5933a95b398ed6520e893ab19bd2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 10:19:46 +0200 Subject: [PATCH 19/35] FIX Accountancy - PHP8 --- htdocs/accountancy/class/bookkeeping.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 2c715aa9fd6..43dcce8c646 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -937,7 +937,6 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); - $line->date_validation = $this->db->jdate($obj->date_validated); $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1751,7 +1749,6 @@ class BookKeeping extends CommonObject $line->date_creation = $obj->date_creation; $line->date_modification = $obj->date_modification; $line->date_export = $obj->date_export; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; @@ -1816,7 +1813,6 @@ class BookKeeping extends CommonObject $line->sens = $obj->sens; $line->code_journal = $obj->code_journal; $line->piece_num = $obj->piece_num; - $line->date_validation = $obj->date_validated; $line->date_validation = $obj->date_validation; $this->linesexport[] = $line; From 053740792f19592b10a48fb88a7af23b8a1c308b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 18 Oct 2021 10:19:50 +0200 Subject: [PATCH 20/35] Update accounting.lib.php --- htdocs/core/lib/accounting.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 68af901a757..30f1b497885 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -103,7 +103,7 @@ function length_accountg($account) return $account; } - $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; + $g = !empty($conf->global->ACCOUNTING_LENGTH_GACCOUNT); if (!is_empty($g)) { // Clean parameters $i = strlen($account); @@ -142,7 +142,7 @@ function length_accounta($accounta) return $accounta; } - $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; + $a = !empty($conf->global->ACCOUNTING_LENGTH_AACCOUNT); if (!is_empty($a)) { // Clean parameters $i = strlen($accounta); From d0d5955fb1620eca46319485d304e6159c857529 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 12:09:33 +0200 Subject: [PATCH 21/35] FIX 13.0: sometimes firstname was mistyped as fistname --- htdocs/datapolicy/class/actions_datapolicy.class.php | 6 +++--- htdocs/install/repair.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index d6c16a6be4e..dea9ec0ef84 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -133,7 +133,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $object->fetch(GETPOST('socid')); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->name.';'; echo ';'; echo ';'; @@ -157,7 +157,7 @@ class ActionsDatapolicy header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; @@ -181,7 +181,7 @@ class ActionsDatapolicy header('Content-Disposition: attachment; filename=datapolicy_portabilite.csv'); header('Pragma: no-cache'); $soc = $object->fetch_thirdparty(); - echo 'Name;Fistname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; + echo 'Name;Firstname;Civility;Thirdparty;Function;Address;ZipCode;City;Department;Country;Email;Pro Phone;Perso Phone;Mobile Phone;Instant Mail;Birthday;'.PHP_EOL; echo $object->lastname.';'; echo $object->firstname.';'; echo $object->getCivilityLabel().';'; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index baac0eb2cbd..21f00a47d12 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -590,7 +590,7 @@ if ($ok && GETPOST('restore_user_pictures', 'alpha')) $filetotestsmall = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_small'.$ext; $filetotestmini = $dolibarr_main_data_root.'/users/'.substr(sprintf('%08d', $obj->rowid), -1, 1).'/'.substr(sprintf('%08d', $obj->rowid), -2, 1).'/thumbs/'.$name.'_mini'.$ext; $exists = dol_is_file($filetotest); - print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' fistname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; + print 'Check user '.$obj->rowid.' lastname='.$obj->lastname.' firstname='.$obj->firstname.' photo='.$obj->photo.' file '.$filetotest." exists=".$exists."
\n"; if ($exists) { $filetarget = $dolibarr_main_data_root.'/users/'.$obj->rowid.'/'.$name.$ext; From a52ceaf1d28fc8dab449bcb1db1ca969a88017e8 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 18 Oct 2021 12:12:00 +0200 Subject: [PATCH 22/35] FIX generate documents with PDF options --- htdocs/comm/propal/class/propal.class.php | 14 ++++++++++++-- .../class/recruitmentjobposition.class.php | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6e3f60a7cf5..0142d0c1b7a 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2563,8 +2563,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { @@ -2651,8 +2656,13 @@ class Propal extends CommonObject $outputlangs->setDefaultLang($newlang); } + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } $this->oldcopy = clone $this; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 892ba4121e9..a767900ec7e 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -698,8 +698,14 @@ class RecruitmentJobPosition extends CommonObject $newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } + + // PDF + $hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0); + $hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0); + $hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0); + //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + $this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } if (!$error) { From c016a20aacc7ccddeadad7e81967a60c194521f2 Mon Sep 17 00:00:00 2001 From: atm-florian Date: Mon, 18 Oct 2021 12:12:38 +0200 Subject: [PATCH 23/35] FIX 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index ad78c2cb389..a93e507bac1 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -961,7 +961,7 @@ while ($i < min($num, $limit)) { // Firstname if (!empty($arrayfields['d.firstname']['checked'])) { print '
\n"; if (!$i) { From 98a613edece9dd3fbb98a73c6f4baf3a5f1fcd2e Mon Sep 17 00:00:00 2001 From: lvessiller Date: Mon, 18 Oct 2021 14:31:37 +0200 Subject: [PATCH 24/35] FIX show end hours in events linked to objects --- htdocs/core/class/html.formactions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 09c94485d11..06c0aea628c 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -309,7 +309,7 @@ class FormActions $tmpa = dol_getdate($actioncomm->datep); $tmpb = dol_getdate($actioncomm->datef); if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) { - if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) { + if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes']) { print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel'); } } else { From 265f3d0ab03a43781c24250947d727bbc4fb5d07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Oct 2021 20:03:59 +0200 Subject: [PATCH 25/35] Fix css --- htdocs/public/members/new.php | 7 ++++--- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index b6498ca4032..d29d80cf5d4 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -523,6 +523,7 @@ print ''. print ''; print ''; print ''; +print ''; print '
'; @@ -563,7 +564,7 @@ jQuery(document).ready(function () { print '
%
'; - print $memberstatic->getNomUrl(0, 0, 'card', 'fistname'); + print $memberstatic->getNomUrl(0, 0, 'card', 'firstname'); //print $obj->firstname; print "
'."\n"; - // Type +// Type if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { $listoftype = $adht->liste_array(); $tmp = array_keys($listoftype); @@ -596,7 +597,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { // Company print ''."\n"; +print ''."\n"; // Title print ''."\n"; @@ -625,7 +626,7 @@ print ''."\n"; // Zip / Town print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index de984d83076..4da2d71dfd7 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1549,7 +1549,7 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select height: 64px !important; } - .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } + .divmainbodylarge { margin-left: 10px !important; margin-right: 10px !important; } .tdoverflowonsmartphone { max-width: 0; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 0d8851208f6..261547992c0 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1576,7 +1576,7 @@ table[summary="list_of_modules"] .fa-cog { min-width: 150px !important; } - .divmainbodylarge { margin-left: 20px; margin-right: 20px; } + .divmainbodylarge { margin-left: 10px; margin-right: 10px; } .tdoverflowonsmartphone { max-width: 0; From f4743c7f1f1d69b6da3d5502122cb392d8e6d47f Mon Sep 17 00:00:00 2001 From: daraelmin Date: Tue, 19 Oct 2021 23:00:36 +0200 Subject: [PATCH 26/35] Fix wrong const in select MEMBER_ALLOW_CHANGE_OF_TYPE --- htdocs/adherents/admin/member.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 018498c2457..f9e5388d735 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -228,7 +228,7 @@ print "\n"; // Allow members to change type on renewal forms /* To test during next beta print '\n"; */ From 63fafdf1206d1967b28a1612037bc6db4007a866 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 20 Oct 2021 07:54:09 +0200 Subject: [PATCH 27/35] FIX Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode --- htdocs/expensereport/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5f924cbbaa2..1be72b5b49b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2021 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018 Frédéric France * @@ -2282,7 +2282,7 @@ if ($action == 'create') { // Quantity print ''; //print ''; From 289f90fb1e5afaf6c0f1ef8d1d2e3bbcb48f4746 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:05:40 +0200 Subject: [PATCH 28/35] Fix qty must not use html type "number" but "text" (need decimal values) --- htdocs/fourn/commande/dispatch.php | 2 +- htdocs/multicurrency/multicurrency_rate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 09588389cb1..0df79fce096 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1219,7 +1219,7 @@ if ($id > 0 || !empty($ref)) { // Qty print ''; print ''; - print ' '; + print ' '; print '
'.$langs->trans("Company").''; print img_picto('', 'company', 'class="pictofixedwidth"'); -print '
'.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 1, '', 'width75'); print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print '
'.$langs->trans("MemberAllowchangeOfType").''; -print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); +print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1); print "
'; - print ''; + print ''; // We must be able to enter decimal qty print ''.$langs->trans('AmountHT').''; if ($action == 'editline' && $lineid == $objp->dispatchlineid) { - print ''; + print ''; } else { print $objp->qty; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 35b7544ccbc..161513338ff 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -479,7 +479,7 @@ if ($resql) { // var_dump($obj); print ' ' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . ''; print ''; From 417daa4289c2545bf7a254ff5bbd4f186a9e002b Mon Sep 17 00:00:00 2001 From: atm-florian Date: Wed, 20 Oct 2021 11:15:02 +0200 Subject: [PATCH 29/35] FIX 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none) --- htdocs/societe/card.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bfee51e5f8d..e283333070b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + if ($("#civility_id").data("select2")) { + $("#civility_id").select2({width: "resolve"}); + } $("#TypeName").html(document.formsoc.LastName.value); document.formsoc.private.value=1; }); From f59f605bcc9dad53ba821a71c1165b4773eadfee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:29:34 +0200 Subject: [PATCH 30/35] Update card.php --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e283333070b..c228fd29866 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,6 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); + /* Force recompute width of a select2 field when it was hidden and then shown */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); } From ae1da432250d521728e575da33153670fb0afec7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 11:30:38 +0200 Subject: [PATCH 31/35] Update card.php --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index c228fd29866..5c9c0f63e94 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1151,7 +1151,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $("#typent_id").change(); $("#effectif_id").val(id_ef15); $("#effectif_id").change(); - /* Force recompute width of a select2 field when it was hidden and then shown */ + /* Force to recompute the width of a select2 field when it was hidden and then shown programatically */ if ($("#civility_id").data("select2")) { $("#civility_id").select2({width: "resolve"}); } From 632751cebc5de5a00057674d86c6df9823516010 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 20 Oct 2021 12:37:49 +0200 Subject: [PATCH 32/35] Use getDolGlobalInt() --- htdocs/core/lib/accounting.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 30f1b497885..21afb5f3490 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -103,7 +103,7 @@ function length_accountg($account) return $account; } - $g = !empty($conf->global->ACCOUNTING_LENGTH_GACCOUNT); + $g = getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'); if (!is_empty($g)) { // Clean parameters $i = strlen($account); @@ -142,7 +142,7 @@ function length_accounta($accounta) return $accounta; } - $a = !empty($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + $a = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); if (!is_empty($a)) { // Clean parameters $i = strlen($accounta); From 53244c5f45dc1bb9b831cd0cf665f2fcfdd2162f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 12:38:19 +0200 Subject: [PATCH 33/35] FIX missing permission check reported by me@lainwir3d.net on product api --- htdocs/product/class/api_products.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 2e0d21b0456..b6230ce119e 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -1617,7 +1617,7 @@ class Products extends DolibarrApi $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); $combinations[$key] = $this->_cleanObjectDatas($combinations[$key]); - if ($includestock==1) { + if ($includestock==1 && DolibarrApiAccess::$user->rights->stock->lire) { $productModel = new Product($this->db); $productModel->fetch((int) $combination->fk_product_child); $productModel->load_stock(); @@ -1859,7 +1859,7 @@ class Products extends DolibarrApi public function getStock($id, $selected_warehouse_id = null) { - if (!DolibarrApiAccess::$user->rights->produit->lire) { + if (!DolibarrApiAccess::$user->rights->produit->lire || !DolibarrApiAccess::$user->rights->stock->lire) { throw new RestException(401); } @@ -1945,6 +1945,10 @@ class Products extends DolibarrApi unset($object->supplierprices); // Mut use another API to get them + if(!DolibarrApiAccess::$user->rights->stock->lire){ + unset($object->stock_reel); + unset($object->stock_theorique); + } return $object; } @@ -2008,7 +2012,7 @@ class Products extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if ($includestockdata) { + if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) { $this->product->load_stock(); if (is_array($this->product->stock_warehouse)) { From f38fca8174a046c31f57f1155d5b354c820a00c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Oct 2021 13:35:30 +0200 Subject: [PATCH 34/35] FIX wrong array key value --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index ea71b1947e7..5294bdf8f11 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -530,7 +530,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ // Can call a dedicated external upgrade process if (!$error) { - $parameters = array('versionfrom'=>$versionfrom, 'versionto='.$versionto); + $parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto); $object = new stdClass(); $action = "upgrade"; $reshook = $hookmanager->executeHooks('doUpgrade2', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks From 85fe1d6d1ed9168331740cec390624c94bcc99e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Oct 2021 15:00:49 +0200 Subject: [PATCH 35/35] fix sql injection reported by Mehdi Oudad --- htdocs/exports/class/export.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 483935c7fdf..7eb88e4fbb3 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -379,13 +379,13 @@ class Export */ public function conditionDate($Field, $Value, $Sens) { - // TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN + // TODO date_format is forbidden, not performant and not portable. Use instead $Value to forge the range date. if (strlen($Value) == 4) { - $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$this->db->escape($Value)."'"; } elseif (strlen($Value) == 6) { - $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; + $Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$this->db->escape($Value)."'"; } else { - $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; + $Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." '".$this->db->escape($Value)."'"; } return $Condition; } @@ -416,7 +416,7 @@ class Export case 'Duree': case 'Numeric': case 'Number': - // Must be a string text to allow to use comparison strings like "<= 999" + // Must be a string text to allow to use comparison strings like "<= 99.9" $szFilterField = ''; break; case 'Status':