simplify function
This commit is contained in:
parent
fb871daf14
commit
11a978ca08
@ -204,11 +204,9 @@ abstract class ModeleProductCode
|
||||
if ($type == -1) {
|
||||
$s .= $langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
|
||||
$s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
|
||||
}
|
||||
if ($type == 0) {
|
||||
} elseif ($type == 0) {
|
||||
$s .= $langs->trans("ProductCodeDesc").'<br>';
|
||||
}
|
||||
if ($type == 1) {
|
||||
} elseif ($type == 1) {
|
||||
$s .= $langs->trans("ServiceCodeDesc").'<br>';
|
||||
}
|
||||
if ($type != -1) {
|
||||
|
||||
@ -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 = '<strike>';
|
||||
$strikeend = '</strike> '.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").'<br>';
|
||||
} elseif ($type == 1) {
|
||||
$s .= $langs->trans("SupplierCodeDesc").'<br>';
|
||||
} elseif ($type != -1) {
|
||||
}
|
||||
if ($type != -1) {
|
||||
$s .= $langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
|
||||
}
|
||||
$s .= '<br>';
|
||||
$s .= '<u>'.$langs->trans("ThisIsModuleRules").':</u><br>';
|
||||
if ($type == 0) {
|
||||
$s .= $langs->trans("RequiredIfCustomer").': ';
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
|
||||
$s .= yn(!$this->code_null, 1, 2);
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
|
||||
$s .= $langs->trans("RequiredIfCustomer").': '.$strikestart;
|
||||
$s .= yn(!$this->code_null, 1, 2).$strikeend;
|
||||
$s .= '<br>';
|
||||
} elseif ($type == 1) {
|
||||
$s .= $langs->trans("RequiredIfSupplier").': ';
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
|
||||
$s .= yn(!$this->code_null, 1, 2);
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
|
||||
$s .= $langs->trans("RequiredIfSupplier").': '.$strikestart;
|
||||
$s .= yn(!$this->code_null, 1, 2).$strikeend;
|
||||
$s .= '<br>';
|
||||
} elseif ($type == -1) {
|
||||
$s .= $langs->trans("Required").': ';
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '<strike>';
|
||||
$s .= yn(!$this->code_null, 1, 2);
|
||||
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) $s .= '</strike> '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')';
|
||||
$s .= $langs->trans("Required").': '.$strikestart;
|
||||
$s .= yn(!$this->code_null, 1, 2).$strikeend;
|
||||
$s .= '<br>';
|
||||
}
|
||||
$s .= $langs->trans("CanBeModifiedIfOk").': ';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user