diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 308f98d7828..79950e4f14f 100644
--- a/htdocs/core/modules/product/modules_product.class.php
+++ b/htdocs/core/modules/product/modules_product.class.php
@@ -137,10 +137,18 @@ abstract class ModeleProductCode
global $langs;
$langs->load("admin");
- if ($this->version == 'development') return $langs->trans("VersionDevelopment");
- if ($this->version == 'experimental') return $langs->trans("VersionExperimental");
- if ($this->version == 'dolibarr') return DOL_VERSION;
- if ($this->version) return $this->version;
+ if ($this->version == 'development') {
+ return $langs->trans("VersionDevelopment");
+ }
+ if ($this->version == 'experimental') {
+ return $langs->trans("VersionExperimental");
+ }
+ if ($this->version == 'dolibarr') {
+ return DOL_VERSION;
+ }
+ if ($this->version) {
+ return $this->version;
+ }
return $langs->trans("NotAvailable");
}
@@ -159,12 +167,10 @@ abstract class ModeleProductCode
$sql = "";
$resql = $db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$row = $db->fetch_row($resql);
$liste[$row[0]] = $row[1];
$i++;
@@ -188,37 +194,37 @@ abstract class ModeleProductCode
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) {
$s .= $langs->trans("Name").': '.$this->getNom($langs).'
';
$s .= $langs->trans("Version").': '.$this->getVersion().'
';
+ } elseif ($type == 0) {
+ $s .= $langs->trans("ProductCodeDesc").'
';
+ } elseif ($type == 1) {
+ $s .= $langs->trans("ServiceCodeDesc").'
';
+ }
+ if ($type != -1) {
+ $s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
';
}
- if ($type == 0) $s .= $langs->trans("ProductCodeDesc").'
';
- if ($type == 1) $s .= $langs->trans("ServiceCodeDesc").'
';
- if ($type != -1) $s .= $langs->trans("ValidityControledByModule").': '.$this->getNom($langs).'
';
$s .= '
';
$s .= ''.$langs->trans("ThisIsModuleRules").':
';
- if ($type == 0)
- {
- $s .= $langs->trans("RequiredIfProduct").': ';
- 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")).')';
+ if ($type == 0) {
+ $s .= $langs->trans("RequiredIfProduct").': '.$strikestart;
+ $s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '
';
- } elseif ($type == 1)
- {
- $s .= $langs->trans("RequiredIfService").': ';
- 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")).')';
+ } elseif ($type == 1) {
+ $s .= $langs->trans("RequiredIfService").': '.$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")).')';
+ } elseif ($type == -1) {
+ $s .= $langs->trans("Required").': '.$strikestart;
+ $s .= yn(!$this->code_null, 1, 2).$strikeend;
$s .= '
';
}
$s .= $langs->trans("CanBeModifiedIfOk").': ';
@@ -227,16 +233,18 @@ abstract class ModeleProductCode
$s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'
';
$s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'
';
$s .= '
';
- if ($type == 0 || $type == -1)
- {
+ if ($type == 0 || $type == -1) {
$nextval = $this->getNextValue($product, 0);
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Product").')' : '').': '.$nextval.'
';
}
- if ($type == 1 || $type == -1)
- {
+ if ($type == 1 || $type == -1) {
$nextval = $this->getNextValue($product, 1);
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Service").')' : '').': '.$nextval.'';
}
return $s;
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 9d8d4346efd..13cc8a4948c 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -85,8 +85,10 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
$s1 = $form->textwithpicto('', $tooltip, 1, 1);
$s2 = $form->textwithpicto('', $tooltip, 1, 1);
$texte .= '
';
- $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, $s2)." \n";
- $texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1)." \n";
+ // trans remove html entities
+ $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')." \n";
+ $texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, '{s1}')." \n";
+ $texte = str_replace(array('{s1}', '{s2}'), array($s1, $s2), $texte);
$texte .= " \n";
if (!isset($conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_AQUARIUM_REMOVE_SPECIAL)) $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)." \n";
//if (! empty($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)) $texte.=$langs->trans('COMPANY_AQUARIUM_REMOVE_ALPHA').' = '.yn($conf->global->COMPANY_AQUARIUM_REMOVE_ALPHA)." \n";
diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php
index 6752a01a906..961fa1a4e73 100644
--- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php
+++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php
@@ -99,8 +99,10 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
$s3 = $form->textwithpicto('', $tooltip, 1, 1);
$s4 = $form->textwithpicto('', $tooltip, 1, 1);
$texte .= ' |
';
- $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, $s2, $s4)." \n";
- $texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, $s1, $s3)." \n";
+ // trans remove html entities
+ $texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}', '{s4}')." \n";
+ $texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name, '{s1}', '{s3}')." \n";
+ $texte = str_replace(array('{s1}', '{s2}', '{s3}', '{s4}'), array($s1, $s2, $s3, $s4), $texte);
$texte .= " \n";
// Remove special char if COMPANY_DIGITARIA_REMOVE_SPECIAL is set to 1 or not set (default)
if (!isset($conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL) || !empty($conf->global->$conf->global->COMPANY_DIGITARIA_REMOVE_SPECIAL)) $texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)." \n";
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index 6fc84ed0669..7658c9f3150 100644
--- a/htdocs/core/modules/societe/modules_societe.class.php
+++ b/htdocs/core/modules/societe/modules_societe.class.php
@@ -168,12 +168,10 @@ abstract class ModeleThirdPartyCode
$sql = "";
$resql = $db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$row = $db->fetch_row($resql);
$liste[$row[0]] = $row[1];
$i++;
@@ -197,6 +195,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 +211,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").': ';
@@ -239,12 +238,16 @@ abstract class ModeleThirdPartyCode
$s .= ' ';
if ($type == 0 || $type == -1) {
$nextval = $this->getNextValue($soc, 0);
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': '.$nextval.' ';
}
if ($type == 1 || $type == -1) {
$nextval = $this->getNextValue($soc, 1);
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': '.$nextval.'';
}
return $s;
@@ -360,13 +363,17 @@ abstract class ModeleAccountancyCode
if ($type == 0 || $type == -1) {
$result = $this->get_code($db, $soc, 'customer');
$nextval = $this->code;
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Customer").')' : '').': '.$nextval.' ';
}
if ($type == 1 || $type == -1) {
$result = $this->get_code($db, $soc, 'supplier');
$nextval = $this->code;
- if (empty($nextval)) $nextval = $langs->trans("Undefined");
+ if (empty($nextval)) {
+ $nextval = $langs->trans("Undefined");
+ }
$s .= $langs->trans("NextValue").($type == -1 ? ' ('.$langs->trans("Supplier").')' : '').': '.$nextval.'';
}
return $s;
diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php
index 4b0033cf5ec..c096bc27869 100644
--- a/htdocs/ecm/class/ecmfiles.class.php
+++ b/htdocs/ecm/class/ecmfiles.class.php
@@ -895,16 +895,16 @@ class EcmFiles extends CommonObject
global $conf, $user;
$this->id = 0;
-
+ $this->specimen = 1;
$this->label = '0a1b2c3e4f59999999';
- $this->entity = '1';
+ $this->entity = 1;
$this->filename = 'myspecimenfilefile.pdf';
$this->filepath = '/aaa/bbb';
$this->fullpath_orig = 'c:/file on my disk.pdf';
$this->description = 'This is a long description of file';
$this->keywords = 'key1,key2';
$this->cover = '1';
- $this->position = '5';
+ $this->position = 5;
$this->gen_or_uploaded = 'uploaded';
$this->extraparams = '';
$this->date_c = (dol_now() - 3600 * 24 * 10);
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index c83755009ae..18802301e5a 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -106,6 +106,7 @@ ALTER TABLE llx_user DROP COLUMN googleplus;
ALTER TABLE llx_user DROP COLUMN youtube;
ALTER TABLE llx_user DROP COLUMN whatsapp;
+ALTER TABLE llx_user ADD COLUMN datelastpassvalidation datetime;
ALTER TABLE llx_user ADD COLUMN datestartvalidity datetime;
ALTER TABLE llx_user ADD COLUMN dateendvalidity datetime;
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index 939cd603042..e12b4e3c24e 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -80,6 +80,7 @@ create table llx_user
model_pdf varchar(255) DEFAULT NULL,
datelastlogin datetime,
datepreviouslogin datetime,
+ datelastpassvalidation datetime,
datestartvalidity datetime,
dateendvalidity datetime,
iplastlogin varchar(250),
|