Fix rtl languages

This commit is contained in:
Laurent Destailleur 2021-05-09 20:25:57 +02:00
parent 3ad8827c8a
commit 1fb5b0f681
4 changed files with 38 additions and 26 deletions

View File

@ -1255,6 +1255,9 @@ class pdf_einstein extends ModelePDFCommandes
// phpcs:enable
global $conf, $langs, $hookmanager;
$ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
@ -1300,7 +1303,7 @@ class pdf_einstein extends ModelePDFCommandes
}
} else {
$text = $this->emetteur->name;
$pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
$pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
}
}
@ -1408,7 +1411,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy - 5);
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
$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);
@ -1417,7 +1420,7 @@ class pdf_einstein extends ModelePDFCommandes
// Show sender name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
$posy = $pdf->getY();
// Show sender information
@ -1462,20 +1465,20 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx + 2, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
}
$pdf->SetTextColor(0, 0, 0);

View File

@ -1422,6 +1422,9 @@ class pdf_eratosthene extends ModelePDFCommandes
// phpcs:enable
global $conf, $langs, $hookmanager;
$ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
@ -1594,7 +1597,7 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
$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);
@ -1603,13 +1606,13 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show sender name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
$posy = $pdf->getY();
// Show sender information
$pdf->SetXY($posx + 2, $posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, 'L');
$pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, $ltrdirection);
// If CUSTOMER contact defined, we use it
$usecontact = false;
@ -1647,20 +1650,20 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx + 2, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
}
$pdf->SetTextColor(0, 0, 0);

View File

@ -1419,6 +1419,9 @@ class pdf_azur extends ModelePDFPropales
{
global $conf, $langs;
$ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "propal", "companies", "bills"));
@ -1462,7 +1465,7 @@ class pdf_azur extends ModelePDFPropales
}
} else {
$text = $this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
}
}
@ -1575,7 +1578,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy - 5);
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
$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);
@ -1584,13 +1587,13 @@ class pdf_azur extends ModelePDFPropales
// Show sender name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
$posy = $pdf->getY();
// Show sender information
$pdf->SetXY($posx + 2, $posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
$pdf->MultiCell(80, 4, $carac_emetteur, 0, $ltrdirection);
// If CUSTOMER contact defined, we use it
@ -1628,20 +1631,20 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx + 2, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection);
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
}
$pdf->SetTextColor(0, 0, 0);

View File

@ -1519,6 +1519,9 @@ class pdf_cyan extends ModelePDFPropales
{
global $conf, $langs;
$ltrdirection = 'L';
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "propal", "companies", "bills"));
@ -1564,7 +1567,7 @@ class pdf_cyan extends ModelePDFPropales
}
} else {
$text = $this->emetteur->name;
$pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
$pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
}
}
@ -1690,7 +1693,7 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
$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);
@ -1699,13 +1702,13 @@ class pdf_cyan extends ModelePDFPropales
// Show sender name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
$posy = $pdf->getY();
// Show sender information
$pdf->SetXY($posx + 2, $posy);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, 'L');
$pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0, $ltrdirection);
// If CUSTOMER contact defined, we use it
@ -1744,20 +1747,20 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($posx + 2, $posy - 5);
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
// Show recipient name
$pdf->SetXY($posx + 2, $posy + 3);
$pdf->SetFont('', 'B', $default_font_size);
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
$posy = $pdf->getY();
// Show recipient information
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetXY($posx + 2, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
}
$pdf->SetTextColor(0, 0, 0);