diff --git a/htdocs/admin/askpricesupplier.php b/htdocs/admin/askpricesupplier.php
index ed73898278e..485fbb2ef23 100644
--- a/htdocs/admin/askpricesupplier.php
+++ b/htdocs/admin/askpricesupplier.php
@@ -529,7 +529,17 @@ print '';
print '';
print '
';
print $langs->trans("FreeLegalTextOnAskPriceSupplier").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='ASKPRICESUPPLIER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index dee635c1778..214ac6b68c0 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -109,7 +109,17 @@ $var=! $var;
print '';
print $langs->trans("FreeLegalTextOnChequeReceipts").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 5204d5f989c..3721c54dd79 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -555,14 +555,15 @@ print '';
print '';
print '';
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").') ';
+$variablename='COMMANDE_FREE_TEXT';
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
{
- print '';
+ print '';
}
else
{
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor('COMMANDE_FREE_TEXT', $conf->global->COMMANDE_FREE_TEXT,'',80,'dolibarr_details');
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
print $doleditor->Create();
}
print ' | ';
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index c77d71a9af9..6c2c690d73c 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -184,7 +184,7 @@ else if ($action == 'setmod')
else if ($action == 'set_other')
{
- $freetext= GETPOST('CONTRACT_FREE_TEXT','alpha');
+ $freetext= GETPOST('CONTRACT_FREE_TEXT'); // No alpha here, we want exact string
$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
$draft= GETPOST('CONTRACT_DRAFT_WATERMARK','alpha');
@@ -505,7 +505,17 @@ $var=true;
$var=! $var;
print ' |
';
print $langs->trans("FreeLegalTextOnContracts").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='CONTRACT_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' |
'."\n";
//Use draft Watermark
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index e3842921d7f..09382e734ac 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -73,7 +73,7 @@ if ($action == 'updateMask')
else if ($action == 'set_SHIPPING_FREE_TEXT')
{
- $freetext=GETPOST('SHIPPING_FREE_TEXT','alpha');
+ $freetext=GETPOST('SHIPPING_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if ($res > 0)
@@ -532,7 +532,17 @@ print '';
print '';
print '';
print $langs->trans("FreeLegalTextOnShippings").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='SHIPPING_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index 15c810f46c5..c31db84225c 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -189,7 +189,7 @@ else if ($action == 'setmod')
else if ($action == 'set_EXPENSEREPORT_FREE_TEXT')
{
- $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT','alpha');
+ $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index e993d2c276c..4fd4c049593 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -756,7 +756,17 @@ print '';
print '';
print '';
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='FACTURE_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 1e0e78db868..e70960ccbc0 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -185,7 +185,7 @@ else if ($action == 'setmod')
else if ($action == 'set_FICHINTER_FREE_TEXT')
{
- $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha');
+ $freetext= GETPOST('FICHINTER_FREE_TEXT'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -527,7 +527,17 @@ print '';
print '';
print '';
print $langs->trans("FreeLegalTextOnInterventions").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='FICHINTER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 2accd8236d4..41fbe5fc8f4 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -68,7 +68,7 @@ if ($action == 'updateMask')
if ($action == 'set_DELIVERY_FREE_TEXT')
{
- $free=GETPOST('DELIVERY_FREE_TEXT','alpha');
+ $free=GETPOST('DELIVERY_FREE_TEXT'); // No alpha here, we want exact string
$res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -504,6 +504,16 @@ print '';
print '';
print $langs->trans("FreeLegalTextOnDeliveryReceipts").' ('.$langs->trans("AddCRIfTooLong").') ';
print '';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index b407f5bc6f8..48c16de3531 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -578,7 +578,17 @@ print '';
print '';
print '';
print $langs->trans("FreeLegalTextOnProposal").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='PROPALE_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 9c70ecc5e4c..222b813cdbb 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -463,7 +463,17 @@ print "\n";
print '';
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='SUPPLIER_INVOICE_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index 4b39b2381f7..11613a82745 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -487,7 +487,17 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
print '';
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").') ';
-print '';
+$variablename='SUPPLIER_ORDER_FREE_TEXT';
+if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
+{
+ print '';
+}
+else
+{
+ include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+ $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
+ print $doleditor->Create();
+}
print ' | ';
print '';
print " |
\n";
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 2fe76a920b8..0ab44fb927b 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -914,7 +914,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
}
else
{
- $freetextheight=pdfGetHeightForHtmlContent($pdf,dol_htmlentitiesbr($line, 1)); // New method (works for HTML content)
+ $freetextheight=pdfGetHeightForHtmlContent($pdf,dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); // New method (works for HTML content)
//print '
'.$freetextheight;exit;
}
}
@@ -931,7 +931,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
}
else
{
- $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk']-$marginwithfooter, $line);
+ $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $freetextheight, $dims['lm'], $dims['hk']-$marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0));
}
$posy-=$freetextheight;
}