From 0f1b63ec9b5f897759fd1cdfe8d0ed92f2121b53 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:38:37 +0200 Subject: [PATCH 01/27] fix: cannot edit propal note --- htdocs/core/tpl/notes.tpl.php | 1 + htdocs/modulebuilder/template/class/myobject.class.php | 2 +- htdocs/user/class/user.class.php | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 0430ec16e0e..f4ae0386807 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -64,6 +64,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { $permission = $user->hasRight("propale", "creer"); + var_dump($user->hasRight("propale", "creer")); } elseif ($module == 'supplier_proposal') { $permission = $user->hasRight("supplier_proposal", "creer"); } elseif ($module == 'fichinter') { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a350fc4a8d6..e9eb2167b13 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -995,7 +995,7 @@ class MyObject extends CommonObject $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { - $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; + $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_dolipadbaes_standard'; } if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e57fc387bc7..9db6e80e4d6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -686,6 +686,7 @@ class User extends CommonObject 'shipping' => 'expedition', 'task' => 'task@projet', 'fichinter' => 'ficheinter', + 'propale' => 'propal', 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', @@ -718,8 +719,6 @@ class User extends CommonObject $permlevel1 = $tmp[0]; } - //var_dump($module); - //var_dump($this->rights->$module); if (!in_array($module, $conf->modules)) { return 0; } From 346d6cec5a4155b73087e1b67b5a06705df7962a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:40:16 +0200 Subject: [PATCH 02/27] fix: cannot edit propal note --- htdocs/core/tpl/notes.tpl.php | 1 - htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index f4ae0386807..0430ec16e0e 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -64,7 +64,6 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { $permission = $user->hasRight("propale", "creer"); - var_dump($user->hasRight("propale", "creer")); } elseif ($module == 'supplier_proposal') { $permission = $user->hasRight("supplier_proposal", "creer"); } elseif ($module == 'fichinter') { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e9eb2167b13..a350fc4a8d6 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -995,7 +995,7 @@ class MyObject extends CommonObject $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { - $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_dolipadbaes_standard'; + $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; } if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { From 15b19840fb8f224d7fca9b48a7c3a7d41eb99783 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:40:47 +0200 Subject: [PATCH 03/27] fix: cannot edit propal note --- htdocs/user/class/user.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9db6e80e4d6..bad796b966f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -719,6 +719,8 @@ class User extends CommonObject $permlevel1 = $tmp[0]; } + //var_dump($module); + //var_dump($this->rights->$module); if (!in_array($module, $conf->modules)) { return 0; } From 589df5e63dea803868b3a159c75be4cca8b77cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Thu, 27 Oct 2022 16:13:11 +0200 Subject: [PATCH 04/27] check if contact is active before creating associated ticket --- htdocs/public/ticket/create_ticket.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index f2b72693a13..e81d9802aac 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -145,8 +145,19 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Le premier contact trouvé est utilisé pour déterminer le contact suivi $contacts = $object->searchContactByEmail($origin_email); + // Ensure that contact is active and select first active contact + $cid = 0; + foreach ($contacts as $key => $contact) { + if ($contact->statut !== "1") { + $cid = $key + 1; + } else { + break; + } + } + + // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[0]->socid) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[$cid]->socid) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; @@ -198,8 +209,8 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { } if (is_array($contacts) and count($contacts) > 0) { - $object->fk_soc = $contacts[0]->socid; - $usertoassign = $contacts[0]->id; + $object->fk_soc = $contacts[$cid]->socid; + $usertoassign = $contacts[$cid]->id; } $ret = $extrafields->setOptionalsFromPost(null, $object); From 634348d0483158489107fa9da2aff7f82e136658 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:02:52 +0100 Subject: [PATCH 05/27] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index e81d9802aac..0e6515bedd2 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -148,9 +148,8 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Ensure that contact is active and select first active contact $cid = 0; foreach ($contacts as $key => $contact) { - if ($contact->statut !== "1") { - $cid = $key + 1; - } else { + if ((int) $contact->statut == 1) { + $cid = $key; break; } } From 414b183eadf547df2c5db76afe85b253fc7eac3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:07:31 +0100 Subject: [PATCH 06/27] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 0e6515bedd2..ec47aaf4b18 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -146,7 +146,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $contacts = $object->searchContactByEmail($origin_email); // Ensure that contact is active and select first active contact - $cid = 0; + $cid = -1; foreach ($contacts as $key => $contact) { if ((int) $contact->statut == 1) { $cid = $key; @@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[$cid]->socid) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid <= 0 || empty($contacts[$cid]->socid))) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; From 870ffb6ddaf627aa513714a440d16c604cfc04b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:10:17 +0100 Subject: [PATCH 07/27] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index ec47aaf4b18..60d10f012fc 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -207,7 +207,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $object->fk_soc = $searched_companies[0]->id; } - if (is_array($contacts) and count($contacts) > 0) { + if (is_array($contacts) && count($contacts) > 0) { $object->fk_soc = $contacts[$cid]->socid; $usertoassign = $contacts[$cid]->id; } From bcfcbf19ec8c6a1750e66ef6137f9bdfbb250164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Wed, 2 Nov 2022 14:11:37 +0100 Subject: [PATCH 08/27] strictly inferior, please --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 60d10f012fc..1b96cc5ebd6 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid <= 0 || empty($contacts[$cid]->socid))) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid < 0 || empty($contacts[$cid]->socid))) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; From 221ce01cdcf3ff89075f95a21f9957b4e45bfddd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Nov 2022 08:02:56 +0100 Subject: [PATCH 09/27] FIX Accountancy - Better warning for situation invoice in index --- htdocs/accountancy/index.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 18277eb6751..73bdccc1dba 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -81,12 +81,7 @@ $help_url = ''; llxHeader('', $langs->trans("AccountancyArea"), $help_url); -if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { - print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); - - print ''.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."\n"; - print "
"; -} elseif ($conf->accounting->enabled) { +if ($conf->accounting->enabled) { $step = 0; $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) @@ -111,15 +106,17 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S '; } - print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); + if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")); + print "
"; + } + print '
'; // hideobject is to start hidden print "
\n"; print ''.$langs->trans("AccountancyAreaDescIntro")."
\n"; if (!empty($user->rights->accounting->chartofaccount)) { - print "
\n"; print "
\n"; - print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n"; print '
'; print "
\n"; From e512c9aeee8519ad03339fd2a10f7e05b4cedd29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Nov 2022 14:04:01 +0100 Subject: [PATCH 10/27] Fix trans --- htdocs/core/class/utils.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9a330c7aba5..007d34491d6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -161,6 +161,7 @@ class Utils } if ($count > 0) { + $langs->load("admin"); $this->output = $langs->trans("PurgeNDirectoriesDeleted", $countdeleted); if ($count > $countdeleted) { $this->output .= '
'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted)); From a16c50593d53956a8439f12fae23009e4dfebfe6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Nov 2022 15:13:51 +0100 Subject: [PATCH 11/27] Fix dark theme mode --- htdocs/theme/eldy/global.inc.php | 13 ++++++++++--- htdocs/theme/md/style.css.php | 10 +++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a73eb67fccb..300c3cbf90d 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1966,7 +1966,7 @@ td.showDragHandle { .side-nav-vert { position: sticky; top: 0px; - z-index: 1001; + z-index: 1005; } global->THEME_DARKMODEENABLED)) { ?> @@ -5354,10 +5354,17 @@ td.cal_other_month { /* ============================================================================== */ -/* Ajax - Liste deroulante de l'autocompletion */ +/* Ajax - Combo list for autocompletion */ /* ============================================================================== */ -.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; } +.ui-widget-content { + border: solid 1px rgba(0,0,0,.3); + background: var(--colorbackbody) !important; + color: var(--colortext) !important; +} +/*.ui-widget-header { + background: var(--colorbacktitle); +}*/ .ui-autocomplete-loading { background: white url() right center no-repeat; } .ui-autocomplete { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 50fff15b8f0..18a22d997da 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2118,7 +2118,7 @@ body.sidebar-collapse .side-nav, body.sidebar-collapse .login_block .side-nav-vert { position: sticky; top: 0px; - z-index: 1001; + z-index: 1005; } @@ -5188,10 +5188,14 @@ td.cal_other_month { /* ============================================================================== */ -/* Ajax - Liste deroulante de l'autocompletion */ +/* Ajax - Combo list for autocompletion */ /* ============================================================================== */ -.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; } +.ui-widget-content { + border: solid 1px rgba(0,0,0,.3); + background: var(--colorbackbody) !important; + color: var(--colortext) !important; +} .ui-autocomplete-loading { background: white url() right center no-repeat; } .ui-autocomplete { From af6a708523684391e684e1df96e0c44943628ed4 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 8 Nov 2022 14:20:09 +0100 Subject: [PATCH 12/27] FIX : Missing $object for online signature link build --- htdocs/core/lib/signature.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 1dbefb5719a..c59acbea209 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -59,7 +59,7 @@ function showOnlineSignatureUrl($type, $ref) */ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) { - global $conf, $db, $langs, $dolibarr_main_url_root; + global $conf, $object, $dolibarr_main_url_root; $ref = str_replace(' ', '', $ref); $out = ''; From 8b2bf7e76eb45fcb8291db7b3e0fc6547f8b1d57 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Tue, 8 Nov 2022 15:11:30 +0100 Subject: [PATCH 13/27] Fixe issue in htdocs/core/boxes/box_services_contracts.php --- htdocs/core/boxes/box_services_contracts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 3d1e640f34b..433db55a515 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -124,7 +124,7 @@ class box_services_contracts extends ModeleBoxes $contractlinestatic->label = $objp->label; $contractlinestatic->description = $objp->description; $contractlinestatic->type = $objp->type; - $contractlinestatic->product_id = $objp->product_id; + $contractlinestatic->fk_product = $objp->product_id; $contractlinestatic->product_ref = $objp->product_ref; $contractlinestatic->product_type = $objp->product_type; $contractlinestatic->statut = $objp->contractline_status; From 3fd4403bc7e9e9f4162354e354af5c40b958f154 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 8 Nov 2022 22:28:59 +0100 Subject: [PATCH 14/27] Can show some tab entries as disabled (greyed link) --- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/core/lib/product.lib.php | 24 +++++++++++++++++++----- htdocs/langs/en_US/admin.lang | 2 +- htdocs/product/list.php | 5 ++--- htdocs/theme/eldy/global.inc.php | 6 ++++++ htdocs/theme/md/style.css.php | 6 ++++++ 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5ec311b0c5..af4228c9777 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1810,7 +1810,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di /** * Show tab header of a card * - * @param array $links Array of tabs. Currently initialized by calling a function xxx_admin_prepare_head + * @param array $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name (document', 'info', 'ldap', ....) * @param string $title Title * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after) @@ -1831,7 +1831,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0 /** * Show tabs of a record * - * @param array $links Array of tabs. Note that label into $links[$i][1] must be already HTML escaped. + * @param array $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name * @param string $title Title * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom' @@ -1934,7 +1934,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $out .= '
'; if (!empty($links[$i][0])) { $titletoshow = preg_replace('/<.*$/', '', $links[$i][1]); - $out .= ''; + $out .= ''; } $out .= $links[$i][1]; if (!empty($links[$i][0])) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 7795f927c19..79d8ac57834 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -53,11 +53,19 @@ function product_prepare_head($object) $head[$h][2] = 'card'; $h++; - if (!empty($object->status) && $usercancreadprice) { - $head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id; - $head[$h][1] = $langs->trans("SellingPrices"); - $head[$h][2] = 'price'; - $h++; + if (!empty($object->status)) { + if ($usercancreadprice) { + $head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id; + $head[$h][1] = $langs->trans("SellingPrices"); + $head[$h][2] = 'price'; + $h++; + } else { + $head[$h][0] = '#'; + $head[$h][1] = $langs->trans("SellingPrices"); + $head[$h][2] = 'price'; + $head[$h][5] = 'disabled'; + $h++; + } } if (!empty($object->status_buy) || (isModEnabled('margin') && !empty($object->status))) { // If margin is on and product on sell, we may need the cost price even if product os not on purchase @@ -69,6 +77,12 @@ function product_prepare_head($object) $head[$h][1] = $langs->trans("BuyingPrices"); $head[$h][2] = 'suppliers'; $h++; + } else { + $head[$h][0] = '#'; + $head[$h][1] = $langs->trans("BuyingPrices"); + $head[$h][2] = 'suppliers'; + $head[$h][5] = 'disabled'; + $h++; } } } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index dae72d3d703..eb03e174525 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2316,7 +2316,7 @@ UsePassword=Use a password UseOauth=Use a OAUTH token Images=Images MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form -MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with an IP Address +MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with the same IP address CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: ScriptIsEmpty=The script is empty ShowHideTheNRequests=Show/hide the %s SQL request(s) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 47110ac873f..e637e478df4 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -422,7 +422,7 @@ $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_u if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ' p.fk_unit, cu.label as cu_label,'; } -$sql .= ' MIN(pfp.unitprice) as minsellprice'; +$sql .= ' MIN(pfp.unitprice) as bestpurchaseprice'; if (isModEnabled('variants') && (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD) && !$show_childproducts)) { $sql .= ', pac.rowid as prod_comb_id'; } @@ -1727,8 +1727,7 @@ while ($i < min($num, $limit)) { // Better buy price if (!empty($arrayfields['p.minbuyprice']['checked'])) { print ''; - if ($obj->tobuy && $obj->minsellprice != '' && $usercancreadprice) { - //print price($obj->minsellprice).' '.$langs->trans("HT"); + if ($obj->tobuy && $obj->bestpurchaseprice != '' && $usercancreadprice) { if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) { if ($product_fourn->product_fourn_price_id > 0) { if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 01f8b6329cc..86df18dfb37 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2536,6 +2536,12 @@ span.mainmenuaspan.tmenudisabled { cursor: not-allowed; } +a.disabled { + color: #aaa; + text-decoration: none !important; + cursor: default; +} + a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { padding: 0px 2px 0px 2px; margin: 0px 0px 0px 0px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6a21b5a6812..3abb4e8773e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2586,6 +2586,12 @@ span.mainmenuaspan.tmenudisabled { cursor: not-allowed; } +a.disabled { + color: #aaa; + text-decoration: none !important; + cursor: default; +} + a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { font-weight: normal; padding: 0px 5px 0px 5px; From 148c285614f50bc922d3e5fd8e7cfba1dc432cac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Nov 2022 13:10:13 +0100 Subject: [PATCH 15/27] Add tooltip to explain feature to send ticket email --- htdocs/core/class/html.formticket.class.php | 3 +++ htdocs/langs/en_US/ticket.lang | 1 + htdocs/product/fournisseurs.php | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 0e5e6ff9e7c..f43faf02c6c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1412,6 +1412,9 @@ class FormTicket $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); print ' '; print ''; + $texttooltip = $langs->trans("TicketMessageSendEmailHelp", '{s1}'); + $texttooltip = str_replace('{s1}', $langs->trans('MarkMessageAsPrivate'), $texttooltip); + print ' '.$form->textwithpicto('', $texttooltip, 1, 'help'); print ''; // Private message (not visible by customer/external user) diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 1696018db89..0cde40ba20a 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -241,6 +241,7 @@ TicketMessageMailIntroAutoNewPublicMessage=A new message was posted on the ticke TicketAssignedToYou=Ticket assigned TicketAssignedEmailBody=You have been assigned the ticket #%s by %s MarkMessageAsPrivate=Mark message as private +TicketMessageSendEmailHelp=An email will be sent to all assigned contact (internal contacts, but also external contacts except if the option "%s" is checked) TicketMessagePrivateHelp=This message will not display to external users TicketEmailOriginIssuer=Issuer at origin of the tickets InitialMessage=Initial Message diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 2ccdc7409f3..5eae5c45dc9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -949,8 +949,8 @@ END; 'pfp.quantity'=>array('label'=>$langs->trans("QtyMin"), 'checked'=>1, 'position'=>5), 'pfp.unitprice'=>array('label'=>$langs->trans("UnitPriceHT"), 'checked'=>1, 'position'=>9), 'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => isModEnabled('multicurrency'), 'checked'=>0, 'position'=>10), - 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13), - 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14), + 'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>-1, 'position'=>13), + 'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>-1, 'position'=>14), 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15), 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16), 'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => getDolGlobalInt('PRODUCT_USE_SUPPLIER_PACKAGING'), 'checked'=>0, 'position'=>17), From 4881688aa6c18b2d41b664b8714de31a303b118e Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 9 Nov 2022 19:13:44 +0100 Subject: [PATCH 16/27] fix type of variable from string to object --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index feb27715da2..cb984736b66 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1942,7 +1942,7 @@ class ExtraFields * Return HTML string to print separator extrafield * * @param string $key Key of attribute - * @param string $object Object + * @param object $object Object * @param int $colspan Value of colspan to use (it must includes the first column with title) * @param string $display_type "card" for form display, "line" for document line display (extrafields on propal line, order line, etc...) * @param string $mode Show output ('view') or input ('create' or 'edit') for extrafield From 8f9828ad392026a62c5b894a4bc77726a511e709 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 10 Nov 2022 09:59:25 +0100 Subject: [PATCH 17/27] NEW can sort and preselected best supplier price --- htdocs/core/class/html.form.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 13c99dea052..4a11fb1b0d5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3679,7 +3679,11 @@ class Form $sql .= " AND p.tobuy = 1"; $sql .= " AND s.fournisseur = 1"; $sql .= " AND p.rowid = ".((int) $productid); - $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; + if (empty($conf->global->PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED)) { + $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; + } else { + $sql .= " ORDER BY pfp.unitprice ASC"; + } dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); $result = $this->db->query($sql); @@ -3701,7 +3705,7 @@ class Form $opt = '