From e73573d7c488e05e21730a327fef6dc20c759eb5 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Tue, 4 Jan 2022 09:18:28 +0100 Subject: [PATCH] fix : allow create from other external modules --- htdocs/fourn/commande/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 510ed4f699a..597905768f9 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -8,7 +8,8 @@ * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ion Agorria - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2022 Charlene Benke * * 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 @@ -1211,13 +1212,15 @@ if (empty($reshook)) { if (!$error) { // If creation from another object of another module (Example: origin=propal, originid=1) if (!empty($origin) && !empty($originid)) { + $element = $subelement = $origin; + $classname = ucfirst($subelement); if ($origin == 'propal' || $origin == 'proposal') { - $classname = 'Propal'; $element = 'comm/propal'; $subelement = 'propal'; - } elseif ($origin == 'order' || $origin == 'commande') { - $classname = 'Commande'; + } + if ($origin == 'order' || $origin == 'commande') { $element = $subelement = 'commande'; - } else { + } + if ($origin == 'supplier_proposal') { $classname = 'SupplierProposal'; $element = 'supplier_proposal'; $subelement = 'supplier_proposal';