From 3a13924685a454e1c7a571047ce9fea405710f86 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 5 Apr 2023 12:43:52 +0200 Subject: [PATCH 01/13] FIX - Operator to search category Knowledge --- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index cafb5776cf7..c4b6eb7eaa6 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -293,7 +293,7 @@ if (!empty($searchCategoryKnowledgemanagementList)) { if (intval($searchCategoryKnowledgemanagement) == -2) { $searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)"; } elseif (intval($searchCategoryKnowledgemanagement) > 0) { - if ($searchCategoryKnowledgemanagementOperator == 0) { + if (empty($searchCategoryKnowledgemanagementOperator)) { $searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")"; } else { $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement); From 3d9aa470783c5bf0060004f4b89e2171d2310b3c Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 5 Apr 2023 12:47:14 +0200 Subject: [PATCH 02/13] Copyright --- htdocs/knowledgemanagement/knowledgerecord_list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index c4b6eb7eaa6..706f103a13d 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Frédéric France + * Copyright (C) 2023 Anthony Berton * * 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 From 424c53109f8a128f0b5514c368ade04580fc7ace Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Apr 2023 17:56:03 +0200 Subject: [PATCH 03/13] FIX Better support for option MAIN_NO_INPUT_PRICE_WITH_TAX --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/master.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 5974daa0573..51ae07640e6 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -761,7 +761,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery('#date_end').removeClass('inputmandatory'); } - if ( == 1 && data.pricebasetype == 'TTC') { + if ( == 1 && data.pricebasetype == 'TTC' && ) { console.log("objectline_create.tpl set content of price_ttc"); jQuery("#price_ttc").val(data.price_ttc); } else { diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 39c6128435b..8478e5279a8 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -219,7 +219,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { $conf->global->MAIN_PROFID1_IN_ADDRESS = 1; } - if ($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) { + if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) { // For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account). // Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set. $conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX = 1; From ae8bcfa6caa0227c6ea4e409e78f2dc6fd711e47 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Apr 2023 17:57:05 +0200 Subject: [PATCH 04/13] Prepare 17.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 3a2e7d227eb..1ee519e38ee 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '17.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '17.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From 4d504b3f985528457d3bd24dbb112f1c645296c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Apr 2023 18:43:59 +0200 Subject: [PATCH 05/13] Fix css --- htdocs/user/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 2a6b8a813be..c4029951b87 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2338,25 +2338,25 @@ if ($action == 'create' || $action == 'adduserldap') { } if ($object->socid > 0 && !($object->contact_id > 0)) { // external user but no link to a contact - print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); + print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' ', 0, 0, null, 0, 'maxwidth300'); print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } elseif ($object->socid > 0 && $object->contact_id > 0) { // external user with a link to a contact - print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'company').$form->select_company($object->socid, 'socid', '', ' ', 0, 0, null, 0, 'maxwidth300'); // We keep thirdparty empty, contact is already set print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } elseif (!($object->socid > 0) && $object->contact_id > 0) { // internal user with a link to a contact - print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'company').$form->select_company(0, 'socid', '', ' ', 0, 0, null, 0, 'maxwidth300'); // We keep thirdparty empty, contact is already set print img_picto('', 'contact').$form->selectcontacts(0, $object->contact_id, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } } else { // $object->socid is not > 0 here - print img_picto('', 'company').$form->select_company(0, 'socid', '', ' '); // We keep thirdparty empty, contact is already set + print img_picto('', 'company').$form->select_company(0, 'socid', '', ' ', 0, 0, null, 0, 'maxwidth300'); // We keep thirdparty empty, contact is already set print img_picto('', 'contact').$form->selectcontacts(0, 0, 'contactid', 1, '', '', 1, 'maxwidth300', false, 1); } } From 99b595a80762a81b569f24e09655e7b2577ee088 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Apr 2023 13:29:24 +0200 Subject: [PATCH 06/13] Fix typo --- htdocs/projet/list.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f5c25f6a516..924930e14ac 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -734,7 +734,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); + $param .= '&limit='.((int) $limit); } if ($search_all != '') { $param .= '&search_all='.urlencode($search_all); @@ -808,9 +808,6 @@ if ($search_date_end_end) { if ($socid) { $param .= '&socid='.urlencode($socid); } -if (!empty($search_categ)) { - $param .= '&search_categ='.urlencode($search_categ); -} if ($search_ref != '') { $param .= '&search_ref='.urlencode($search_ref); } @@ -973,7 +970,7 @@ $moreforfilter .= ''; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectsWithThisContact'); -$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth250 widthcentpercentminusx'); +$moreforfilter .= img_picto($tmptitle, 'contact', 'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact : '', 'search_project_contact', $tmptitle, '', '', 0, 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= '
'; // If the user can view thirdparties other than his' From 595abd50291ce6408a47ef335cf46693d0747aae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 6 Apr 2023 14:57:49 +0200 Subject: [PATCH 07/13] fix : Warning: Undefined array key facture in /home/httpd/vhosts/aflac.fr/domains/dev.aflac.fr/httpdocs/compta/facture/card.php on line 3904 --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8f65df86da7..be552526e1f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3901,7 +3901,7 @@ if ($action == 'create') { print $objectsrc->getNomUrl(1); // We check if Origin document (id and type is known) has already at least one invoice attached to it $objectsrc->fetchObjectLinked($originid, $origin, '', 'facture'); - if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) { + if (isset($objectsrc->linkedObjects['facture']) && is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1) { setEventMessages('WarningBillExist', null, 'warnings'); echo ' - '.$langs->trans('LatestRelatedBill').' '.end($objectsrc->linkedObjects['facture'])->getNomUrl(1); } From 399eb9d826b38308235b932e30209c20de25f7a1 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 6 Apr 2023 15:30:47 +0200 Subject: [PATCH 08/13] Update changelog warning for developer. --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 07fa52ed00f..cf79e783b35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -261,6 +261,7 @@ Following changes may create regressions for some external modules, but were nec * You must use "$objectoffield" to manipulate the current object inside the formulare of computed custom extrafields instead of $obj/$object. * Making a global search is sending the parameter using always the name search_all (instead of sometimes sall and search_all) * The property $url_last_version must be public if defined into module descriptor files; +* Filters in class field definitions must be a Dolibarr filter syntax string. ***** ChangeLog for 16.0.5 compared to 16.0.4 ***** From cfae78c86f21a868ba80a8449c95c3b29d4bdd76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Apr 2023 21:39:41 +0200 Subject: [PATCH 09/13] Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0 --- htdocs/adherents/list.php | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index bcbbbd5f701..ec8b1159c1c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -181,7 +181,8 @@ $result = restrictedArea($user, 'adherent'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -317,10 +318,16 @@ $formother = new FormOther($db); $membertypestatic = new AdherentType($db); $memberstatic = new Adherent($db); -$title = $langs->trans("Members"); - $now = dol_now(); +// Page Header +$title = $langs->trans("Members")." - ".$langs->trans("List"); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; +$morejs = array(); +$morecss = array(); + +// Build and execute select +// -------------------------------------------------------------------- if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) { $sql = "SELECT DISTINCT"; } else { @@ -343,8 +350,8 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook -$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); $sqlfields = $sql; // $sql fields to remove for count total @@ -471,16 +478,14 @@ if ($search_country) { if ($search_import_key) { $sql .= natural_search("d.import_key", $search_import_key); } - // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; - // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -// Count total nb of records with no order and no limits +// Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ @@ -494,7 +499,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -517,8 +522,7 @@ if (!$resql) { $num = $db->num_rows($resql); -$arrayofselected = is_array($toselect) ? $toselect : array(); - +// Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -526,8 +530,12 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ exit; } -$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('', $title, $help_url); +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll + +$arrayofselected = is_array($toselect) ? $toselect : array(); if ($search_type > 0) { $membertype = new AdherentType($db); @@ -1274,7 +1282,7 @@ if ($num == 0) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } $db->free($resql); From d9c55c1711cb97307e639138cdbde25fc16a4839 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Apr 2023 22:14:18 +0200 Subject: [PATCH 10/13] Trans --- htdocs/langs/en_US/bills.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index d7c29a82399..618cdeb0e2c 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -285,6 +285,7 @@ SetRevenuStamp=Set revenue stamp Billed=Billed RecurringInvoices=Recurring invoices RecurringInvoice=Recurring invoice +RecurringInvoiceSource=Recurring invoice ar source RepeatableInvoice=Template invoice RepeatableInvoices=Template invoices RecurringInvoicesJob=Generation of recurring invoices (sales invoices) From f0d5dfe71917cb6645bd67d34282c5f40972f3d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Apr 2023 22:17:55 +0200 Subject: [PATCH 11/13] FIX Rounding on total margin on invoice list --- htdocs/compta/facture/list.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 702cc057568..3de67f73acf 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2547,6 +2547,9 @@ if ($resql) { $i++; } + // Use correct digits number for totals + $totalarray['val']['total_margin'] = price2num($totalarray['val']['total_margin'], 'MT'); + // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } From e36ace0ed6255a48156d529f0970482ff75d42ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Apr 2023 22:21:29 +0200 Subject: [PATCH 12/13] Fix css --- htdocs/product/inventory/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 88e590c478b..682589b2563 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -704,7 +704,7 @@ if ($num == 0) { $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } From ef9d7d8d8247925a4bc8436a3fc922ca44881d8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Apr 2023 01:48:39 +0200 Subject: [PATCH 13/13] FIX Compress in xz for better debian old version compatibility --- build/debian/rules | 6 +++++- build/debian/source/options | 4 +++- build/makepack-dolibarr.pl | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/build/debian/rules b/build/debian/rules index b63fcffde93..df6abfd1b89 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -19,6 +19,10 @@ override_dh_auto_clean: override_dh_auto_build: # Do nothing. Added to disable launchpad to use bugged dh_auto_build search for ant +# Force the compression format for control files +override_dh_builddeb: + dh_builddeb -- -Zxz + #override_dh_compress: # dh_compress --no-act -X.png @@ -124,4 +128,4 @@ override_dh_fixperms: # Give rights to the webserver on the upload directory chown www-data:www-data debian/dolibarr/var/lib/dolibarr/documents chmod 2775 debian/dolibarr/var/lib/dolibarr/documents - + diff --git a/build/debian/source/options b/build/debian/source/options index 8d8fd181896..49a59df5428 100644 --- a/build/debian/source/options +++ b/build/debian/source/options @@ -1,3 +1,5 @@ -# Force use of gzip compression by dpkg-buildpackage +# Force use of gzip compression by dpkg-buildpackage for the tarball *.debian.tar.gz +# See also option --compression from command line of dpkg-buildpackage +# Format for the control files are defined into the rules file in override_dh_builddeb section compression = "gzip" #compression-level = 9 diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f0433da142b..b7586e3909f 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -1050,16 +1050,16 @@ if ($nboftargetok) { print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"); #$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build"; - $cmd="dpkg-buildpackage -us -uc"; + $cmd="dpkg-buildpackage -us -uc --compression=gzip"; print "Launch DEB build ($cmd)\n"; $ret=`$cmd 2>&1 3>&1`; print $ret."\n"; chdir("$olddir"); - + print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n"; print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n"; - + # Move to final dir print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n"; $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;