From a7de5e4c724caf98266ec8fe447241508dcb7a08 Mon Sep 17 00:00:00 2001 From: mgabriel Date: Thu, 5 Jan 2023 11:59:43 +0100 Subject: [PATCH 1/8] Added &$arrayfields to $parameters so that hooks can manipulate list columns. --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index dc4c4339f1e..8e14e99b1c6 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -277,7 +277,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 29ad812f6e6..ab06e1b5fe6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -223,7 +223,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 9e6af61a9f6..9baa1b63f60 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -296,7 +296,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid); +$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 813f16fecb9a502f0fbd5d3025fb24e7ddb0bc97 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 5 Jan 2023 20:28:07 +0100 Subject: [PATCH 2/8] Fix php 8 errors --- htdocs/fourn/commande/dispatch.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 9e3a9ba7808..b209b6905f3 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -68,7 +68,7 @@ $hookmanager->initHooks(array('ordersupplierdispatch')); // Recuperation de l'id de projet $projectid = 0; -if ($_GET["projectid"]) { +if (isset($_GET["projectid"])) { $projectid = GETPOST("projectid", 'int'); } @@ -782,7 +782,8 @@ if ($id > 0 || !empty($ref)) { if (!$objp->fk_product > 0) { $nbfreeproduct++; } else { - $remaintodispatch = price2num($objp->qty - ((float) $products_dispatched[$objp->rowid]), 5); // Calculation of dispatched + $alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0; + $remaintodispatch = price2num($objp->qty - ((float) $alreadydispatched), 5); // Calculation of dispatched if ($remaintodispatch < 0 && empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN)) { $remaintodispatch = 0; } @@ -799,7 +800,7 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; // hidden fields for js function print ''; - print ''; + print ''; print ''; if (empty($conf->cache['product'][$objp->fk_product])) { @@ -860,7 +861,7 @@ if ($id > 0 || !empty($ref)) { print ''.$objp->qty.''; // Already dispatched - print ''.$products_dispatched[$objp->rowid].''; + print ''.$alreadydispatched.''; if (isModEnabled('productbatch') && $objp->tobatch > 0) { $type = 'batch'; From 226194142d167f9623c7e915a347b66a0927115d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 14:58:49 +0100 Subject: [PATCH 3/8] Doc --- htdocs/modulebuilder/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/README.md b/htdocs/modulebuilder/README.md index 7bafab32ae3..26b0ecf717b 100644 --- a/htdocs/modulebuilder/README.md +++ b/htdocs/modulebuilder/README.md @@ -7,7 +7,7 @@ has to offer for module development. If you don't need to develop your own module/application, you just don't need this. -After enabling this module, you should find features to generate or edit modules/application from menu *Home - Admin tools - Module builder* +After enabling this module, you should find features to generate or edit modules/application from menu *Home - Tools - Module builder* Documentation ------------- From 5ecaacf36e2bf181ee47bf537b6360166fca650a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 15:30:55 +0100 Subject: [PATCH 4/8] Fix tooltip --- htdocs/core/tpl/objectline_view.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 00ff356768e..be24a555a3c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -292,7 +292,8 @@ if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { } } $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); - $tooltiponprice .= ''; + + $tooltiponprice = ''; $tooltiponpriceend = ''; } From b707c79d6d211637825b4544749083c8d854073d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 15:46:17 +0100 Subject: [PATCH 5/8] FIX look and feel v17 (always a message instead of empty lists) --- htdocs/core/tpl/contacts.tpl.php | 15 +++++++++++---- htdocs/langs/en_US/main.lang | 3 +++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 9d9bd226fd6..25e0f914807 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -280,9 +280,6 @@ print ''; print '
'."\n"; print ''; -//print ''; -//print ''; - print ''; print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"], "thirdparty_name", "", $param, "", $sortfield, $sortorder); print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder); @@ -316,7 +313,17 @@ foreach ($list as $entry) { print ""; } - +if (empty($list)) { + $colspan = 5 + ($permission ? 1 : 0); + print ''; +} print "
'; + if (is_object($object) && !empty($object->thirdparty)) { + print $form->textwithpicto($langs->trans("NoSpecificContactAddress"), $langs->trans("NoSpecificContactAddressBis")); + } else { + print $langs->trans("NoSpecificContactAddress"); + } + print ''; + print '
"; print '
'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ebdbfce73fa..73dfee80a69 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1211,3 +1211,6 @@ CreatedByPublicPortal=Created from Public portal UserAgent=User Agent InternalUser=Internal user ExternalUser=External user +NoSpecificContactAddress=No specific contact or address +NoSpecificContactAddressBis=This tab is dedicated to force specific contacts or addresses for the current object. Use it only if you want to define one or several specific contacts or addresses for the object when the information on the thirdparty is not enough or not accurate. + From 32e566f269a55ae9289832dfecaa07ff747154fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 15:47:47 +0100 Subject: [PATCH 6/8] Update dispatch.php --- 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 b209b6905f3..504336f0a6e 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -68,7 +68,7 @@ $hookmanager->initHooks(array('ordersupplierdispatch')); // Recuperation de l'id de projet $projectid = 0; -if (isset($_GET["projectid"])) { +if (GETPOSTISSET("projectid")) { $projectid = GETPOST("projectid", 'int'); } From 2755e3dad73124c126246a76385551ccd8e00f8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 15:53:25 +0100 Subject: [PATCH 7/8] Fix typo --- htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 8e14e99b1c6..5a9f91ea71a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -277,7 +277,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); +$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ab06e1b5fe6..ed00efdf10a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -223,7 +223,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); +$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 9baa1b63f60..7522d80f403 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -296,7 +296,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array('socid'=>$socid,'arrayfields'=>&$arrayfields); +$parameters = array('socid'=>$socid, 'arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 4d683692deff22dda3dc412595e03b3a69da27d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Jan 2023 16:51:01 +0100 Subject: [PATCH 8/8] Fix autofill js --- htdocs/salaries/card.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 0b961648115..86a72c08053 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -658,18 +658,25 @@ if ($action == 'create' && $permissiontoadd) { print '