From 26c6908f667a00cd00737d26345e1917b3a1e82f Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 3 Jan 2022 13:22:07 +0100 Subject: [PATCH] Fix: Correctly display product translations --- htdocs/product/stock/movement_list.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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;