mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
clean code (#35510)
This commit is contained in:
@@ -7284,12 +7284,6 @@ parameters:
|
||||
count: 1
|
||||
path: ../../../htdocs/core/lib/order.lib.php
|
||||
|
||||
-
|
||||
message: '#^Right side of && is always true\.$#'
|
||||
identifier: booleanAnd.rightAlwaysTrue
|
||||
count: 11
|
||||
path: ../../../htdocs/core/lib/pdf.lib.php
|
||||
|
||||
-
|
||||
message: '#^Ternary operator condition is always false\.$#'
|
||||
identifier: ternary.alwaysFalse
|
||||
|
||||
@@ -1127,7 +1127,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
|
||||
// Line 3 of company infos
|
||||
// Juridical status
|
||||
if (!empty($fromcompany->forme_juridique_code) && $fromcompany->forme_juridique_code) {
|
||||
if (!empty($fromcompany->forme_juridique_code)) {
|
||||
$line3 .= ($line3 ? " - " : "").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel((string) $fromcompany->forme_juridique_code));
|
||||
}
|
||||
// Capital
|
||||
@@ -1140,7 +1140,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
}
|
||||
}
|
||||
// Prof Id 1
|
||||
if (!empty($fromcompany->idprof1) && $fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
|
||||
if (!empty($fromcompany->idprof1) && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1148,7 +1148,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line3 .= ($line3 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
|
||||
}
|
||||
// Prof Id 2
|
||||
if (!empty($fromcompany->idprof2) && $fromcompany->idprof2) {
|
||||
if (!empty($fromcompany->idprof2)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1158,7 +1158,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
|
||||
// Line 4 of company infos
|
||||
// Prof Id 3
|
||||
if (!empty($fromcompany->idprof3) && $fromcompany->idprof3) {
|
||||
if (!empty($fromcompany->idprof3)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1166,7 +1166,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
|
||||
}
|
||||
// Prof Id 4
|
||||
if (!empty($fromcompany->idprof4) && $fromcompany->idprof4) {
|
||||
if (!empty($fromcompany->idprof4)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1174,7 +1174,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
|
||||
}
|
||||
// Prof Id 5
|
||||
if (!empty($fromcompany->idprof5) && $fromcompany->idprof5) {
|
||||
if (!empty($fromcompany->idprof5)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId5", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1182,7 +1182,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof5);
|
||||
}
|
||||
// Prof Id 6
|
||||
if (!empty($fromcompany->idprof6) && $fromcompany->idprof6) {
|
||||
if (!empty($fromcompany->idprof6)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId6", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1190,7 +1190,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof6);
|
||||
}
|
||||
// Prof Id 7
|
||||
if (!empty($fromcompany->idprof7) && $fromcompany->idprof7) {
|
||||
if (!empty($fromcompany->idprof7)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId7", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1198,7 +1198,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof7);
|
||||
}
|
||||
// Prof Id 8
|
||||
if (!empty($fromcompany->idprof8) && $fromcompany->idprof8) {
|
||||
if (!empty($fromcompany->idprof8)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId8", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1206,7 +1206,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof8);
|
||||
}
|
||||
// Prof Id 9
|
||||
if (!empty($fromcompany->idprof9) && $fromcompany->idprof9) {
|
||||
if (!empty($fromcompany->idprof9)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId9", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
@@ -1214,7 +1214,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
|
||||
$line4 .= ($line4 ? " - " : "").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof9);
|
||||
}
|
||||
// Prof Id 10
|
||||
if (!empty($fromcompany->idprof10) && $fromcompany->idprof10) {
|
||||
if (!empty($fromcompany->idprof10)) {
|
||||
$field = $outputlangs->transcountrynoentities("ProfId10", $fromcompany->country_code);
|
||||
if (preg_match('/\((.*)\)/i', $field, $reg)) {
|
||||
$field = $reg[1];
|
||||
|
||||
Reference in New Issue
Block a user