diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 87acc7a0032..73b89b5cd2e 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Ferran Marcet * * 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 @@ -729,6 +730,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea while ($i < ($limit ? min($num, $limit) : $num)) { $objp = $db->fetch_object($resql); + // Multilangs + if (!empty($conf->global->MAIN_MULTILANGS)) // If multilang is enabled + { + $sql = "SELECT label"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; + $sql .= " WHERE fk_product=".$objp->rowid; + $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; + $sql .= " LIMIT 1"; + + $result = $db->query($sql); + if ($result) + { + $objtp = $db->fetch_object($result); + if (!empty($objtp->label)) $objp->produit = $objtp->label; + } + } + $userstatic->id = $objp->fk_user_author; $userstatic->login = $objp->login; $userstatic->lastname = $objp->lastname; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 4db4451a878..4cfd169a3f8 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2022 Ferran Marcet * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -1001,6 +1001,23 @@ if ($resql) { $objp = $db->fetch_object($resql); + // Multilangs + if (!empty($conf->global->MAIN_MULTILANGS)) // If multilang is enabled + { + $sql = "SELECT label"; + $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; + $sql .= " WHERE fk_product=".$objp->rowid; + $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; + $sql .= " LIMIT 1"; + + $result = $db->query($sql); + if ($result) + { + $objtp = $db->fetch_object($result); + if (!empty($objtp->label)) $objp->produit = $objtp->label; + } + } + $userstatic->id = $objp->fk_user_author; $userstatic->login = $objp->login; $userstatic->lastname = $objp->lastname;