From e6dc384ee93a839b6e6249b3e272216c911883f1 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 3 Feb 2020 19:33:23 +0100 Subject: [PATCH 1/3] Add bold tags --- htdocs/core/class/dolreceiptprinter.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 4425e43cda2..90a8ca9556e 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -30,7 +30,8 @@ * Use font A of printer * Use font B of printer * Use font C of printer - * Text Bold + * Text Bold + * Disable Text Bold * Text double height * Text double width * Underline text @@ -162,7 +163,7 @@ class dolReceiptPrinter extends Printer 'dol_use_font_b', 'dol_use_font_c', 'dol_bold', - '/dol_bold', + 'dol_bold_disabled', 'dol_double_height', '/dol_double_height', 'dol_double_width', @@ -711,6 +712,12 @@ class dolReceiptPrinter extends Printer break; case 'DOL_USE_FONT_C': $this->printer->setFont(Printer::FONT_C); + break; + case 'DOL_BOLD': + $this->printer->setEmphasis(true); + break; + case 'DOL_BOLD_DISABLED': + $this->printer->setEmphasis(false); break; default: $this->printer->text($vals[$tplline]['tag']); From 5a248f31a60322c2ca771054bea66533ed8cd563 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Mon, 3 Feb 2020 19:34:39 +0100 Subject: [PATCH 2/3] Add langs --- htdocs/langs/en_US/receiptprinter.lang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 5714ba78151..f79974558d6 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -45,3 +45,5 @@ DOL_ACTIVATE_BUZZER=Activate buzzer DOL_PRINT_QRCODE=Print QR Code DOL_PRINT_LOGO=Print logo of my company DOL_PRINT_LOGO_OLD=Print logo of my company (old printers) +DOL_BOLD=Bold +DOL_BOLD_DISABLED=Disable bold From 24c305dc7fc48ed8d3ed4cb1b0d4a945f216de73 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Tue, 4 Feb 2020 09:00:31 +0100 Subject: [PATCH 3/3] Fix unset gender property in contact class --- htdocs/contact/class/contact.class.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index f56d03ceeb3..0cea298973a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -992,19 +992,25 @@ class Contact extends CommonObject } + /** - * Set property ->gender from property ->civility_id + * Set the property "gender" of this class, based on the property "civility_id" + * or use property "civility_code" as fallback, when "civility_id" is not available. * * @return void */ public function setGenderFromCivility() { - unset($this->gender); - if (in_array($this->civility_id, array('MR'))) { - $this->gender = 'man'; - } elseif (in_array($this->civility_id, array('MME', 'MLE'))) { - $this->gender = 'woman'; - } + unset($this->gender); + + if (in_array($this->civility_id, array('MR')) || in_array($this->civility_code, array('MR'))) + { + $this->gender = 'man'; + } + elseif(in_array($this->civility_id, array('MME','MLE')) || in_array($this->civility_code, array('MME','MLE'))) + { + $this->gender = 'woman'; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps