Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-02-05 13:03:54 +01:00
commit 0315b53f1f
3 changed files with 24 additions and 9 deletions

View File

@ -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

View File

@ -30,7 +30,8 @@
* <dol_use_font_a> Use font A of printer
* <dol_use_font_b> Use font B of printer
* <dol_use_font_c> Use font C of printer
* <dol_bold> </dol_bold> Text Bold
* <dol_bold> Text Bold
* <dol_bold_disabled> Disable Text Bold
* <dol_double_height> </dol_double_height> Text double height
* <dol_double_width> </dol_double_width> Text double width
* <dol_underline> </dol_underline> 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']);

View File

@ -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