From 89b558a1b1696f4b66d90a5fa79ebf2644150b89 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Tue, 23 Jul 2024 19:36:09 +0200 Subject: [PATCH 1/5] Fixes loss of rich text wrapping for translated category descriptions (#30433) If multi-language is enabled, saving translations of category descriptions loses the rich text wrapping (wysiwyg) --- htdocs/categories/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 9791cdeb5be44..09c61378c7848 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -131,7 +131,7 @@ foreach ($object->multilangs as $key => $value) { // recording of new values in the object $libelle = GETPOST('libelle-'.$key, 'alpha'); - $desc = GETPOST('desc-'.$key); + $desc = GETPOST('desc-'.$key, 'restricthtml'); if (empty($libelle)) { $error++; From 1495c9d3ceafd62ac9750df00dbe8c0915922183 Mon Sep 17 00:00:00 2001 From: atm-lucas <121817516+atm-lucasmantegari@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:13:22 +0200 Subject: [PATCH 2/5] Add element on childTables (#30445) --- htdocs/product/class/product.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e754148f6d5ed..6532aea871685 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -70,7 +70,10 @@ class Product extends CommonObject 'facturedet' => array('name' => 'Invoice', 'parent' => 'facture', 'parentkey' => 'fk_facture'), 'contratdet' => array('name' => 'Contract', 'parent' => 'contrat', 'parentkey' => 'fk_contrat'), 'facture_fourn_det' => array('name' => 'SupplierInvoice', 'parent' => 'facture_fourn', 'parentkey' => 'fk_facture_fourn'), - 'commande_fournisseurdet' => array('name' => 'SupplierOrder', 'parent' => 'commande_fournisseur', 'parentkey' => 'fk_commande') + 'commande_fournisseurdet' => array('name' => 'SupplierOrder', 'parent' => 'commande_fournisseur', 'parentkey' => 'fk_commande'), + 'mrp_production' => array('name' => 'Mo', 'parent' => 'mrp_mo', 'parentkey' => 'fk_mo' ), + 'bom_bom' => array('name' => 'BOM'), + 'bom_bomline' => array('name' => 'BOMLine', 'parent' => 'bom_bom', 'parentkey' => 'fk_bom'), ); /** From bc69a62af0ee91effa99416c9a87fb6c3ae18456 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 24 Jul 2024 20:16:21 +0200 Subject: [PATCH 3/5] fix: on edit line contrat, if failed at the end, stay on edit mode (#30259) --- htdocs/contrat/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 0ed49cc8aa67b..8e21569ec5e7f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -802,6 +802,8 @@ $result = $objectline->update($user); if ($result < 0) { $error++; + $action = 'editline'; + $_GET['rowid'] = GETPOST('elrowid'); setEventMessages($objectline->error, $objectline->errors, 'errors'); } } From 517e5e732cf9294a8a03897d65b76cd094d95fdb Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 25 Jul 2024 14:29:12 +0200 Subject: [PATCH 4/5] fix: load translation for extrafields in PDF (#30461) --- htdocs/core/class/commondocgenerator.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ab8d1e3622412..1d7008aae59ca 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1472,6 +1472,9 @@ public function getExtrafieldsInHtml($object, $outputlangs, $params = array()) $field = new stdClass(); $field->rank = intval($extrafields->attributes[$object->table_element]['pos'][$key]); $field->content = $this->getExtrafieldContent($object, $key, $outputlangs); + if (isset($extrafields->attributes[$object->table_element]['langfile'][$key])) { + $outputlangs->load($extrafields->attributes[$object->table_element]['langfile'][$key]); + } $field->label = $outputlangs->transnoentities($label); $field->type = $extrafields->attributes[$object->table_element]['type'][$key]; From 7c9e6b1fb91450466b4cd1032811601e0d8da629 Mon Sep 17 00:00:00 2001 From: Thibault Fiacre <57494317+atm-thibaultf@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:56:13 +0200 Subject: [PATCH 5/5] FIX lang output for sales representative on PDF (#30469) --- htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- .../modules/stocktransfer/doc/pdf_eagle_proforma.modules.php | 2 +- .../core/modules/mymodule/doc/pdf_standard_myobject.modules.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 56057582d1100..cd47953cf86d9 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -1051,7 +1051,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b9d4661b679b2..7a5a2087e3445 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1422,7 +1422,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 449d29f62a83b..28e0db2d5f455 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1597,7 +1597,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9a8e48e6f8335..dee3bb26f92d8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -2039,7 +2039,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1b583bab5f427..5f4db6651d6de 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2297,7 +2297,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 50a5af68ad43c..ed21843f07b3b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1627,7 +1627,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 67e49fca891ec..06fbdeb6414b9 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1704,7 +1704,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 83f0cb802e9b7..0b7dead51b4ae 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -1305,7 +1305,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlek $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 9826936f8abfa..b0e624126510e 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -1019,7 +1019,7 @@ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $output $posy += 4; $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); + $pdf->MultiCell($w, 3, $outputlangs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); } }