diff --git a/dev/tools/phan/stubs/restler.php b/dev/tools/phan/stubs/restler.php index 507d9415fce..7ff94758936 100644 --- a/dev/tools/phan/stubs/restler.php +++ b/dev/tools/phan/stubs/restler.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France */ // phpcs:disable PEAR.Commenting,Generic.NamingConventions,PEAR.NamingConventions,Squiz.Scope.MethodScope.Missing @@ -3162,7 +3163,7 @@ namespace Luracast\Restler { 505 => 'HTTP Version Not Supported', ); /** - * @param string $httpStatusCode http status code + * @param int $httpStatusCode http status code * @param string|null $errorMessage error message * @param array $details any extra detail about the exception * @param Exception $previous previous exception if any diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 3541c9c9cd8..3471264ec54 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -463,15 +463,11 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); } - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - //if (! $error && ! $notrigger) { - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_CREATE',$user); - // if ($result < 0) $error++; - // // End call triggers - //} + // Call triggers + if (! $error && ! $notrigger) { + $result=$this->call_trigger('BOOKKEEPING_CREATE', $user); + if ($result < 0) $error++; + } // Commit or rollback if ($error) { @@ -716,6 +712,11 @@ class BookKeeping extends CommonObject if (!$error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element.$mode); + // Call triggers + if (! $notrigger) { + $result=$this->call_trigger('BOOKKEEPING_CREATE', $user); + if ($result < 0) $error++; + } } // Commit or rollback @@ -1477,15 +1478,11 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR); } - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - //if (! $error && ! $notrigger) { - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_MODIFY',$user); - // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - // // End call triggers - //} + // Call triggers + if (! $error && ! $notrigger) { + $result=$this->call_trigger('BOOKKEEPING_MODIFY', $user); + if ($result < 0) $error++; + } // Commit or rollback if ($error) { @@ -1572,15 +1569,11 @@ class BookKeeping extends CommonObject $this->db->begin(); - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - //if (! $error && ! $notrigger) { - - // // Call triggers - // $result=$this->call_trigger('MYOBJECT_DELETE',$user); - // if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - // // End call triggers - //} + // Call triggers + if (! $error && ! $notrigger) { + $result=$this->call_trigger('BOOKKEEPING_DELETE', $user); + if ($result < 0) $error++; + } if (!$error) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.$mode; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index f4e12fd480f..62a925ff6cc 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -5,7 +5,8 @@ * Copyright (C) 2012-2107 Juanjo Menent * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2021-2022 Anthony Berton - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -140,6 +141,9 @@ if ($action == 'update') { if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) { dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOSTINT("MAIN_DOCUMENTS_LOGO_HEIGHT"), 'chaine', 0, '', $conf->entity); } + if (GETPOSTISSET('MAIN_PDF_FRAME_CORNER_RADIUS')) { + dolibarr_set_const($db, "MAIN_PDF_FRAME_CORNER_RADIUS", GETPOSTINT("MAIN_PDF_FRAME_CORNER_RADIUS"), 'chaine', 0, '', $conf->entity); + } if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) { dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); } @@ -516,6 +520,14 @@ print ''.$langs->trans("MAIN_DOCUMENTS_LOGO_HEIGHT").''; print ''; +// Frame corner radius +print ''; +print $form->textwithpicto($langs->trans("PDFBoxFrameRoundedCorners"), $langs->trans("MAIN_PDF_FRAME_CORNER_RADIUS")); +print ''; +$arrval = array('0', '1', '2', '3'); +print $form->selectarray("MAIN_PDF_FRAME_CORNER_RADIUS", $arrval, getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0)); +print ''; + // Show project if (isModEnabled('project')) { print ''.$langs->trans("PDF_SHOW_PROJECT").''; @@ -525,8 +537,7 @@ if (isModEnabled('project')) { print ''; } -// - +// Hide customer code print ''.$langs->trans("MAIN_PDF_HIDE_CUSTOMER_CODE"); print ''; if ($conf->use_javascript_ajax) { @@ -537,7 +548,7 @@ if ($conf->use_javascript_ajax) { } print ''; -// Ref +// Hide Ref print ''.$langs->trans("HideRefOnPDF").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index e613e3dc386..e0d01f40051 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW * Copyright (C) 2024 Mélina Joum + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -122,9 +123,15 @@ abstract class CommonDocGenerator */ public $marge_basse; + /** + * @var int corner radius + */ + public $corner_radius; + /** * @var int<0,1> option logo */ + public $option_logo; public $option_tva; public $option_multilang; @@ -1109,6 +1116,33 @@ abstract class CommonDocGenerator $pdf->line($x, $y + $h, $x, $y); } + /** + * Print a rounded rectangle on the PDF + * + * @param TCPDF $pdf Object PDF + * @param float $x Abscissa of first point + * @param float $y Ordinate of first point + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param float $r Corner radius (can be an array for different radii per corner) + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int $hidebottom Hide bottom + * @param string $style Draw style (e.g. 'D' for draw, 'F' for fill, 'DF' for both) + * @return void + */ + public function printRoundedRect($pdf, $x, $y, $w, $h, $r, $hidetop = 0, $hidebottom = 0, $style = 'D') + { + // Top line + if (empty($hidetop) || $hidetop == -1) { + $pdf->RoundedRect($x, $y, $w, $h, $r, '1111', $style); + } else { + // Draw rounded rectangle with hidden top side + $pdf->RoundedRect($x, $y, $w, $h, $r, '0111', $style); + } + if (!empty($hidebottom)) { + $pdf->RoundedRect($x, $y, $w, $h, $r, '1101', $style); + } + } /** * uasort callback function to Sort columns fields diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 116f394bea3..632e264ad9d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12424,17 +12424,17 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param string $text Optional : short label on button. Can be escaped HTML content or full simple text. * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... * - * @param string|array $url Url for link or array of subbutton description + * @param string|array}> $url Url for link or array of subbutton description * - * Example when an array is used: - * $arrayforbutaction = array( - * 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - * 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')), - * ); ); + * Example when an array is used: + * $arrayforbutaction = array( + * 10 => array('attr' => array('class'=>''), 'lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + * 20 => array('attr' => array('class'=>''), 'lang'=>'mymodule', 'enabled'=>isModEnabled("mymodule"), 'perm'=>$user->hasRight('mymodule', 'write'), 'label' => 'MyModuleAction', 'urlroot'=>dol_build_patch('/mymodule/mypage.php?action=create')), + * ); ); * @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method. * @param int|boolean $userRight User action right * // phpcs:disable - * @param array $params = [ // Various params for future : recommended rather than adding more function arguments + * @param array{confirm?:array{url?:string,title?:string,content?:string,action-btn-label?:string,cancel-btn-label?:string,modal?:bool},attr?:array,areDropdownButtons?:bool,backtopage?:string,lang?:string,enabled?:bool,perm?:int<0,1>,label?:string,url?:string,isDropdown?:int<0,1>,isDropDown?:int<0,1>} $params = [ // Various params for future : recommended rather than adding more function arguments * 'attr' => [ // to add or override button attributes * 'xxxxx' => '', // your xxxxx attribute you want * 'class' => 'reposition', // to add more css class to the button class attribute @@ -12447,7 +12447,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * 'cancel-btn-label' => '', // Override label of cancel button, if empty default label use "CloseDialog" lang key * 'content' => '', // Override text of content, if empty default content use "ConfirmBtnCommonContent" lang key * 'modal' => true, // true|false to display dialog as a modal (with dark background) - * 'isDropDrown' => false, // true|false to display dialog as a dropdown list (css dropdown-item with dark background) + * 'isDropDown' => false, // true|false to display dialog as a dropdown list (css dropdown-item with dark background) * ], * ] * // phpcs:enable @@ -12468,7 +12468,6 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $out = ''; - // @phan-suppress-next-line PhanTypeInvalidDimOffset if (isset($params["areDropdownButtons"]) && $params["areDropdownButtons"] === false) { foreach ($url as $button) { if (!empty($button['lang'])) { diff --git a/htdocs/core/lib/public.lib.php b/htdocs/core/lib/public.lib.php index 0ce710517de..47a3f0e4209 100644 --- a/htdocs/core/lib/public.lib.php +++ b/htdocs/core/lib/public.lib.php @@ -52,7 +52,11 @@ function checkNbPostsForASpeceificIp($object, $nb_post_max) $sql = "SELECT COUNT(".(!empty($object->table_rowid) ? $object->table_rowid : 'rowid').") as nb_posts"; $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element; $sql .= " WHERE ip = '".$db->escape($object->ip)."'"; - $sql .= " AND datec > '".$db->idate($minmonthpost)."'"; + if (array_key_exists('date_creation', $object->fields)) { + $sql .= " AND date_creation > '".$db->idate($minmonthpost)."'"; + } else { + $sql .= " AND datec > '".$db->idate($minmonthpost)."'"; + } $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index 8c80b0d85b2..bf3d192070b 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -122,6 +123,11 @@ class pdf_standard_actions */ public $page_largeur; + /** + * @var int corner radius + */ + public $corner_radius; + /** * @var array{fullpath:string} */ @@ -146,7 +152,7 @@ class pdf_standard_actions $this->date_edition = time(); $this->month = $month; $this->year = $year; - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); // Page size for A4 format $this->type = 'pdf'; $formatarray = pdf_getFormat(); @@ -424,7 +430,7 @@ class pdf_standard_actions $y = $pdf->GetY() + 2; - $pdf->Rect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse)); + $pdf->RoundedRect($this->marge_gauche, $y, ($this->page_largeur - $this->marge_gauche - $this->marge_droite), ($this->page_hauteur - $this->marge_haute - $this->marge_basse), $this->corner_radius, '1234', 'D'); $y = $pdf->GetY() + 1; return $y; 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 e67f123d7c1..90c47b49f81 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -9,7 +9,8 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -113,7 +114,7 @@ class pdf_standard_asset extends ModelePDFAsset $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); // Get source company $this->emetteur = $mysoc; if (empty($this->emetteur->country_code)) { @@ -368,10 +369,10 @@ class pdf_standard_asset extends ModelePDFAsset // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } // Add footer @@ -390,12 +391,12 @@ class pdf_standard_asset extends ModelePDFAsset $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -761,7 +762,7 @@ class pdf_standard_asset extends ModelePDFAsset //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -769,7 +770,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -959,7 +960,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1011,7 +1012,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 23fbc7c175e..3606b28ca31 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -1,7 +1,8 @@ +/* Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -78,7 +79,7 @@ class pdf_ban extends ModeleBankAccountDoc $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -206,7 +207,7 @@ class pdf_ban extends ModeleBankAccountDoc // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 27201aebf05..9f1852ccacc 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -89,7 +90,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -238,7 +239,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -385,7 +386,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->SetXY($this->marge_gauche, $posY); $txt = $outputlangs->transnoentitiesnoconv("SEPAFrstOrRecur").' * : '; $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L'); - $pdf->Rect(80, $posY, 5, 5); + $pdf->RoundedRect(80, $posY, 5, 5, $this->corner_radius, '1234', 'D'); $pdf->SetXY(80, $posY); if ($object->frstrecur == 'RCUR') { $pdf->MultiCell(5, 3, 'X', 0, 'L'); @@ -394,7 +395,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc $txt = $langs->transnoentitiesnoconv("ModeRECUR").' '.$langs->transnoentitiesnoconv("or"); $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L'); $posY += 6; - $pdf->Rect(80, $posY, 5, 5); + $pdf->RoundedRect(80, $posY, 5, 5, $this->corner_radius, '1234', 'D'); $pdf->SetXY(80, $posY); if ($object->frstrecur == 'FRST') { $pdf->MultiCell(5, 3, 'X', 0, 'L'); diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 9fb45623b37..8e6660856a7 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -2,8 +2,9 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2009-2015 Laurent Destailleur * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -86,6 +87,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); // Retrieves transmitter $this->emetteur = $mysoc; @@ -286,7 +288,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetXY(114, 15); $pdf->MultiCell(40, 2, $outputlangs->transnoentities("Signature"), 0, 'L'); - $pdf->Rect(9, 14, 192, 35); + $pdf->RoundedRect(9, 14, 192, 35, $this->corner_radius, '1234', 'D'); $pdf->line(9, 19, 112, 19); $pdf->line(9, 25, 112, 25); //$pdf->line(9, 31, 201, 31); @@ -297,7 +299,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Number of cheques $posy = 51; - $pdf->Rect(9, $posy, 192, 6); + $pdf->RoundedRect(9, $posy, 192, 6, $this->corner_radius, '1234', 'D'); $pdf->line(55, $posy, 55, $posy + 6); $pdf->line(140, $posy, 140, $posy + 6); $pdf->line(170, $posy, 170, $posy + 6); @@ -336,7 +338,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->MultiCell(20, 2, $outputlangs->transnoentities("Amount"), 0, 'R'); $pdf->line(9, $this->tab_top + 8, 201, $this->tab_top + 8); - $pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10); + $pdf->RoundedRect(9, $this->tab_top, 192, $this->tab_height + 10, $this->corner_radius, '1234', 'D'); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 8c711aea976..577708346cf 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -8,7 +8,8 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -107,7 +108,7 @@ class pdf_einstein extends ModelePDFCommandes $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -337,7 +338,7 @@ class pdf_einstein extends ModelePDFCommandes // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -377,7 +378,7 @@ class pdf_einstein extends ModelePDFCommandes // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -1200,7 +1201,7 @@ class pdf_einstein extends ModelePDFCommandes //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1208,7 +1209,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -1450,7 +1451,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -1506,7 +1507,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 460c7e10e64..e4e8140f882 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -8,7 +8,8 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -112,7 +113,7 @@ class pdf_eratosthene extends ModelePDFCommandes $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -374,7 +375,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -469,10 +470,10 @@ class pdf_eratosthene extends ModelePDFCommandes // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } // Add footer @@ -491,13 +492,13 @@ class pdf_eratosthene extends ModelePDFCommandes $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -1410,7 +1411,7 @@ class pdf_eratosthene extends ModelePDFCommandes //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1418,7 +1419,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1635,7 +1636,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -1692,7 +1693,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 10bc3ed2ecb..ca43aa31e92 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -108,7 +109,7 @@ class pdf_strato extends ModelePDFContract $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 0; // Display payment mode @@ -271,7 +272,7 @@ class pdf_strato extends ModelePDFContract // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -543,7 +544,7 @@ class pdf_strato extends ModelePDFContract */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 3); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 3, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter } /** @@ -566,7 +567,7 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->emetteur->name), 0, 'L', 0); $pdf->SetXY($this->marge_gauche, $posy + 5); - $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 20, '', 1); + $pdf->RoundedRect($this->marge_gauche, $posy + 5, $posmiddle - $this->marge_gauche - 5, 20, $this->corner_radius, '1234', 'D'); } if (!getDolGlobalString('CONTRACT_HIDE_THIRPARTY_SIGNATURE_SECTION_PDF')) { @@ -574,7 +575,7 @@ class pdf_strato extends ModelePDFContract $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->recipient->name), 0, 'L', 0); $pdf->SetXY($posmiddle + 5, $posy + 5); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 20, '', 1); + $pdf->RoundedRect($posmiddle + 5, $posy + 5, $this->page_largeur - $this->marge_droite - $posmiddle - 5, 20, $this->corner_radius, '1234', 'D'); } } @@ -715,7 +716,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetXY($posx, $posy - 5); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -773,7 +774,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); $pdf->SetTextColor(0, 0, 0); } diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 3df593da5d7..e61453a8fc2 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -6,9 +6,10 @@ * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2020 John BOTELLA - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -100,7 +101,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -309,7 +310,7 @@ class pdf_storm extends ModelePDFDeliveryOrder // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -335,7 +336,7 @@ class pdf_storm extends ModelePDFDeliveryOrder // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -615,11 +616,11 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->SetXY($this->marge_gauche, $posy); $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3; - $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->RoundedRect($this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D'); $pdf->SetXY($this->marge_gauche + 2, $posy + 2); $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":", '', 'L'); - $pdf->Rect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->RoundedRect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D'); $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2); $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("ForCustomer").':', '', 'L'); } @@ -657,7 +658,7 @@ class pdf_storm extends ModelePDFDeliveryOrder if (empty($hidetop)) { //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -665,7 +666,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -773,7 +774,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -833,7 +834,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index ef5ecdabcc9..5f9173e7581 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -5,9 +5,10 @@ * Copyright (C) 2008 Chiptronik * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -103,7 +104,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -294,7 +295,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -312,7 +313,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -608,11 +609,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetXY($this->marge_gauche, $posy); $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3; - $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->RoundedRect($this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D'); $pdf->SetXY($this->marge_gauche + 2, $posy + 2); $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("For").' '.$outputlangs->convToOutputCharset($mysoc->name).":", '', 'L'); - $pdf->Rect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25); + $pdf->RoundedRect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25, $this->corner_radius, '1234', 'D'); $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2); $pdf->MultiCell($larg_sign, 2, $outputlangs->trans("ForCustomer").':', '', 'L'); } @@ -647,7 +648,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 2); // Output Rec - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10); @@ -781,7 +782,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'D'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -841,7 +842,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index ac6dd9e1759..40415f5f2b9 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1,11 +1,12 @@ - * Copyright (C) 2005-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2024 MDW +/* Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014-2015 Marcos García + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -106,7 +107,7 @@ class pdf_espadon extends ModelePdfExpedition $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->watermark = ''; @@ -320,7 +321,7 @@ class pdf_espadon extends ModelePdfExpedition // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -448,7 +449,7 @@ class pdf_espadon extends ModelePdfExpedition $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1; $tab_top_newpage = $tab_topbeforetrackingnumber; } - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { if (empty($height_trackingnumber)) { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); @@ -456,7 +457,7 @@ class pdf_espadon extends ModelePdfExpedition $height_note = $this->page_hauteur - ($tab_top + $heightforfooter) + $height_trackingnumber + 1; $tab_top = $tab_topbeforetrackingnumber; } - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -475,7 +476,7 @@ class pdf_espadon extends ModelePdfExpedition $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); @@ -485,7 +486,7 @@ class pdf_espadon extends ModelePdfExpedition $height_note = $posyafter - $tab_top + $height_trackingnumber + 1; $tab_top = $tab_topbeforetrackingnumber; } - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -952,7 +953,7 @@ class pdf_espadon extends ModelePdfExpedition if (empty($hidetop)) { if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -960,7 +961,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1144,7 +1145,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Sender"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(255, 255, 255); } @@ -1199,7 +1200,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index bfc9ee0a2cb..fccb96c7e60 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -98,7 +99,7 @@ class pdf_merou extends ModelePdfExpedition $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo // Get source company @@ -256,7 +257,7 @@ class pdf_merou extends ModelePdfExpedition // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -440,7 +441,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetXY(170, $tab_top); $pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyToShip"), 0, 'C', 1); } - $pdf->Rect(10, $tab_top, 190, $tab_height); + $pdf->RoundedRect(10, $tab_top, 190, $tab_height, $this->corner_radius, '1234', 'D'); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore @@ -631,7 +632,7 @@ class pdf_merou extends ModelePdfExpedition $blExpX = $Xoff - 20; $blW = 52; $Ydef = $Yoff; - $pdf->Rect($blExpX, $Yoff, $blW, 26); + $pdf->RoundedRect($blExpX, $Yoff, $blW, 26, $this->corner_radius, '1234', 'D'); $object->fetch_thirdparty(); @@ -674,7 +675,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->SetXY($blDestX, $Yoff - 4); $pdf->MultiCell($blW, 3, $outputlangs->transnoentities("Recipient"), 0, 'L'); - $pdf->Rect($blDestX, $Yoff - 1, $blW, 26); + $pdf->RoundedRect($blDestX, $Yoff - 1, $blW, 26, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetFont('', 'B', $default_font_size - 3); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index aef58954d10..5cf08c6ad01 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -3,8 +3,9 @@ * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -106,7 +107,7 @@ class pdf_rouget extends ModelePdfExpedition $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->watermark = ''; @@ -351,7 +352,7 @@ class pdf_rouget extends ModelePdfExpedition // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -399,7 +400,7 @@ class pdf_rouget extends ModelePdfExpedition // Notes if (!empty($object->note_public)) { $pdf->SetFont('', '', $default_font_size - 1); // Dans boucle pour gerer multi-page - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); } $nexY = $pdf->GetY(); @@ -407,7 +408,7 @@ class pdf_rouget extends ModelePdfExpedition // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 3, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -824,7 +825,7 @@ class pdf_rouget extends ModelePdfExpedition * * @param TCPDF $pdf Object PDF * @param float|int $tab_top Top position of table - * @param float|int $tab_height Height of table (rectangle) + * @param float|int $tab_height Height of table (angle) * @param int $nexY Y * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array @@ -849,7 +850,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); @@ -1077,7 +1078,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Sender"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(255, 255, 255); } @@ -1132,7 +1133,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 2e69df6d355..88e18d4d23f 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -7,7 +7,8 @@ * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf * Copyright (C) 2020 Marc Guenneugues - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -119,7 +120,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -315,7 +316,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -759,7 +760,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->MultiCell(80, 5, $outputlangs->transnoentities("TripSociete"), '', 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender information @@ -791,7 +792,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->SetFont('', 'B', 8); $pdf->SetXY($posx, $posy - 5); $pdf->MultiCell(80, 5, $outputlangs->transnoentities("TripNDF")." :", 0, 'L'); - $pdf->rect($posx, $posy, $this->page_largeur - $this->marge_gauche - $posx, $hautcadre); + $pdf->RoundedRect($posx, $posy, $this->page_largeur - $this->marge_gauche - $posx, $hautcadre, $this->corner_radius, '1234', 'D'); // Information for expense report (dates and users workflow) if ($object->fk_user_author > 0) { @@ -901,8 +902,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->SetDrawColor(128, 128, 128); // Rect takes a length in 3rd parameter - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height); - // line prend une position y en 3eme param + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, '1234', 'D'); if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index fc5232ee3b5..143d5e9eddb 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -12,6 +12,7 @@ * Copyright (C) 2022 Anthony Berton * Copyright (C) 2022 Charlene Benke * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -120,7 +121,7 @@ class pdf_crabe extends ModelePDFFactures $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -516,7 +517,7 @@ class pdf_crabe extends ModelePDFFactures // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -556,7 +557,7 @@ class pdf_crabe extends ModelePDFFactures // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -1736,7 +1737,7 @@ class pdf_crabe extends ModelePDFFactures //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1744,7 +1745,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -2086,7 +2087,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -2142,7 +2143,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox - 2, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name @@ -2182,7 +2183,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); $pdf->MultiCell($widthrecbox, '', $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index a541bcf73aa..5513d1bbaf9 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -12,7 +12,8 @@ * Copyright (C) 2022 Anthony Berton * Copyright (C) 2022-2024 Alexandre Spangaro * Copyright (C) 2022-2024 Eric Seigne - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -207,7 +208,7 @@ class pdf_octopus extends ModelePDFFactures $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->posx_cumul_anterieur = 94; $this->posx_new_cumul = 130; $this->posx_current = 166; @@ -603,7 +604,7 @@ class pdf_octopus extends ModelePDFFactures // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $this->tab_top = $nexY + 6; $height_incoterms += 4; @@ -699,10 +700,10 @@ class pdf_octopus extends ModelePDFFactures // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($this->tab_top_newpage + $this->heightforfooter); - $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($this->tab_top + $this->heightforfooter); - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -721,13 +722,13 @@ class pdf_octopus extends ModelePDFFactures $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } $height_note = $posyafter - $this->tab_top_newpage; - $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $this->tab_top; - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + 20))) { @@ -1979,7 +1980,7 @@ class pdf_octopus extends ModelePDFFactures // MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } $tab_top += 4; } @@ -1988,7 +1989,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param // situation invoice $pdf->SetFont('', '', $default_font_size - 2); @@ -2304,7 +2305,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -2359,7 +2360,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox - 2, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name @@ -2397,7 +2398,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); $pdf->MultiCell($widthrecbox, '', $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name $pdf->SetXY($posx + 2, $posy + 3); @@ -2774,8 +2775,10 @@ class pdf_octopus extends ModelePDFFactures //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); - $pdf->Rect($this->marge_gauche, $tab_top + 92.5, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + //$pdf->Rect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, $this->corner_radius, '1001', 'F', explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + //$pdf->Rect($this->marge_gauche, $tab_top + 92.5, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top + 92.5, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -2784,7 +2787,7 @@ class pdf_octopus extends ModelePDFFactures // Output Rect // KEEPTHIS => Affiche les bords extérieurs - $this->printRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param $pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -3212,6 +3215,7 @@ class pdf_octopus extends ModelePDFFactures * @param int $hidebottom Hide bottom * @return void */ + /* public function printRectBtp(&$pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0) { if (empty($hidetop) || $hidetop == -1) { @@ -3222,8 +3226,35 @@ class pdf_octopus extends ModelePDFFactures $pdf->line($x + $l, $y + $h, $x, $y + $h); } $pdf->line($x, $y + $h, $x, $y); - } + }*/ + /** + * Print a rounded rectangle on the PDF + * + * @param TCPDF $pdf Object PDF + * @param float $x Abscissa of first point + * @param float $y Ordinate of first point + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param float $r Corner radius (can be an array for different radii per corner) + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int $hidebottom Hide bottom + * @param string $style Draw style (e.g. 'D' for draw, 'F' for fill, 'DF' for both) + * @return void + */ + public function printRoundedRectBtp($pdf, $x, $y, $w, $h, $r, $hidetop = 0, $hidebottom = 0, $style = 'D') + { + // Top line + if (empty($hidetop) || $hidetop == -1) { + $pdf->RoundedRect($x, $y, $w, $h, $r, '1111', $style); + } else { + // Draw rounded rectangle with hidden top side + $pdf->RoundedRect($x, $y, $w, $h, $r, '0111', $style); + } + if (!empty($hidebottom)) { + $pdf->RoundedRect($x, $y, $w, $h, $r, '1101', $style); + } + } /** * Get data about invoice @@ -3401,7 +3432,8 @@ class pdf_octopus extends ModelePDFFactures // Output Rect $pdf->SetDrawColor(128, 128, 128); - $this->printRect($pdf, $posx, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 6); // Rect prend une longueur en 3eme param et 4eme param + //$this->printRect($pdf, $posx, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 6); // Rect prend une longueur en 3eme param et 4eme param + $this->printRoundedRect($pdf, $posx, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 6, $this->corner_radius, 0, 0, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $posy += 4; } elseif (count($orders)) { @@ -3681,7 +3713,8 @@ class pdf_octopus extends ModelePDFFactures // Output Rect $pdf->SetDrawColor(128, 128, 128); - $this->printRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height * $index + $y); + //$this->printRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height * $index + $y); + $this->printRoundedRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height * $index + $y, $this->corner_radius, 0, 0, 'D'); $posy += $height * $index + $y; $pageposafter = $pdf->getPage(); @@ -3741,6 +3774,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1); $pdf->SetDrawColor(128, 128, 128); - $this->printRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 7); + //$this->printRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 7); + $this->printRoundedRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 7, $this->corner_radius, 0, 0, 'D'); } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 509af957ae0..5db21abcc50 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -12,6 +12,7 @@ * Copyright (C) 2022 Anthony Berton * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -146,7 +147,7 @@ class pdf_sponge extends ModelePDFFactures $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -531,7 +532,7 @@ class pdf_sponge extends ModelePDFFactures // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $this->tab_top = $nexY + 6; $height_incoterms += 4; @@ -627,10 +628,10 @@ class pdf_sponge extends ModelePDFFactures // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($this->tab_top_newpage + $this->heightforfooter); - $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($this->tab_top + $this->heightforfooter); - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } // Add footer @@ -649,13 +650,13 @@ class pdf_sponge extends ModelePDFFactures $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } $height_note = $posyafter - $this->tab_top_newpage; - $pdf->Rect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top_newpage - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $this->tab_top; - $pdf->Rect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $this->tab_top - 1, $tab_width, $height_note + 1, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($this->heightforfooter + $this->heightforfreetext + 20))) { @@ -2074,7 +2075,7 @@ class pdf_sponge extends ModelePDFFactures //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -2082,7 +2083,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -2367,7 +2368,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -2422,7 +2423,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox - 2, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name @@ -2462,7 +2463,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); $pdf->MultiCell($widthrecbox, '', $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 7c53070f59a..6bcde30e3ec 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -97,7 +98,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 0; // Display payment mode @@ -253,7 +254,7 @@ class pdf_soleil extends ModelePDFFicheinter // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -487,7 +488,7 @@ class pdf_soleil extends ModelePDFFicheinter */ // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 1, 0, 0); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height + 1, $this->corner_radius, 0, 0, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidebottom)) { $employee_name = ''; @@ -630,7 +631,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetXY($posx, $posy - 5); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); } // Show sender name @@ -683,7 +684,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); $pdf->SetTextColor(0, 0, 0); } diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index f0f27172fb3..9560d1d7e0f 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -7,7 +7,8 @@ * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf * Copyright (C) 2020 Marc Guenneugues - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -106,7 +107,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts @@ -261,7 +262,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1 - 4, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1 + 6); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1 - 4, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1 + 6, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -616,7 +617,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->MultiCell(190, 5, $outputlangs->transnoentities("Information"), '', 'L');*/ $pdf->SetXY($posx, $posy); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell(190, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 190, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender information @@ -658,7 +659,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->SetDrawColor(128, 128, 128); // Rect takes a length in 3rd parameter - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, '1234', 'D'); // line prend une position y en 3eme param if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); diff --git a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 9e64261ba51..41925a7935a 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -83,7 +84,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text @@ -709,7 +710,7 @@ class pdf_standard_movementstock extends ModelePDFMovement // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -781,7 +782,7 @@ class pdf_standard_movementstock extends ModelePDFMovement * * @param TCPDF $pdf Object PDF * @param float|int $tab_top Top position of table - * @param float|int $tab_height Height of table (rectangle) + * @param float|int $tab_height Height of table (angle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title @@ -813,7 +814,7 @@ class pdf_standard_movementstock extends ModelePDFMovement //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index e36d0ca0433..a08a7bb8de3 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * Copyright (C) 2024 Josep Lluís Amador + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -103,7 +104,7 @@ class pdf_vinci extends ModelePDFMo $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_multilang = 1; //Available in several languages $this->option_escompte = 0; // Displays if there has been a discount @@ -342,10 +343,10 @@ class pdf_vinci extends ModelePDFMo // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -364,13 +365,13 @@ class pdf_vinci extends ModelePDFMo $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -938,7 +939,7 @@ class pdf_vinci extends ModelePDFMo //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -946,7 +947,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter foreach ($this->cols as $colKey => $colDef) { if (!$this->getColumnStatus($colKey)) { @@ -1200,7 +1201,7 @@ class pdf_vinci extends ModelePDFMo $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 9f72337a0aa..db632a4b14b 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -1,8 +1,9 @@ * Copyright (C) 2023 Anthony Berton - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -92,7 +93,7 @@ class pdf_standard extends ModelePDFProduct $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text @@ -337,7 +338,7 @@ class pdf_standard extends ModelePDFProduct // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -636,7 +637,7 @@ class pdf_standard extends ModelePDFProduct //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -644,7 +645,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 7ded9a04132..aaa54b1aacf 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2018 Laurent Destailleur - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2018 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -109,7 +110,7 @@ class pdf_baleine extends ModelePDFProjects $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -273,7 +274,7 @@ class pdf_baleine extends ModelePDFProjects // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -509,7 +510,7 @@ class pdf_baleine extends ModelePDFProjects * * @param TCPDF $pdf Object PDF * @param float|int $tab_top Top position of table - * @param float|int $tab_height Height of table (rectangle) + * @param float|int $tab_height Height of table (angle) * @param int $nexY Y * @param Translate $outputlangs Langs object * @param int $hidetop Hide top bar of array @@ -527,7 +528,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, '1234', 'D'); // Line takes a position y in 3rd parameter $pdf->line($this->marge_gauche, $tab_top + $heightoftitleline, $this->page_largeur - $this->marge_droite, $tab_top + $heightoftitleline); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 4f0d81dd64b..d4eb38ff6fb 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -4,6 +4,7 @@ * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -129,7 +130,7 @@ class pdf_beluga extends ModelePDFProjects $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -306,7 +307,7 @@ class pdf_beluga extends ModelePDFProjects // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -757,7 +758,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, '1234', 'D'); // line prend une position y en 3eme param $pdf->line($this->marge_gauche, $tab_top + $heightoftitleline, $this->page_largeur - $this->marge_droite, $tab_top + $heightoftitleline); diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 420c33cc81b..1e6644c686e 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis + * * 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 * the Free Software Foundation; either version 3 of the License, or @@ -103,7 +104,7 @@ class pdf_timespent extends ModelePDFProjects $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION @@ -268,7 +269,7 @@ class pdf_timespent extends ModelePDFProjects // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 2, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -525,7 +526,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetDrawColor(128, 128, 128); // Draw rect of all tab (title + lines). Rect takes a length in 3rd parameter - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, '1234', 'D'); // Line takes a position y in 3rd parameter $pdf->line($this->marge_gauche, $tab_top + $heightoftitleline, $this->page_largeur - $this->marge_droite, $tab_top + $heightoftitleline); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 80fe1b07e7a..9f0e59f019f 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1,15 +1,16 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2015 Marcos García - * Copyright (C) 2017-2018 Ferran Marcet +/* Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2015 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2015 Marcos García + * Copyright (C) 2017-2018 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2019 Pierre Ardoin - * Copyright (C) 2024 MDW + * Copyright (C) 2019 Pierre Ardoin + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -108,7 +109,7 @@ class pdf_azur extends ModelePDFPropales $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -396,7 +397,7 @@ class pdf_azur extends ModelePDFPropales // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -452,7 +453,7 @@ class pdf_azur extends ModelePDFPropales // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -1385,7 +1386,7 @@ class pdf_azur extends ModelePDFPropales //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1393,7 +1394,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -1658,7 +1659,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -1713,7 +1714,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 23f342eb182..4fea94802b7 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -7,8 +7,9 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -106,7 +107,7 @@ class pdf_cyan extends ModelePDFPropales $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -369,7 +370,7 @@ class pdf_cyan extends ModelePDFPropales // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -483,10 +484,10 @@ class pdf_cyan extends ModelePDFPropales // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -505,13 +506,13 @@ class pdf_cyan extends ModelePDFPropales $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -1487,7 +1488,7 @@ class pdf_cyan extends ModelePDFPropales //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1495,7 +1496,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (getDolGlobalString('MAIN_PDF_TITLE_TEXT_COLOR')) { $arrayColorTextTitle = explode(',', getDolGlobalString('MAIN_PDF_TITLE_TEXT_COLOR')); @@ -1725,7 +1726,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); } @@ -1781,7 +1782,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); } // Show recipient name diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 1004d3d83c9..55dcc8cd0be 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -1,7 +1,8 @@ +/* Copyright (C) 2018 Quentin Vial-Gouteyron * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -82,7 +83,7 @@ class pdf_squille extends ModelePdfReception $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->watermark = ''; @@ -311,7 +312,7 @@ class pdf_squille extends ModelePdfReception // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -364,7 +365,7 @@ class pdf_squille extends ModelePdfReception // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -823,7 +824,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); @@ -1054,7 +1055,7 @@ class pdf_squille extends ModelePdfReception $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Sender"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(255, 255, 255); @@ -1106,7 +1107,7 @@ class pdf_squille extends ModelePdfReception $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 9224e7d503c..1afd23e99ec 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -1,9 +1,10 @@ - * Copyright (C) 2022 Ferran Marcet - * Copyright (C) 2022 Nicolas Silobre - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2022 Nicolas Silobre + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -79,7 +80,7 @@ class pdf_standard_stock extends ModelePDFStock $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text @@ -506,7 +507,7 @@ class pdf_standard_stock extends ModelePDFStock // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -610,7 +611,7 @@ class pdf_standard_stock extends ModelePDFStock //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -619,7 +620,7 @@ class pdf_standard_stock extends ModelePDFStock $pdf->SetFont('', 'B', $default_font_size - 3); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); $pdf->SetDrawColor(200, 200, 200); diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 9cdea4485c8..1b4440e35b9 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -3,9 +3,10 @@ * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -115,7 +116,7 @@ class pdf_eagle extends ModelePDFStockTransfer $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo // Get source company @@ -368,7 +369,7 @@ class pdf_eagle extends ModelePDFStockTransfer // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -424,7 +425,7 @@ class pdf_eagle extends ModelePDFStockTransfer // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_height -= $height_note; $tab_top = $nexY + 6; @@ -905,7 +906,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->SetFont('', '', $default_font_size - 2); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $pdf->SetDrawColor(128, 128, 128); $pdf->SetFont('', '', $default_font_size - 1); @@ -1185,7 +1186,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Sender").":", 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(255, 255, 255); @@ -1240,7 +1241,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); 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 2d96b52c554..06ef936d358 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -9,7 +9,8 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -103,7 +104,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -345,7 +346,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; $height_incoterms += 4; @@ -442,10 +443,10 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -464,12 +465,12 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -1148,7 +1149,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1156,7 +1157,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1391,7 +1392,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Sender").":", 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(255, 255, 255); @@ -1446,7 +1447,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 1b5692b656b..e1b59c7888a 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -3,7 +3,8 @@ * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -98,7 +99,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -315,7 +316,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -347,7 +348,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -867,7 +868,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -875,7 +876,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -1196,7 +1197,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1247,7 +1248,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index df27a7a1831..95e2d4300f2 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -5,9 +5,10 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2023 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2023 William Mead + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -102,7 +103,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -336,7 +337,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -421,10 +422,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -443,13 +444,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -1156,7 +1157,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1164,7 +1165,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1380,7 +1381,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1431,7 +1432,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index af0b16d5ea6..1082d2382bf 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -5,8 +5,9 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -101,7 +102,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -355,7 +356,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -372,7 +373,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -1024,7 +1025,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1032,7 +1033,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -1291,7 +1292,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1341,7 +1342,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index 426c4336fc4..14c3954741d 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2022 Ferran Marcet * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -108,7 +109,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_multilang = 1; // Available in several languages @@ -729,7 +730,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $pdf->MultiCell(80, 5, $outputlangs->transnoentities("PayedBy"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -768,7 +769,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("PayedTo"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 665441838f6..3d215cc3a6f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -5,8 +5,9 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -99,7 +100,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -366,7 +367,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 2, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -1143,7 +1144,7 @@ class pdf_aurore extends ModelePDFSupplierProposal //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1151,7 +1152,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter if (empty($hidetop)) { $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line takes a position y in 2nd parameter and 4th parameter @@ -1339,7 +1340,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1397,7 +1398,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 82e731a5b40..72044b24b05 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -5,8 +5,9 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Nick Fragoulis * * 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 @@ -101,7 +102,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10); $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10); $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10); - + $this->corner_radius = getDolGlobalInt('MAIN_PDF_FRAME_CORNER_RADIUS', 0); $this->option_logo = 1; // Display logo $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_modereg = 1; // Display payment mode @@ -335,7 +336,7 @@ class pdf_zenith extends ModelePDFSupplierProposal // Rect takes a length in 3rd parameter $pdf->SetDrawColor(192, 192, 192); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 3, $this->corner_radius, '1234', 'D'); $tab_top = $nexY + 6; } @@ -420,10 +421,10 @@ class pdf_zenith extends ModelePDFSupplierProposal // Draw note frame if ($i > $pageposbeforenote) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } // Add footer @@ -442,13 +443,13 @@ class pdf_zenith extends ModelePDFSupplierProposal $this->_pagehead($pdf, $object, 0, $outputlangs); } $height_note = $posyafter - $tab_top_newpage; - $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); } else { // No pagebreak $pdf->commitTransaction(); $posyafter = $pdf->GetY(); $height_note = $posyafter - $tab_top; - $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); + $pdf->RoundedRect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 2, $this->corner_radius, '1234', 'D'); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) { @@ -1145,7 +1146,7 @@ class pdf_zenith extends ModelePDFSupplierProposal //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) { - $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); + $pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR'))); } } @@ -1153,7 +1154,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 1); // Output Rect - $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect takes a length in 3rd parameter and 4th parameter $this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop); @@ -1360,7 +1361,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->RoundedRect($posx, $posy, 82, $hautcadre, $this->corner_radius, '1234', 'F'); $pdf->SetTextColor(0, 0, 60); // Show sender name @@ -1415,7 +1416,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx + 2, $posy - 5); $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/includes/restler/framework/Luracast/Restler/RestException.php b/htdocs/includes/restler/framework/Luracast/Restler/RestException.php index 4291381661c..9b152c8ad9d 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/RestException.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/RestException.php @@ -72,7 +72,7 @@ class RestException extends Exception private $stage; /** - * @param string $httpStatusCode http status code + * @param int $httpStatusCode http status code * @param string|null $errorMessage error message * @param array $details any extra detail about the exception * @param Exception $previous previous exception if any @@ -136,4 +136,3 @@ class RestException extends Exception . $this->getStage() . ' stage'; } } - diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 33b86a4d8df..ba603342da7 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -132,4 +132,7 @@ ALTER TABLE llx_societe ADD COLUMN ip varchar(250); ALTER TABLE llx_recruitment_recruitmentcandidature ADD COLUMN ip varchar(250); ALTER TABLE llx_socpeople ADD COLUMN ip varchar(250); +ALTER TABLE llx_recruitment_recruitmentcandidature MODIFY fk_user_creat integer NULL; + ALTER TABLE llx_ecm_files ADD COLUMN agenda_id integer; + diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql index 8016e813d5d..af174cc2568 100644 --- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql +++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature-recruitment.sql @@ -25,7 +25,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( note_private text, date_creation datetime NOT NULL, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - fk_user_creat integer NOT NULL, + fk_user_creat integer, fk_user_modif integer, fk_user integer, -- Id of user created from the job application import_key varchar(14), diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f8e361e0f56..d8b86c9cc10 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2557,6 +2557,8 @@ ParamValue=Value of parameter ConfirmDeleteParamOfSocialNetwork=Are you sure you want to delete this parameter ? HelpMariaDBToGetPossibleValues=You can get a list of possible values by running the following SQL command: %s HelpMariaDBToGetValue=This value was retrieved with command: %s +PDFBoxFrameRoundedCorners=Frames with rounded corners +MAIN_PDF_FRAME_CORNER_RADIUS=Default value for corner radius is 0 so no rounder corners. Choose values between 1-3 to increase corner radius and add rounded corners to frames Captcha=Captcha CaptchaDesc=If you want to protect your login page with a Captcha, you can choose which one to use here DolibarrStandardCaptcha=A native captcha generated by Dolibarr diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang index 047455d5e2b..3d249271e2b 100644 --- a/htdocs/langs/en_US/recruitment.lang +++ b/htdocs/langs/en_US/recruitment.lang @@ -64,4 +64,7 @@ NoPositionOpen=No positions open at the moment ConfirmClose=Confirm cancellation ConfirmCloseAsk=Are you sure you want to cancel this recruitment candidature Recruitment=Recruitment +ApplyJobCandidature=Apply for this job +ErrorRecruitmmentCandidatureAlreadyExists= Recruitment candidature already exists with email %s +RecruitmentCandidatureSaved=Recruitement candidature successfully saved NoOpenJobOffer=No open job offers at the moment diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 16e465d4060..153cff16589 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1084,6 +1084,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname && $user->hasRi dol_mkdir($destdir.'/lib'); dol_mkdir($destdir.'/scripts'); dol_mkdir($destdir.'/sql'); + dol_mkdir($destdir.'/ajax'); // Scan dir class to find if an object with the same name already exists. if (!$error) { @@ -1370,6 +1371,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname && $user->hasRi //'scripts/mymodule.php' => 'scripts/'.strtolower($objectname).'.php', 'class/myobject.class.php' => 'class/'.strtolower($objectname).'.class.php', //'class/api_mymodule.class.php' => 'class/api_'.strtolower($module).'.class.php', + 'ajax/myobject.php' => 'ajax/'.strtolower($objectname).'.php', ); if (GETPOST('includerefgeneration', 'aZ09')) { diff --git a/htdocs/modulebuilder/template/ajax/myobject.php b/htdocs/modulebuilder/template/ajax/myobject.php index 3e22eb25f22..d36a721888e 100644 --- a/htdocs/modulebuilder/template/ajax/myobject.php +++ b/htdocs/modulebuilder/template/ajax/myobject.php @@ -43,13 +43,30 @@ if (!defined('NOREQUIREHTML')) { } // Load Dolibarr environment -require '../../main.inc.php'; +$res = 0; +if (!$res && file_exists("../../main.inc.php")) { + $res = @include "../../main.inc.php"; +} +if (!$res && file_exists("../../../main.inc.php")) { + $res = @include "../../../main.inc.php"; +} +if (!$res) { + die("Include of main fails"); +} +dol_include_once('/mymodule/class/myobject.class.php'); $mode = GETPOST('mode', 'aZ09'); +$objectId = GETPOST('objectId', 'aZ09'); +$field = GETPOST('field', 'aZ09'); +$value = GETPOST('value', 'aZ09'); + +// @phan-suppress-next-line PhanUndeclaredClass +$object = new MyObject($db); // Security check -restrictedArea($user, 'mymodule', 0, 'myobject'); - +if (!$user->hasRight('mymodule', 'myobject', 'write')) { + accessforbidden(); +} /* * View @@ -57,12 +74,21 @@ restrictedArea($user, 'mymodule', 0, 'myobject'); dol_syslog("Call ajax mymodule/ajax/myobject.php"); -top_httphead('application/json'); +top_httphead(); -$arrayresult = array(); +// Update the object field with the new value +if ($objectId && $field && isset($value)) { + $object->fetch($objectId); + if ($object->id > 0) { + $object->$field = $value; + } + $result = $object->update($user); -// .... + if ($result < 0) { + print json_encode(['status' => 'error', 'message' => 'Error updating '. $field]); + } else { + print json_encode(['status' => 'success', 'message' => $field . ' updated successfully']); + } +} $db->close(); - -print json_encode($arrayresult); diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index af86d85034b..bf69fda17cc 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -174,6 +174,7 @@ if (getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE')) { $results = $object->fetchAll($sortorder, $sortfield, 0, 0, '(status:=:1)'); $now = dol_now(); +$params = array(); if (is_array($results)) { if (empty($results)) { @@ -187,6 +188,7 @@ if (is_array($results)) { foreach ($results as $job) { $object = $job; + $arrayofpostulatebutton = array(); print ''."\n"; @@ -274,6 +276,17 @@ if (is_array($results)) { print $text; print ''; + $arrayofpostulatebutton[] = array( + 'url' => '/public/recruitment/view.php?ref='.$object->ref, + 'label' => $langs->trans('ApplyJobCandidature'), + 'lang' => 'recruitment', + 'perm' => true, + 'enabled' => true, + ); + + print '
'; + print dolGetButtonAction('', $langs->trans("ApplyJobCandidature"), 'default', $arrayofpostulatebutton, 'applicate_'.$object->ref, true, $params); + print '
'; print ''."\n"; print "\n"; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index c3c205c2685..3a8e48f935e 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -38,10 +38,12 @@ if (!defined('NOBROWSERNOTIF')) { // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php'; +require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "other", "recruitment")); @@ -50,7 +52,12 @@ $langs->loadLangs(array("companies", "other", "recruitment")); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $email = GETPOST('email', 'alpha'); -$backtopage = ''; +$firstname = GETPOST('firstname', 'alpha'); +$lastname = GETPOST('lastname', 'alpha'); +$birthday = GETPOST('birthday', 'alpha'); +$phone = GETPOST('phone', 'alpha'); +$message = GETPOST('message', 'alpha'); +$requestedremuneration = GETPOST('requestedremuneration', 'alpha'); $ref = GETPOST('ref', 'alpha'); @@ -63,25 +70,26 @@ if (isset($_SESSION['email_customer'])) { $object = new RecruitmentJobPosition($db); -if (!$action) { - if (!$ref) { - print $langs->trans('ErrorBadParameters')." - ref missing"; - exit; - } else { - $object->fetch('', $ref); - } +if (!$ref) { + print $langs->trans('ErrorBadParameters')." - ref missing"; + exit; } + // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. +$backtopage = $urlwithroot.'/public/recruitment/index.php'; // Security check -if (empty($conf->recruitment->enabled)) { +if (!isModEnabled("recruitment")) { httponly_accessforbidden('Module Recruitment not enabled'); } +$object->fetch('', $ref); +$user->loadDefaultValues(); +$errmsg = ""; /* * Actions @@ -92,56 +100,95 @@ if ($cancel) { header("Location: ".$backtopage); exit; } - $action = 'view'; } -if ($action == "view" || $action == "presend" || $action == "dosubmit") { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) +if ($action == "dosubmit") { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) $error = 0; - $display_ticket = false; + $db->begin(); if (!strlen($ref)) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref"))); - $action = ''; + $action = 'view'; } if (!strlen($email)) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Email"))); - $action = ''; + $action = 'view'; } else { if (!isValidEmail($email)) { $error++; array_push($object->errors, $langs->trans("ErrorEmailInvalid")); - $action = ''; + $action = 'view'; + } + } + if (!strlen($lastname)) { + $error++; + array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname"))); + $action = 'view'; + } + + if (!$error) { + $sql = "SELECT rrc.rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rrc"; + $sql .= " WHERE rrc.email = '". $db->escape($email)."'"; + $sql .= " AND rrc.entity = ". getEntity($object->element, 0); + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + if ($num > 0) { + $error++; + setEventMessages($langs->trans("ErrorRecruitmmentCandidatureAlreadyExists", $email), null, 'errors'); + } + } else { + dol_print_error($db); + $error++; + } + } + + if (!$error) { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) + $candidature = new RecruitmentCandidature($db); + + $candidature->firstname = GETPOST('firstname', 'alpha'); + $candidature->lastname = GETPOST('lastname', 'alpha'); + $candidature->email = GETPOST('email', 'alpha'); + $candidature->phone = GETPOST('phone', 'alpha'); + $candidature->date_birth = GETPOST('birthday', 'alpha'); + $candidature->requestedremuneration = GETPOST('requestedremuneration', 'alpha'); + $candidature->description = GETPOST('message', 'alpha'); + $candidature->fk_recruitmentjobposition = $object->id; + + $candidature->ip = getUserRemoteIP(); + + // Test MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS + $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200); + + if (checkNbPostsForASpeceificIp($candidature, $nb_post_max) <= 0) { + $error++; + $errmsg .= implode('
', $candidature->errors); + } + if (!$error) { + $result = $candidature->create($user); + if ($result <= 0) { + $error++; + $errmsg .= implode('
', $candidature->errors); + } + } + if (!$error) { + $candidature->validate($user); + if ($result <= 0) { + $error++; + $errmsg .= implode('
', $candidature->errors); + } } } if (!$error) { - $ret = $object->fetch('', $ref); - } - - /* - if (!$error && $action == "dosubmit") // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) - { - // Test MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS - - // TODO Create job application - - - - if (!$error) - { - $action = 'view'; - } - } - */ - - if ($error || $errors) { - setEventMessages($object->error, $object->errors, 'errors'); - if ($action == "dosubmit") { // Test on permission not required here - $action = 'presend'; - } else { - $action = ''; - } + $db->commit(); + setEventMessages($langs->trans("RecruitmentCandidatureSaved"), null); + header("Location: " . $backtopage); + exit; + } else { + $db->rollback(); + $action = "view"; } } @@ -158,6 +205,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; * View */ +$form = new Form($db); $now = dol_now(); $head = ''; @@ -180,7 +228,7 @@ $arrayofcss = array(); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1); - +dol_htmloutput_errors($errmsg); print ''."\n"; print '
'."\n"; @@ -254,16 +302,16 @@ if (getDolGlobalString('RECRUITMENT_NEWFORM_TEXT')) { $text = '
'."\n"; } if (empty($text)) { - $text .= ''."\n"; - $text .= ''."\n"; + $text .= ''."\n"; } print $text; // Output payment summary form -print ''."\n"; + print ''."\n"; + + print ''."\n"; + + print ''."\n"; + + print ''."\n"; + + print ''."\n"; + + print ''."\n"; + + print ''."\n"; + + print ''."\n"; } else { dol_print_error_email('ERRORSUBMITAPPLICATION'); } diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index e217f3489ae..b30819536c3 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -105,7 +105,7 @@ class RecruitmentCandidature extends CommonObject 'fk_recruitmentjobposition' => array('type' => 'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php:0:(t.status:=:1)', 'label' => 'Job', 'enabled' => 1, 'position' => 15, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'picto' => 'recruitmentjobposition', 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist' => 'minwidth100 nowraponall'), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0,), 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0,), - 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax100'), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => -1, 'visible' => -2, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax100'), 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2, 'csslist' => 'tdoverflowmax100'), 'lastname' => array('type' => 'varchar(128)', 'label' => 'Lastname', 'enabled' => 1, 'position' => 20, 'notnull' => 0, 'visible' => 1, 'csslist' => 'tdoverflowmax150'), 'firstname' => array('type' => 'varchar(128)', 'label' => 'Firstname', 'enabled' => 1, 'position' => 21, 'notnull' => 0, 'visible' => 1, 'csslist' => 'tdoverflowmax150'), diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index cc905a7d5e7..ac13bea9645 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -32,6 +32,7 @@ CKEDITOR.editorConfig = function( config ) //config.autoParagraph = false; //config.removeFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd'; // See also rules on this.dataProcessor.writer.setRules //config.forcePasteAsPlainText = true; + config.entities_latin = false; config.toolbar_Full = [ diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 30eec5bdbef..9cecd162492 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -247,7 +247,7 @@ class Ticket extends CommonObject public $ip; /** - * @var Ticket Save the ticket before an update operation (for triggers) + * @var static Save the ticket before an update operation (for triggers) */ public $oldcopy; @@ -1909,7 +1909,7 @@ class Ticket extends CommonObject //if (dol_mkdir($destdir) >= 0) { //require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; //dol_move($filespath, $destfile); // Disabled, a file for a ticket should be stored into ticket directory. It generates big trouble. - if (in_array($actioncomm->code, array('TICKET_MSG', 'TICKET_MSG_SENTBYMAIL'))) { + if (in_array($actioncomm->code, array('TICKET_MSG', 'TICKET_MSG_SENTBYMAIL'))) { $ecmfile = new EcmFiles($this->db); $destdir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $destdir); $destdir = preg_replace('/[\\/]$/', '', $destdir); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4ada2b118de..95d74648bdb 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -67,7 +67,6 @@ parameters: - '#Constructor of class (?:Dol(?:Editor|iDB(?:Mysqli|Pgsql|Sqlite3))|(?:ModeleBox|box_accountancy_last_manual_entri)es|box_(?:ac(?:countancy_suspense_account|ti(?:ons(?:_future)?|vity))|b(?:irthdays(?:_members)?|o(?:(?:okmark|m)s))|c(?:(?:lient|o(?:m(?:(?:mand|pt)e)|nt(?:r?act)))s|ustomers_outstanding_bill_reached)|dolibarr_state_board|f(?:actures(?:_(?:fourn(?:_imp)?|imp))?|icheinter|ournisseurs|unnel_of_prospection)|g(?:oodcustomers|raph_(?:invoices_(?:per(?:month|year)|supplier_permonth)|n(?:b_ticket(?:_last_x_days|s_type)|ew_vs_close_ticket)|orders_(?:(?:supplier_)?permonth)|pro(?:duct_distribution|pales_permonth)|ticket_by_severity))|last(?:_(?:(?:modified_)?knowledgerecord|(?:modified_)?ticket)|login)|m(?:embers_(?:by_t(?:ags|ype)|last_(?:modified|subscriptions)|subscriptions_by_year)|os)|pro(?:duits(?:_alerte_stock)?|ject(?:_opportunities)?|pales|spect)|s(?:(?:cheduled_job|ervices_contract)s|ervices_expired|(?:hipment|upplier_order)s|upplier_orders_awaiting_reception)|task|validated_projects)).* has an unused parameter #' - '#Dead catch - Exception is never thrown in the try block#' - '#.*phan-var#' - - '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#' - '#(?:(?:s(?:(?:et_error_handl|pl_autoload_regist)er)|array_filter)) expects \(callable#' - '# (vatrate|DolEditor constructor) expects bool, int#' - '# SMTPs::(getFrom|getErrorsTo|getReplyTo)\(\) expects bool, string given.#' @@ -114,6 +113,8 @@ parameters: - '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#' - '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#' - '#colorHexToHsl expects float\|false, true#' + - '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#' + internalErrorsCountLimit: 50 cache: nodesByFileCountMax: 512

'.$text.'

'.$langs->trans("JobOfferToBeFilled", $mysoc->name); + $text .= '

'.$langs->trans("JobOfferToBeFilled", $mysoc->name); $text .= '   -   '.$mysoc->name.''; $text .= '   -   '.dol_print_date($object->date_creation).''; $text .= '

'.$object->label.'


'.$object->label.'


'; +print '
'; print '
'; print '
'.$langs->trans("ThisIsInformationOnJobPosition").' :
'."\n"; @@ -333,6 +381,38 @@ print "\n"; if ($action != 'dosubmit') { if ($found && !$error) { // We are in a management option and no error + print '
'.$langs->trans("Lastname").''; + print ''; + print '
'.$langs->trans("Firstname").''; + print ''; + print '
'.$langs->trans("Email").''; + print img_picto("", "email").''; + print '
'.$langs->trans("Phone").''; + print img_picto("", "phone").''; + print '
'.$langs->trans("DateOfBirth").''; + print $form->selectDate($birthday, 'birthday', 0, 0, 1, "", 1, 0); + print '
'.$langs->trans("RequestedRemuneration").''; + print ''; + print '
'.$langs->trans("Message").''; + print ''; + print '
'; + print $form->buttonsSaveCancel('Submit', 'Cancel'); + print '