diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 8b3c359a562..79950e4f14f 100644
--- a/htdocs/core/modules/product/modules_product.class.php
+++ b/htdocs/core/modules/product/modules_product.class.php
@@ -204,11 +204,9 @@ abstract class ModeleProductCode
if ($type == -1) {
$s .= $langs->trans("Name").': '.$this->getNom($langs).'
';
$s .= $langs->trans("Version").': '.$this->getVersion().'
';
- }
- if ($type == 0) {
+ } elseif ($type == 0) {
$s .= $langs->trans("ProductCodeDesc").'
';
- }
- if ($type == 1) {
+ } elseif ($type == 1) {
$s .= $langs->trans("ServiceCodeDesc").'
';
}
if ($type != -1) {
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index 6fc84ed0669..5bc8c3cc81f 100644
--- a/htdocs/core/modules/societe/modules_societe.class.php
+++ b/htdocs/core/modules/societe/modules_societe.class.php
@@ -197,6 +197,12 @@ abstract class ModeleThirdPartyCode
global $conf;
$langs->load("admin");
+ $strikestart = '';
+ $strikeend = '';
+ if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
+ $strikestart = '';
+ $strikeend = ' '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
+ }
$s = '';
if ($type == -1) {
@@ -207,28 +213,23 @@ abstract class ModeleThirdPartyCode
$s .= $langs->trans("CustomerCodeDesc").'
';
} elseif ($type == 1) {
$s .= $langs->trans("SupplierCodeDesc").'
';
- } elseif ($type != -1) {
+ }
+ if ($type != -1) {
$s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
';
}
$s .= '
';
$s .= ''.$langs->trans("ThisIsModuleRules").':
';
if ($type == 0) {
- $s .= $langs->trans("RequiredIfCustomer").': ';
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '';
- $s .= yn(!$this->code_null, 1, 2);
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= ' '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
+ $s .= $langs->trans("RequiredIfCustomer").': '.$strikestart;
+ $s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '
';
} elseif ($type == 1) {
- $s .= $langs->trans("RequiredIfSupplier").': ';
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '';
- $s .= yn(!$this->code_null, 1, 2);
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= ' '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
+ $s .= $langs->trans("RequiredIfSupplier").': '.$strikestart;
+ $s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '
';
} elseif ($type == -1) {
- $s .= $langs->trans("Required").': ';
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '';
- $s .= yn(!$this->code_null, 1, 2);
- if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= ' '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
+ $s .= $langs->trans("Required").': '.$strikestart;
+ $s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '
';
}
$s .= $langs->trans("CanBeModifiedIfOk").': ';