From ba1ca6dc7d987d1a8a73578c1e021df8fd6ebd21 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 12 Mar 2024 11:46:12 +0100 Subject: [PATCH] module delivery_note not exist (no own module descriptor) is global MAIN_SUBMODULE_DELIVERY --- htdocs/admin/delivery.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/core/lib/propal.lib.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 0e6339c36f8..123126c693e 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -58,7 +58,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; // Shipment note -if (isModEnabled('delivery_note') && !getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) { +if (isModEnabled('shipping') && !getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) { // This option should always be set to on when module is on. dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 6c407d828bf..61dd58436d2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -3002,7 +3002,7 @@ if ($action == 'create' && $usercancreate) { // Create shipment if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { - $arrayforbutaction[] = array('lang' => 'sendings', 'enabled' => (isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm' => $user->hasRight('expedition', 'creer'), 'label' => 'CreateShipment', 'url' => '/expedition/shipment.php?id='.$object->id); + $arrayforbutaction[] = array('lang' => 'sendings', 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm' => $user->hasRight('expedition', 'creer'), 'label' => 'CreateShipment', 'url' => '/expedition/shipment.php?id='.$object->id); /* if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 538d616f155..c0439e3193e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4224,7 +4224,7 @@ abstract class CommonObject } elseif ($objecttype == 'delivery') { $classpath = 'delivery/class'; $subelement = 'delivery'; - $module = 'delivery_note'; + $module = 'shipping'; } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 35f3d9c3e01..2b4be14b443 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9191,8 +9191,8 @@ class Form } } elseif ($objecttype == 'delivery') { $tplpath = 'delivery'; - if (!isModEnabled('delivery_note')) { - continue; // Do not show if module disabled + if (!getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) { + continue; // Do not show if sub module disabled } } elseif ($objecttype == 'ficheinter') { $tplpath = 'fichinter'; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 91c53523965..46cf91ce684 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,7 +43,7 @@ function propal_prepare_head($object) $h++; if ((empty($conf->commande->enabled) && ((isModEnabled("shipping") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) - || (isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { + || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { $langs->load("sendings"); $text = ''; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;