From c46e5ac34b6abcc09b210766c523de933e685fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2024 16:01:12 +0100 Subject: [PATCH 1/2] some fix for vinci --- .../modules/mrp/doc/pdf_vinci.modules.php | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index cc5bc784df0..1fd7f7d6005 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * 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 @@ -124,13 +124,13 @@ class pdf_vinci extends ModelePDFMo /** * Function to build pdf onto disk * - * @param CommandeFournisseur $object Id of object to generate - * @param Translate $outputlangs Lang output object - * @param string $srctemplatepath Full path of source filename for generator using a template file - * @param int $hidedetails Do not show line details - * @param int $hidedesc Do not show desc - * @param int $hideref Do not show ref - * @return int 1=OK, 0=KO + * @param Mo $object Id of object to generate + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1=OK, 0=KO */ public function write_file($object, $outputlangs = null, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) { @@ -235,10 +235,10 @@ class pdf_vinci extends ModelePDFMo $pdf->SetDrawColor(128, 128, 128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Mo")); + $pdf->SetSubject($outputlangs->transnoentities("ManufacturingOrder")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Mo")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("ManufacturingOrder")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { $pdf->SetCompression(false); } @@ -657,7 +657,7 @@ class pdf_vinci extends ModelePDFMo * Show payments table * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object order + * @param Mo $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output * @return int Return integer <0 if KO, >0 if OK @@ -674,7 +674,7 @@ class pdf_vinci extends ModelePDFMo * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object * @return integer @@ -1016,7 +1016,7 @@ class pdf_vinci extends ModelePDFMo * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return float|int Return topshift value @@ -1031,7 +1031,7 @@ class pdf_vinci extends ModelePDFMo } // Load translation files required by the page - $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); + $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings", "mrp")); $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1074,7 +1074,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFont('', 'B', $default_font_size + 3); $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $title = $outputlangs->transnoentities("Mo")." ".$outputlangs->convToOutputCharset($object->ref); + $title = $outputlangs->transnoentities("ManufacturingOrder")." ".$outputlangs->convToOutputCharset($object->ref); $pdf->MultiCell(100, 3, $title, '', 'R'); $posy += 1; @@ -1311,7 +1311,7 @@ class pdf_vinci extends ModelePDFMo * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param CommandeFournisseur $object Object to show + * @param Mo $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text @@ -1323,15 +1323,14 @@ class pdf_vinci extends ModelePDFMo } - /** * Define Array Column Field * - * @param object $object common object + * @param Mo $object common object * @param Translate $outputlangs langs - * @param int $hidedetails Do not show line details - * @param int $hidedesc Do not show desc - * @param int $hideref Do not show ref + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref * @return void */ public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) From 2670287dd4543035cb4834b22b3cd0a4d093a911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Mar 2024 16:34:41 +0100 Subject: [PATCH 2/2] translation --- htdocs/core/modules/mrp/doc/pdf_vinci.modules.php | 2 +- htdocs/langs/en_US/main.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 1fd7f7d6005..81e910d4e19 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -1421,7 +1421,7 @@ class pdf_vinci extends ModelePDFMo 'status' => true, 'width' => 25, // in mm 'title' => array( - 'textkey' => 'Size' + 'textkey' => 'Dimensions' ), 'border-left' => true, // add left line separator ); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 95042a5cc24..f519e098d01 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -562,6 +562,7 @@ New=New Discount=Discount Unknown=Unknown General=General +Dimensions=Dimensions Size=Size OriginalSize=Original size RotateImage=Rotate 90°