';
- print '';
+ print '';
print $langs->trans('PaymentConditionsShort');
print ' ';
if ($action != 'editconditions' && $user->rights->facture->creer)
@@ -1452,7 +1452,7 @@ if ($action == 'create')
$title = $langs->trans("Recurrence");
//print load_fiche_titre($title, '', 'calendar');
- print '';
+ print '';
print ' '.$title.' ';
@@ -1573,7 +1573,7 @@ if ($action == 'create')
}
print '
';
- print '';
+ print '';
// Nb of generation already done
print ''.$langs->trans("NbOfGenerationDone").' ';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index a4def0c0b9b..1c2b195690a 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4112,7 +4112,9 @@ if ($action == 'create')
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
- print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).' ';
+ print '. ';
+ print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount'));
+ print ' ';
}
}
@@ -4121,10 +4123,9 @@ if ($action == 'create')
$tmptemplate = new FactureRec($db);
$result = $tmptemplate->fetch($object->fk_fac_rec_source);
if ($result > 0) {
- print '. '.$langs->trans(
- "GeneratedFromTemplate",
- ''.$tmptemplate->ref.' '
- ).' ';
+ print '. ';
+ print $langs->transnoentities("GeneratedFromTemplate", ''.dol_escape_htmltag($tmptemplate->ref).' ');
+ print ' ';
}
}
print ' ';
From e595f42a59c9af4f394d2fb59597514c73e87930 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sat, 28 Nov 2020 19:34:28 +0100
Subject: [PATCH 74/91] css
---
htdocs/theme/eldy/global.inc.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 1480b1292e3..e2af296acf4 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -2934,7 +2934,7 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
border-right: 1px solid #CCC !important;
border-left: 1px solid #CCC !important;
- border-top: px solid var(--colorbackhmenu1) !important;
+ border-top: 3px solid var(--colorbackhmenu1) !important;
}
a.tab:hover
{
From fb871daf14a89e7705dc7b99871d5efa50bc956a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:04:05 +0100
Subject: [PATCH 75/91] simplify function
---
.../modules/product/modules_product.class.php | 82 +++++++++++--------
1 file changed, 46 insertions(+), 36 deletions(-)
diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 308f98d7828..8b3c359a562 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,39 @@ 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().' ';
}
- if ($type == 0) $s .= $langs->trans("ProductCodeDesc").' ';
- if ($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 +235,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;
From 2f701f4889888247a5ad42ff8f2f937f230d768c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:24:13 +0100
Subject: [PATCH 76/91] Update mod_codecompta_aquarium.php
---
htdocs/core/modules/societe/mod_codecompta_aquarium.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 9d8d4346efd..b2f3f294926 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -85,8 +85,8 @@ 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";
+ $texte .= $s2.' '.$langs->trans("ModuleCompanyCodeCustomer".$this->name)." \n";
+ $texte .= $s1.' '.$langs->trans("ModuleCompanyCodeSupplier".$this->name)." \n";
$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";
From f9ef0f4d69e1af8c0caf4585948f69e3f07d19c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:33:58 +0100
Subject: [PATCH 77/91] Update mod_codecompta_digitaria.php
---
htdocs/core/modules/societe/mod_codecompta_digitaria.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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";
From eea9382b5735ea6034608fb38270a18fc5149e4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:35:27 +0100
Subject: [PATCH 78/91] Update mod_codecompta_aquarium.php
---
htdocs/core/modules/societe/mod_codecompta_aquarium.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index b2f3f294926..119064cf62e 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 .= $s2.' '.$langs->trans("ModuleCompanyCodeCustomer".$this->name)." \n";
- $texte .= $s1.' '.$langs->trans("ModuleCompanyCodeSupplier".$this->name)." \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";
From 11a978ca085a25c8c8be1c8349305cedcd920868 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:41:44 +0100
Subject: [PATCH 79/91] simplify function
---
.../modules/product/modules_product.class.php | 6 ++---
.../modules/societe/modules_societe.class.php | 27 ++++++++++---------
2 files changed, 16 insertions(+), 17 deletions(-)
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").': ';
From 3a041eed44de7232ad01c13e3f4cd0c896cc5140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:42:48 +0100
Subject: [PATCH 80/91] simplify function
---
.../modules/societe/modules_societe.class.php | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index 5bc8c3cc81f..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++;
@@ -240,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;
@@ -361,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;
From 83c60d725a187d74a2a3c758d981d45e075e6d0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?=
Date: Sat, 28 Nov 2020 23:45:32 +0100
Subject: [PATCH 81/91] Update mod_codecompta_aquarium.php
---
htdocs/core/modules/societe/mod_codecompta_aquarium.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 119064cf62e..13cc8a4948c 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -87,7 +87,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
$texte .= '';
// trans remove html entities
$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')." \n";
- $texte .= $langs->trans("ModuleCompanyCodeSupplier".$this->name '{s1}')." \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";
From 6c65ebef0d2ea9870711572ce30dd25723a2bbd6 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 15:16:53 +0100
Subject: [PATCH 82/91] Look and feel v13
---
htdocs/admin/ihm.php | 4 +-
htdocs/admin/translation.php | 5 +-
htdocs/compta/facture/card.php | 82 +++++++++++--------
htdocs/compta/facture/class/facture.class.php | 12 +--
htdocs/core/class/html.form.class.php | 25 +++---
htdocs/core/class/html.formadmin.class.php | 10 +--
htdocs/core/lib/functions.lib.php | 2 +-
htdocs/core/tpl/contacts.tpl.php | 5 +-
htdocs/core/tpl/object_discounts.tpl.php | 4 +-
htdocs/fourn/facture/card.php | 38 +++++++--
htdocs/langs/en_US/main.lang | 2 +
htdocs/langs/en_US/website.lang | 1 -
htdocs/main.inc.php | 8 +-
htdocs/theme/eldy/badges.inc.php | 7 ++
htdocs/theme/eldy/global.inc.php | 23 +++++-
htdocs/theme/md/style.css.php | 4 +
16 files changed, 147 insertions(+), 85 deletions(-)
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index ec6ab640125..ad2cd408471 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -241,8 +241,8 @@ print ' ';
clearstatcache();
print ' ';
-print '';
-print ''.$langs->trans("Language").' ';
+print '';
+print ''.img_picto('', 'language').' '.$langs->trans("Language").' ';
print ' ';
// Default language
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index f4d50cb6f8d..76cae0443b3 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -363,7 +363,7 @@ if ($mode == 'overwrite')
if ($mode == 'searchkey')
{
- $langcode = GETPOST('langcode') ?GETPOST('langcode') : $langs->defaultlang;
+ $langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang;
$newlang = new Translate('', $conf);
$newlang->setDefaultLang($langcode);
@@ -384,8 +384,7 @@ if ($mode == 'searchkey')
if (empty($langcode) || $langcode == '-1') $nbempty++;
if (empty($transkey)) $nbempty++;
if (empty($transvalue)) $nbempty++;
- if ($action == 'search' && ($nbempty > 999)) // 999 to disable this
- {
+ if ($action == 'search' && ($nbempty > 999)) { // 999 to disable this
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
} else {
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 1c2b195690a..de5b64c28fe 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -358,26 +358,23 @@ if (empty($reshook))
if ($object->retained_warranty_date_limit < $object->date) $object->retained_warranty_date_limit = $object->date;
$result = $object->update($user);
if ($result < 0) dol_print_error($db, $object->error);
- } elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer)
- {
+ } elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer) {
$object->fetch($id);
$result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float'));
if ($result < 0)
dol_print_error($db, $object->error);
- } elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer)
- {
+ } elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer) {
$object->fetch($id);
$result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float'));
if ($result < 0)
dol_print_error($db, $object->error);
- } // Multicurrency Code
+ } // Multicurrency Code
elseif ($action == 'setmulticurrencycode' && $usercancreate) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
} // Multicurrency rate
elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int'));
- } elseif ($action == 'setinvoicedate' && $usercancreate)
- {
+ } elseif ($action == 'setinvoicedate' && $usercancreate) {
$object->fetch($id);
$old_date_lim_reglement = $object->date_lim_reglement;
$date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
@@ -395,8 +392,7 @@ if (empty($reshook))
if ($result < 0) {
dol_print_error($db, $object->error);
}
- } elseif ($action == 'setdate_pointoftax' && $usercancreate)
- {
+ } elseif ($action == 'setdate_pointoftax' && $usercancreate) {
$object->fetch($id);
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
$object->date_pointoftax = $date_pointoftax;
@@ -3649,8 +3645,7 @@ if ($action == 'create')
}
print '';
-} elseif ($id > 0 || !empty($ref))
-{
+} elseif ($id > 0 || !empty($ref)) {
/*
* Show object in view mode
*/
@@ -3896,6 +3891,7 @@ if ($action == 'create')
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
}
if ($action == 'paid' && $resteapayer > 0) {
+ $close = array();
// Code
$i = 0;
$close[$i]['code'] = 'discount_vat'; // escompte
@@ -3922,7 +3918,7 @@ if ($action == 'create')
$i++;
// arrayreasons[code]=reason
foreach ($close as $key => $val) {
- $arrayreasons[$close [$key]['code']] = $close[$key]['reason'];
+ $arrayreasons[$close[$key]['code']] = $close[$key]['reason'];
}
// Cree un tableau formulaire
@@ -4073,24 +4069,26 @@ if ($action == 'create')
// Type
print ''.$langs->trans('Type').' ';
+ print '';
print $object->getLibType();
+ print ' ';
if ($object->module_source) {
- print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.') ';
+ print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.') ';
}
if ($object->type == Facture::TYPE_REPLACEMENT) {
$facreplaced = new Facture($db);
$facreplaced->fetch($object->fk_facture_source);
- print ' ('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).') ';
+ print ' ('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).') ';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE && !empty($object->fk_facture_source)) {
$facusing = new Facture($db);
$facusing->fetch($object->fk_facture_source);
- print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).') ';
+ print ' ('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).') ';
}
$facidavoir = $object->getListIdAvoirFromInvoice();
if (count($facidavoir) > 0) {
- print ' ('.$langs->transnoentities("InvoiceHasAvoir");
+ print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i = 0;
foreach ($facidavoir as $id) {
if ($i == 0)
@@ -4105,14 +4103,14 @@ if ($action == 'create')
if ($objectidnext > 0) {
$facthatreplace = new Facture($db);
$facthatreplace->fetch($objectidnext);
- print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).') ';
+ print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).') ';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
- print '. ';
+ print ' ';
print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount'));
print ' ';
}
@@ -4123,7 +4121,7 @@ if ($action == 'create')
$tmptemplate = new FactureRec($db);
$result = $tmptemplate->fetch($object->fk_fac_rec_source);
if ($result > 0) {
- print '. ';
+ print ' ';
print $langs->transnoentities("GeneratedFromTemplate", ''.dol_escape_htmltag($tmptemplate->ref).' ');
print ' ';
}
@@ -4133,13 +4131,11 @@ if ($action == 'create')
// Relative and absolute discounts
print ''."\n";
print ''.$langs->trans('Discounts');
-
print ' ';
$thirdparty = $soc;
$discount_type = 0;
$backtopage = urlencode($_SERVER["PHP_SELF"].'?facid='.$object->id);
include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
-
print ' ';
// Date invoice
@@ -4155,7 +4151,7 @@ if ($action == 'create')
if ($action == 'editinvoicedate') {
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date, 'invoicedate');
} else {
- print dol_print_date($object->date, 'day');
+ print ''.dol_print_date($object->date, 'day').' ';
}
print ' ';
@@ -4174,7 +4170,7 @@ if ($action == 'create')
if ($action == 'editdate_pointoftax') {
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date_pointoftax, 'date_pointoftax');
} else {
- print dol_print_date($object->date_pointoftax, 'day');
+ print ''.dol_print_date($object->date_pointoftax, 'day').' ';
}
print ' ';
}
@@ -4214,7 +4210,7 @@ if ($action == 'create')
if ($action == 'editpaymentterm') {
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date_lim_reglement, 'paymentterm');
} else {
- print dol_print_date($object->date_lim_reglement, 'day');
+ print ''.dol_print_date($object->date_lim_reglement, 'day').' ';
if ($object->hasDelay()) {
print img_warning($langs->trans('Late'));
}
@@ -4789,10 +4785,13 @@ if ($action == 'create')
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
// Total already paid
print '';
- if ($object->type != Facture::TYPE_DEPOSIT)
+ print '';
+ if ($object->type != Facture::TYPE_DEPOSIT) {
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
- else print $langs->trans('AlreadyPaid');
- print ' : '.price($totalpaye).' ';
+ } else {
+ print $langs->trans('AlreadyPaid');
+ }
+ print ''.price($totalpaye).' ';
$resteapayeraffiche = $resteapayer;
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
@@ -4813,12 +4812,14 @@ if ($action == 'create')
$obj = $db->fetch_object($resql);
$invoice->fetch($obj->fk_facture_source);
print '';
+ print '';
if ($invoice->type == Facture::TYPE_CREDIT_NOTE)
print $langs->trans("CreditNote").' ';
if ($invoice->type == Facture::TYPE_DEPOSIT)
print $langs->trans("Deposit").' ';
print $invoice->getNomUrl(0);
- print ' : ';
+ print '';
+ print '';
print ''.price($obj->amount_ttc).' ';
print '';
print 'id.'&action=unlinkdiscount&discountid='.$obj->rowid.'">'.img_delete().' ';
@@ -4836,7 +4837,9 @@ if ($action == 'create')
// Paye partiellement 'escompte'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
print ' ';
- print $form->textwithpicto($langs->trans("Discount").':', $langs->trans("HelpEscompte"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1);
+ print ' ';
print ' '.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -4844,7 +4847,9 @@ if ($action == 'create')
// Paye partiellement ou Abandon 'badcustomer'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') {
print '';
- print $form->textwithpicto($langs->trans("Abandoned").':', $langs->trans("HelpAbandonBadCustomer"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
+ print ' ';
print ' '.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).' ';
// $resteapayeraffiche=0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -4852,7 +4857,9 @@ if ($action == 'create')
// Paye partiellement ou Abandon 'product_returned'
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
print '';
- print $form->textwithpicto($langs->trans("ProductReturned").':', $langs->trans("HelpAbandonProductReturned"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
+ print ' ';
print ' '.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -4863,20 +4870,27 @@ if ($action == 'create')
$text = $langs->trans("HelpAbandonOther");
if ($object->close_note)
$text .= ''.$langs->trans("Reason").' :'.$object->close_note;
- print $form->textwithpicto($langs->trans("Abandoned").':', $text, - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("Abandoned"), $text, - 1);
+ print ' ';
print ''.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// Billed
- print ''.$langs->trans("Billed").' : '.price($object->total_ttc).' ';
+ print '';
+ print '';
+ print $langs->trans("Billed");
+ print ' '.price($object->total_ttc).' ';
// Remainder to pay
print '';
+ print '';
print $langs->trans('RemainderToPay');
if ($resteapayeraffiche < 0)
print ' ('.$langs->trans('ExcessReceived').')';
- print ' : ';
+ print '';
+ print '';
print ''.price($resteapayeraffiche).' ';
print ' ';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 29203a48f26..0f138833ae6 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -74,7 +74,7 @@ class Facture extends CommonInvoice
public $fk_element = 'fk_facture';
/**
- * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
+ * @var string String with name of icon for myobject.
*/
public $picto = 'bill';
@@ -1424,11 +1424,11 @@ class Facture extends CommonInvoice
$label = '';
if ($user->rights->facture->lire) {
- $label = img_picto('', $this->picto).' '.$langs->trans("Invoice").' ';
- if ($this->type == self::TYPE_REPLACEMENT) $label = ''.$langs->transnoentitiesnoconv("ReplacementInvoice").' ';
- if ($this->type == self::TYPE_CREDIT_NOTE) $label = ''.$langs->transnoentitiesnoconv("CreditNote").' ';
- if ($this->type == self::TYPE_DEPOSIT) $label = ''.$langs->transnoentitiesnoconv("Deposit").' ';
- if ($this->type == self::TYPE_SITUATION) $label = ''.$langs->transnoentitiesnoconv("InvoiceSituation").' ';
+ $label = img_picto('', $picto).' '.$langs->trans("Invoice").' ';
+ if ($this->type == self::TYPE_REPLACEMENT) $label = img_picto('', $picto).' '.$langs->transnoentitiesnoconv("ReplacementInvoice").' ';
+ if ($this->type == self::TYPE_CREDIT_NOTE) $label = img_picto('', $picto).' '.$langs->transnoentitiesnoconv("CreditNote").' ';
+ if ($this->type == self::TYPE_DEPOSIT) $label = img_picto('', $picto).' '.$langs->transnoentitiesnoconv("Deposit").' ';
+ if ($this->type == self::TYPE_SITUATION) $label = img_picto('', $picto).' '.$langs->transnoentitiesnoconv("InvoiceSituation").' ';
if (isset($this->statut) && isset($this->alreadypaid)) {
$label .= ' '.$this->getLibStatut(5, $this->alreadypaid);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d56ba9bdf62..42f09756fad 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -266,8 +266,8 @@ class Form
elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) $ret .= dol_htmlentitiesbr($value);
elseif (preg_match('/^safehtmlstring/', $typeofdata)) $ret .= dol_string_onlythesehtmltags($value);
elseif (preg_match('/^restricthtml/', $typeofdata)) $ret .= dol_string_onlythesehtmltags($value);
- elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret .= dol_print_date($value, 'day');
- elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') $ret .= dol_print_date($value, 'dayhour');
+ elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret .= ''.dol_print_date($value, 'day').' ';
+ elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') $ret .= ''.dol_print_date($value, 'dayhour').' ';
elseif (preg_match('/^select;/', $typeofdata))
{
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata));
@@ -636,11 +636,11 @@ class Form
* Generate select HTML to choose massaction
*
* @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
- * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
+ * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $alwaysvisible 1=select button always visible
- * @param string $name Name for massaction
- * @param string $cssclass CSS class used to check for select
- * @return string|void Select list
+ * @param string $name Name for massaction
+ * @param string $cssclass CSS class used to check for select
+ * @return string|void Select list
*/
public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect')
{
@@ -780,8 +780,6 @@ class Form
$i = 0;
if ($num)
{
- $foundselected = false;
-
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
@@ -828,7 +826,6 @@ class Form
}
if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']))
{
- $foundselected = true;
$out .= '';
} else {
$out .= ' ';
@@ -1413,7 +1410,7 @@ class Form
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param string $htmlid Html id to use instead of htmlname
* @return int <0 if KO, Nb of contact in list if OK
- * @deprected You can use selectcontacts directly (warning order of param was changed)
+ * @deprecated You can use selectcontacts directly (warning order of param was changed)
*/
public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '')
{
@@ -1485,11 +1482,10 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
- if ($htmlname != 'none' && !$options_only) $out .= '';
+ if ($htmlname != 'none' && !$options_only) $out .= '';
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= ' ';
if ($showempty == 2) $out .= '-- '.$langs->trans("Internal").' -- ';
- $num = $this->db->num_rows($resql);
$i = 0;
if ($num)
{
@@ -1561,8 +1557,9 @@ class Form
$i++;
}
} else {
- $out .= '';
- $out .= ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
+ $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst');
+ $out .= ' ';
+ $out .= $labeltoshow;
$out .= ' ';
}
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index 34749325822..b0b979dcf46 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -98,7 +98,7 @@ class FormAdmin
if ($showcode == 1) $valuetoshow = $key.' - '.$value;
if ($showcode == 2) {
if ($mainlangonly) $valuetoshow = $value.' ('.preg_replace('/[_-].*$/', '', $key).')';
- else $valuetoshow = $value.' ('.$key.')';
+ else $valuetoshow = $value.' ('.$key.') ';
}
$keytouse = $key;
@@ -111,11 +111,11 @@ class FormAdmin
continue;
}
- if ($selected == $keytouse)
- {
- $out .= ''.$valuetoshow.' ';
+ $valuetoshow .= ' '.picto_from_langcode($key, 'class="saturatemedium"');
+ if ($selected == $keytouse) {
+ $out .= ''.$valuetoshow.' ';
} else {
- $out .= ''.$valuetoshow.' ';
+ $out .= ''.$valuetoshow.' ';
}
}
$out .= ' ';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 51cf1f2487c..f7e1081acf3 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3186,7 +3186,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
- 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
+ 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'company', 'contact', 'contract', 'cubes',
'delete', 'dolly', 'dollyrevert', 'donation', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 98be97ac5bb..05f29acb109 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -140,7 +140,8 @@ if ($permission)
select_contacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp');
+ print $form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'contactid', 3, '', '', 1, 'minwidth100imp');
+ $nbofcontacts = $form->num;
$newcardbutton = '';
if (!empty($object->socid) && $object->socid > 1 && $user->rights->societe->creer)
@@ -281,7 +282,7 @@ print_liste_field_titre($arrayfields['thirdparty']['label'], $_SERVER["PHP_SELF"
print_liste_field_titre($arrayfields['contact']['label'], $_SERVER["PHP_SELF"], "contact_name", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre($arrayfields['status']['label'], $_SERVER["PHP_SELF"], "statut", "", $param, "", $sortfield, $sortorder, 'center ');
-print_liste_field_titre($arrayfields['link']['label'], $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch ');
+print_liste_field_titre('', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder, 'center maxwidthsearch ');
print "";
foreach ($list as $entry)
diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php
index e3e921c20c5..1e26f2a5d4c 100644
--- a/htdocs/core/tpl/object_discounts.tpl.php
+++ b/htdocs/core/tpl/object_discounts.tpl.php
@@ -44,7 +44,7 @@ if ($fixedDiscount > 0)
print $langs->trans($translationKey, $fixedDiscount).'.';
} else {
$translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount';
- print $langs->trans($translationKey).'.';
+ print '
'.$langs->trans($translationKey).'. ';
}
if ($isNewObject) print ' ('.$addrelativediscount.')';
@@ -95,7 +95,7 @@ if ($absolute_creditnote > 0) {
if ($absolute_discount <= 0 && $absolute_creditnote <= 0) {
$translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount';
- print '
'.$langs->trans($translationKey).'.';
+ print '
'.$langs->trans($translationKey).'. ';
if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
print ' ('.$addabsolutediscount.')';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 76a43475616..e2b939dd14a 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2480,7 +2480,9 @@ if ($action == 'create')
// Type
print '
'.$langs->trans('Type').' ';
+ print '';
print $object->getLibType();
+ print ' ';
if ($object->type == FactureFournisseur::TYPE_REPLACEMENT)
{
$facreplaced = new FactureFournisseur($db);
@@ -2519,7 +2521,7 @@ if ($action == 'create')
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, 0, $object->id);
if ($result > 0) {
- print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).' ';
+ print ' '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).' ';
}
}
print ' ';
@@ -2902,10 +2904,12 @@ if ($action == 'create')
{
// Total already paid
print '
';
+ print '';
if ($object->type != FactureFournisseur::TYPE_DEPOSIT)
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
else print $langs->trans('AlreadyPaid');
- print ' : 0) ? ' class="amountalreadypaid"' : '').'>'.price($totalpaye).' ';
+ print '';
+ print '
0) ? ' class="amountalreadypaid"' : '').'>'.price($totalpaye).' ';
//$resteapayer = $object->total_ttc - $totalpaye;
$resteapayeraffiche = $resteapayer;
@@ -2953,7 +2957,9 @@ if ($action == 'create')
// Paye partiellement 'escompte'
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
print '
';
- print $form->textwithpicto($langs->trans("Discount").':', $langs->trans("HelpEscompte"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1);
+ print ' ';
print ' '.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -2961,7 +2967,9 @@ if ($action == 'create')
// Paye partiellement ou Abandon 'badsupplier'
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'badsupplier') {
print '
';
- print $form->textwithpicto($langs->trans("Abandoned").':', $langs->trans("HelpAbandonBadCustomer"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
+ print ' ';
print ' '.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' ';
// $resteapayeraffiche=0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -2969,7 +2977,9 @@ if ($action == 'create')
// Paye partiellement ou Abandon 'product_returned'
if (($object->statut == FactureFournisseur::STATUS_CLOSED || $object->statut == FactureFournisseur::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
print '
';
- print $form->textwithpicto($langs->trans("ProductReturned").':', $langs->trans("HelpAbandonProductReturned"), - 1);
+ print '';
+ print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
+ print ' ';
print ' '.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@@ -2980,21 +2990,29 @@ if ($action == 'create')
$text = $langs->trans("HelpAbandonOther");
if ($object->close_note)
$text .= '
'.$langs->trans("Reason").' :'.$object->close_note;
- print $form->textwithpicto($langs->trans("Abandoned").':', $text, - 1);
+ print '
';
+ print $form->textwithpicto($langs->trans("Abandoned"), $text, - 1);
+ print ' ';
print '
'.price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye).' ';
$resteapayeraffiche = 0;
$cssforamountpaymentcomplete = 'amountpaymentneutral';
}
// Billed
- print '
'.$langs->trans("Billed").' : '.price($object->total_ttc).' ';
+ print '
';
+ print '';
+ print $langs->trans("Billed");
+ print ' ';
+ print ' '.price($object->total_ttc).' ';
// Remainder to pay
print '
';
+ print '';
if ($resteapayeraffiche >= 0)
print $langs->trans('RemainderToPay');
else print $langs->trans('ExcessPaid');
- print ' : ';
+ print '';
+ print '';
print ''.price($resteapayeraffiche).' ';
print ' ';
} else // Credit note
@@ -3011,10 +3029,12 @@ if ($action == 'create')
// Remainder to pay back
print '
';
+ print '';
if ($resteapayeraffiche <= 0)
print $langs->trans('RemainderToPayBack');
else print $langs->trans('ExcessPaid');
- print ' : ';
+ print '';
+ print '';
print ''.price($sign * $resteapayeraffiche).' ';
print ' ';
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 11278499121..c32e4d01ddd 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -85,6 +85,8 @@ FileWasNotUploaded=A file is selected for attachment but was not yet uploaded. C
NbOfEntries=No. of entries
GoToWikiHelpPage=Read online help (Internet access needed)
GoToHelpPage=Read help
+DedicatedPageAvailable=This is a dedicated help page related to your current screen
+HomePage=Home Page
RecordSaved=Record saved
RecordDeleted=Record deleted
RecordGenerated=Record generated
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 1d62d1c07f8..27a5d607fb8 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -30,7 +30,6 @@ EditInLine=Edit inline
AddWebsite=Add website
Webpage=Web page/container
AddPage=Add page/container
-HomePage=Home Page
PageContainer=Page
PreviewOfSiteNotYetAvailable=Preview of your website
%s not yet available. You must first '
Import a full website template ' or just '
Add a page/container '.
RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this.
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 7f31bad876d..782685daeba 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1699,8 +1699,12 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
if ($helpbaseurl && $helppage)
{
$text = '';
- $title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage');
- if ($mode == 'wiki') $title .= ' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'"'."";
+ $title = $langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage').'...';
+ if ($mode == 'wiki') {
+ $title .= '
'.$langs->trans("PageWiki").' '.dol_escape_htmltag('"'.strtr($helppage, '_', ' ').'"');
+ if ($helppresent) $title.= '
('.$langs->trans("DedicatedPageAvailable").') ';
+ else $title.= '
('.$langs->trans("HomePage").') ';
+ }
$text .= '
);
}
From 404634919d5c8c688c6e725c6787b61233e29790 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 15:47:08 +0100
Subject: [PATCH 83/91] Look and feel v13
---
htdocs/core/class/html.form.class.php | 23 +++++++++++++++--------
htdocs/core/lib/functions.lib.php | 15 ++++++++++-----
2 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 42f09756fad..444a44cdc34 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -824,15 +824,22 @@ class Form
$atleastonefavorite = 0;
$out .= '------------ ';
}
- if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']))
- {
- $out .= '';
- } else {
- $out .= ' ';
+
+ $labeltoshow = '';
+ if ($row['label']) $labeltoshow .= dol_trunc($row['label'], $maxlength, 'middle');
+ else $labeltoshow .= ' ';
+ if ($row['code_iso']) {
+ $labeltoshow .= ' ('.$row['code_iso'].') ';
+ $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium marginrightonly"');
+ $labeltoshow = $tmpflag.' '.$labeltoshow;
}
- if ($row['label']) $out .= dol_trunc($row['label'], $maxlength, 'middle');
- else $out .= ' ';
- if ($row['code_iso']) $out .= ' ('.$row['code_iso'].')';
+
+ if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) {
+ $out .= ' ';
+ } else {
+ $out .= ' ';
+ }
+ $out .= $labeltoshow;
$out .= ' ';
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index f7e1081acf3..17e0fed3fcb 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7255,14 +7255,12 @@ function dol_validElement($element)
/**
* Return img flag of country for a language code or country code
*
- * @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR)
- * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
+ * @param string $codelang Language code ('en_IN', 'fr_CA', ...) or ISO Country code on 2 characters in uppercase ('IN', 'FR')
+ * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"' or 'class="saturatemedium"')
* @return string HTML img string with flag.
*/
function picto_from_langcode($codelang, $moreatt = '')
{
- global $langs;
-
if (empty($codelang)) return '';
if ($codelang == 'auto')
@@ -7275,7 +7273,14 @@ function picto_from_langcode($codelang, $moreatt = '')
'ca_ES' => 'catalonia',
'da_DA' => 'dk',
'fr_CA' => 'mq',
- 'sv_SV' => 'se'
+ 'sv_SV' => 'se',
+ 'AQ' => 'unknown',
+ 'CW' => 'unknown',
+ 'IM' => 'unknown',
+ 'JE' => 'unknown',
+ 'MF' => 'unknown',
+ 'BL' => 'unknown',
+ 'SX' => 'unknown'
);
if (isset($langtocountryflag[$codelang])) $flagImage = $langtocountryflag[$codelang];
From 150dd7177429910b7f22f4ad2d9212d431577030 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 16:02:39 +0100
Subject: [PATCH 84/91] Look and feel v13
---
htdocs/admin/company.php | 5 +++--
htdocs/core/class/html.form.class.php | 20 +++++++++++---------
htdocs/theme/common/flags/unknown.png | Bin 0 -> 1595 bytes
3 files changed, 14 insertions(+), 11 deletions(-)
create mode 100644 htdocs/theme/common/flags/unknown.png
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 8b900f552c8..75dcb9b179f 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -406,11 +406,12 @@ print ''.$langs->trans("CompanyAddress").' ';
print ' '."\n";
+// Zip
print ''.$langs->trans("CompanyZip").' ';
-print ' '."\n";
+print ' '."\n";
print ''.$langs->trans("CompanyTown").' ';
-print ' '."\n";
+print ' '."\n";
// Country
print ''.$langs->trans("Country").' ';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 444a44cdc34..a56402fddef 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5102,19 +5102,21 @@ class Form
$out .= '';
foreach ($langs->cache_currencies as $code_iso => $currency)
{
- if ($selected && $selected == $code_iso)
- {
- $out .= '';
- } else {
- $out .= ' ';
- }
- $out .= $currency['label'];
+ $labeltoshow = $currency['label'];
if ($mode == 1)
{
- $out .= ' ('.$code_iso.')';
+ $labeltoshow .= ' ('.$code_iso.') ';
} else {
- $out .= ' ('.$langs->getCurrencySymbol($code_iso).')';
+ $labeltoshow .= ' ('.$langs->getCurrencySymbol($code_iso).') ';
}
+
+ if ($selected && $selected == $code_iso)
+ {
+ $out .= ' ';
+ } else {
+ $out .= ' ';
+ }
+ $out .= $labeltoshow;
$out .= ' ';
}
$out .= ' ';
diff --git a/htdocs/theme/common/flags/unknown.png b/htdocs/theme/common/flags/unknown.png
new file mode 100644
index 0000000000000000000000000000000000000000..08efc7b264d7eab8e1c4c13424342999084a4965
GIT binary patch
literal 1595
zcmV-B2E_S^P)
zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1b@lH)22{I65&5s-us90y}l^=|NvzYTUiXR?z_
zV#*elWvSgQ$P8`&|JUgc4hftnn&(tf3OHhkMJgsa>_?eb4sl+On{b-k`04xrX@kP*
ze(Uv!ukhRDg;Nb)ZvB*xCz6jur_4t}9hC)>^%^Anvimt6iORN5QptV|b&=h+BXB}F
z&gDot5rzGpt{u_A(rPHABAc>?dCfZl-OmaS<0@JZ$7+~IHG&!NcO)R>=JU=3hHHXu
zNIuQzp8fOej(n+yU+=g~2S=EE`+)6x@+ZYth4qX`ZXeWgO7)fG-q+mwwtroX35=$r
zqbAuWhDP85%5}b$FdV00?sF839BOEgd<`uu7>x@HRO!T#SFYT7o3?QS#3-9MtVk1`
zzN{`q+7JdBVQ?4MqN`@;*JLAAxaEw6XWcUEHO{EKGD3xsjPc6DLH~OA%Anrcpol|0
za|K*7`Wi5Xa^s392*Ul)%_hO8amXL8`UkBF1#Qxt@qslgdy2*Q(px%pR>T?XzJ!>3
zJraN-)HZ;@5{MiUx}OsV7jb6rm?2OFa?vOY6ks!10aBuB5^~8hYU3T}87n49h8ug+
zSVfxDp-s^Wv0^mzkH?H2s-_mrESXy-D^`=Hm@K8_X>4-U)uWpych6qDX3a5MPT6zL
zCD$TFu?Jd7#Y--w)GAa_s3KQIe1&I`MVGkPk``a`QkL4#J}owDsd>w-w7SZwE4GO>
zt-j{9taW4Buv2Vtvn_4D<*jVBqu09j*sZ7TJ@?Yk7>BGx@CLt=n~?N
zhMaTm(Ky=pxqHrHg)X-)3f{WCnC3f6@8P(>p!aZGEWL;0;-b&s`A4GXa9k{X2G5s7
zuj2Tn{68l8J&u>;f37{~JscnCqkB5&JsiL8qsOv*R{l>cTY6XalZ(EOxzu~MS?T4E
zdSL1KFL~S~qa1x`Ut@X?$4_Mc!qR&F$XP9nS#OuUUo0iUbpE%44l0tk=JZjJdi66NxyZpvE@35a|hK*EmjyOy#l%*fJKN9Aft>86k#Dst44~6
zB<;sM{QZt!B$rIC4KQ-dqXZR_;|KqP-`$$IiE%e66a!jcZ2Myf2<`&4ifw-%+ji{)
z2s{Hy9S$u4$q@<^0002CNkljtRAumcR0h)RMXsRoPV
zVV)?Y6%BQ8%w*1-{F%vYbX}*`8eHNe$%8qyZL5@WiZdMc_6x3(Oq<@=?(4YLdV>k}
zaa2k<$ByqB;2jsukHIdkt)NZ6)IVSifM$j4Gam7Y<7I#ehS=)+8SZeKWI7+LweBqf
tjBt+wyd`;Ewoa1S!V{8w;OP&&@eAQ(DI!Dv(<1-?002ovPDHLkV1iO2_eTH#
literal 0
HcmV?d00001
From beafcc7853573d7b95c04736e4e12ec8953a3c56 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 16:06:03 +0100
Subject: [PATCH 85/91] Fix warning
---
htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index c9a8ee3b602..8b0dd134d65 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -712,8 +712,8 @@ class pdf_rouget extends ModelePdfExpedition
if ($totalWeight != '') $totalWeighttoshow = showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
if ($totalVolume != '') $totalVolumetoshow = showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
- if ($object->trueWeight) $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
- if ($object->trueVolume) $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
+ if (!empty($object->trueWeight)) $totalWeighttoshow = showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
+ if (!empty($object->trueVolume)) $totalVolumetoshow = showDimensionInBestUnit($object->trueVolume, $object->volume_units, "volume", $outputlangs);
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
From c963624f250b04154f6774315431de3b81a0f5e4 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 18:53:19 +0100
Subject: [PATCH 86/91] css
---
htdocs/theme/eldy/global.inc.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 86be13bab1f..e576b379a6c 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -1965,8 +1965,8 @@ div.statusrefbis {
}
img.photoref, div.photoref {
/* border: 1px solid #DDD; */
- -webkit-box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
- box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
+ -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
+ box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
padding: 4px;
height: 80px;
width: 80px;
From 66381a4f4d035786dfdd0b92a8fdff09adb3653c Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 19:41:11 +0100
Subject: [PATCH 87/91] FIX #15558
---
htdocs/core/actions_extrafields.inc.php | 67 ++++++++++++++++++-------
htdocs/langs/en_US/errors.lang | 2 +
2 files changed, 52 insertions(+), 17 deletions(-)
diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php
index 9ad3ce1e92e..1557d156f03 100644
--- a/htdocs/core/actions_extrafields.inc.php
+++ b/htdocs/core/actions_extrafields.inc.php
@@ -40,7 +40,7 @@ if ($type == 'select') $extrasize = '';
// Add attribute
if ($action == 'add')
{
- if ($_POST["button"] != $langs->trans("Cancel"))
+ if (GETPOST("button") != $langs->trans("Cancel"))
{
// Check values
if (!$type)
@@ -132,10 +132,28 @@ if ($action == 'add')
}
}
- if (!$error)
- {
+ if (!$error) {
+ if (strlen(GETPOST('attrname', 'aZ09')) < 3) {
+ $error++;
+ $langs->load("errors");
+ $mesg[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
+ $action = 'create';
+ }
+ }
+
+ // Check reserved keyword with more than 3 characters
+ if (!$error) {
+ if (in_array(GETPOST('attrname', 'aZ09'), array('and', 'keyword', 'table', 'index', 'integer', 'float', 'double', 'position'))) {
+ $error++;
+ $langs->load("errors");
+ $mesg[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
+ $action = 'create';
+ }
+ }
+
+ if (!$error) {
// attrname must be alphabetical and lower case only
- if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/", $_POST['attrname']) && !is_numeric($_POST["attrname"]))
+ if (GETPOSISSET("attrname") && preg_match("/^[a-z0-9-_]+$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09')))
{
// Construct array for parameter (value of select list)
$default_value = GETPOST('default_value', 'alpha');
@@ -161,7 +179,7 @@ if ($action == 'add')
if ($type == 'separate') $visibility = 3;
$result = $extrafields->addExtraField(
- GETPOST('attrname', 'alpha'),
+ GETPOST('attrname', 'aZ09'),
GETPOST('label', 'alpha'),
$type,
GETPOST('pos', 'int'),
@@ -208,7 +226,7 @@ if ($action == 'add')
// Rename field
if ($action == 'update')
{
- if ($_POST["button"] != $langs->trans("Cancel"))
+ if (GETPOST("button") != $langs->trans("Cancel"))
{
// Check values
if (!$type)
@@ -293,9 +311,28 @@ if ($action == 'update')
}
}
+ if (!$error) {
+ if (strlen(GETPOST('attrname', 'aZ09')) < 3 && empty($conf->global->MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE)) {
+ $error++;
+ $langs->load("errors");
+ $mesg[] = $langs->trans("ErrorValueLength", $langs->transnoentitiesnoconv("AttributeCode"), 3);
+ $action = 'edit';
+ }
+ }
+
+ // Check reserved keyword with more than 3 characters
+ if (!$error) {
+ if (in_array(GETPOST('attrname', 'aZ09'), array('and', 'keyword', 'table', 'index', 'integer', 'float', 'double', 'position')) && empty($conf->global->MAIN_DISABLE_EXTRAFIELDS_CHECK_FOR_UPDATE)) {
+ $error++;
+ $langs->load("errors");
+ $mesg[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09'));
+ $action = 'edit';
+ }
+ }
+
if (!$error)
{
- if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/", $_POST['attrname']))
+ if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09')))
{
$pos = GETPOST('pos', 'int');
// Construct array for parameter (value of select list)
@@ -321,7 +358,7 @@ if ($action == 'update')
if ($type == 'separate') $visibility = 3;
$result = $extrafields->update(
- GETPOST('attrname', 'alpha'),
+ GETPOST('attrname', 'aZ09'),
GETPOST('label', 'alpha'),
$type,
$extrasize,
@@ -342,8 +379,7 @@ if ($action == 'update')
(GETPOST('totalizable', 'alpha') ? 1 : 0),
GETPOST('printable', 'alpha')
);
- if ($result > 0)
- {
+ if ($result > 0) {
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
@@ -365,13 +401,10 @@ if ($action == 'update')
}
// Delete attribute
-if ($action == 'delete')
-{
- if (isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/", $_GET["attrname"]))
- {
- $result = $extrafields->delete($_GET["attrname"], $elementtype);
- if ($result >= 0)
- {
+if ($action == 'delete') {
+ if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST("attrname", 'aZ09'))) {
+ $result = $extrafields->delete(GETPOST("attrname", 'aZ09'), $elementtype);
+ if ($result >= 0) {
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else $mesg = $extrafields->error;
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 700a76e32a5..b13a229f10d 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -246,6 +246,8 @@ ErrorProductDoesNotNeedBatchNumber=Error, product '%s ' does not accept a
ErrorFailedToReadObject=Error, failed to read object of type %s
ErrorParameterMustBeEnabledToAllwoThisFeature=Error, parameter %s must be enabled into conf/conf.php to allow use of Command Line Interface by the internal job scheduler
ErrorLoginDateValidity=Error, this login is outside the validity date range
+ErrorValueLength=Length of field '%s ' must be higher than '%s '
+ErrorReservedKeyword=The word '%s ' is a reserved keyword
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
From d3a2aa664fb5f67c76f5afddc4c9b7d34dca4f56 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 20:27:40 +0100
Subject: [PATCH 88/91] FIX #15572
---
htdocs/comm/propal/stats/index.php | 6 +++---
htdocs/commande/card.php | 15 ++-------------
htdocs/commande/stats/index.php | 8 ++++----
htdocs/compta/facture/stats/index.php | 4 ++--
htdocs/core/lib/functions.lib.php | 1 +
htdocs/expensereport/stats/index.php | 8 ++++----
htdocs/fichinter/stats/index.php | 4 ++--
htdocs/ticket/stats/index.php | 6 +++---
test/phpunit/FunctionsLibTest.php | 6 ++++--
9 files changed, 25 insertions(+), 33 deletions(-)
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index add31f13f08..da3c24f6f01 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -37,11 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
-$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
+$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
-$object_status = GETPOST('object_status');
+$object_status = GETPOST('object_status', 'intcomma');
$typent_id = GETPOST('typent_id', 'int');
$categ_id = GETPOST('categ_id', 'categ_id');
@@ -55,7 +55,7 @@ if ($user->socid > 0)
}
$nowyear = strftime("%Y", dol_now());
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
$endyear = $year;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 4175509eb28..8ba4620b108 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -460,26 +460,15 @@ if (empty($reshook))
if (!$error)
{
$object_id = $object->create($user);
-
- // If some invoice's lines already known
- $NBLINES = 8;
- for ($i = 1; $i <= $NBLINES; $i++) {
- if ($_POST['idprod'.$i]) {
- $xid = 'idprod'.$i;
- $xqty = 'qty'.$i;
- $xremise = 'remise_percent'.$i;
- $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
- }
- }
}
}
// Insert default contacts if defined
if ($object_id > 0)
{
- if (GETPOST('contactid'))
+ if (GETPOST('contactid', 'int'))
{
- $result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
+ $result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external');
if ($result < 0) {
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
$error++;
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 4e7ed481882..d89559af113 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -38,11 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
-$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
+$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
-$object_status = GETPOST('object_status');
+$object_status = GETPOST('object_status', 'intcomma');
$typent_id = GETPOST('typent_id', 'int');
$categ_id = GETPOST('categ_id', 'categ_id');
@@ -308,11 +308,11 @@ if ($mode == 'customer')
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
);
- print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
+ print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
}
if ($mode == 'supplier')
{
- $formorder->selectSupplierOrderStatus((strstr($object_status, ',') ?-1 : $object_status), 0, 'object_status');
+ $formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
}
print ' ';
// Year
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 284186b73ce..49f9be88ac6 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -44,7 +44,7 @@ $mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden();
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden();
-$object_status = GETPOST('object_status');
+$object_status = GETPOST('object_status', 'intcomma');
$typent_id = GETPOST('typent_id', 'int');
$categ_id = GETPOST('categ_id', 'categ_id');
@@ -59,7 +59,7 @@ if ($user->socid > 0)
}
$nowyear = strftime("%Y", dol_now());
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
if(!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2;
else $startyear=$year-1;
$endyear = $year;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 24ec5645ffd..02a78b87c92 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4723,6 +4723,7 @@ function price2num($amount, $rounding = '', $option = 0)
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
if ($option != 1) { // If not a PHP number or unknown, we change or clean format
//print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).' ';
+ $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\-]/', '', $amount);
if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123
$amount = str_replace($thousand, '', $amount);
diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php
index 3b931bd4418..5a781942095 100644
--- a/htdocs/expensereport/stats/index.php
+++ b/htdocs/expensereport/stats/index.php
@@ -34,8 +34,8 @@ $langs->loadLangs(array('trips', 'companies'));
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
-$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
-$object_status = GETPOST('object_status');
+$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
+$object_status = GETPOST('object_status', 'intcomma');
$userid = GETPOST('userid', 'int');
$socid = GETPOST('socid', 'int'); if ($socid < 0) $socid = 0;
@@ -51,7 +51,7 @@ if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'expensereport', $id, '');
$nowyear = strftime("%Y", dol_now());
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
$endyear = $year;
@@ -231,7 +231,7 @@ print '';
// Status
print ''.$langs->trans("Status").' ';
$liststatus = $tmpexpensereport->statuts;
-print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4, 0, 0, '', 1);
+print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4, 0, 0, '', 1);
print ' ';
// Year
print '';
diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php
index 0ca948312c6..8e385ebb5d7 100644
--- a/htdocs/fichinter/stats/index.php
+++ b/htdocs/fichinter/stats/index.php
@@ -42,12 +42,12 @@ if ($user->socid > 0)
}
$nowyear = strftime("%Y", dol_now());
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
$endyear = $year;
-$object_status = GETPOST('object_status');
+$object_status = GETPOST('object_status', 'intcomma');
// Load translation files required by the page
$langs->loadLangs(array('interventions', 'companies', 'other', 'suppliers'));
diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php
index b39ba0fd366..e48c0147fad 100644
--- a/htdocs/ticket/stats/index.php
+++ b/htdocs/ticket/stats/index.php
@@ -32,7 +32,7 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
if (!$user->rights->ticket->read) accessforbidden();
-$object_status = GETPOST('object_status');
+$object_status = GETPOST('object_status', 'intcomma');
$userid = GETPOST('userid', 'int');
$socid = GETPOST('socid', 'int');
@@ -44,7 +44,7 @@ if ($user->socid > 0)
}
$nowyear = strftime("%Y", dol_now());
-$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
+$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
//$startyear=$year-2;
$startyear = $year - 1;
$endyear = $year;
@@ -241,7 +241,7 @@ print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0
// Status
print ' '.$langs->trans("Status").' ';
$liststatus = $object->fields['fk_statut']['arrayofkeyval'];
-print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4, 0, 0, '', 1);
+print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4, 0, 0, '', 1);
print ' ';
// Year
print ''.$langs->trans("Year").' ';
diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php
index a987f28c7ed..3d098131f21 100644
--- a/test/phpunit/FunctionsLibTest.php
+++ b/test/phpunit/FunctionsLibTest.php
@@ -1234,7 +1234,9 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
$newlangs->load("main");
$langs = $newlangs;
- $this->assertEquals(1000, price2num('1 000.0'));
+ $this->assertEquals(150, price2num('(SELECT/**/CASE/**/WHEN/**/(0<1)/**/THEN/**/SLEEP(5)/**/ELSE/**/SLEEP(0)/**/END)'));
+
+ $this->assertEquals(1000, price2num('1 000.0'));
$this->assertEquals(1000, price2num('1 000', 'MT'));
$this->assertEquals(1000, price2num('1 000', 'MU'));
@@ -1252,7 +1254,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase
// Text can't be converted
$this->assertEquals('12.4$', price2num('12.4$'));
- $this->assertEquals('12r.4$', price2num('12r.4$'));
+ $this->assertEquals('12.4$', price2num('12r.4$'));
// For spanish language
$newlangs2 = new Translate('', $conf);
From d45fe6c17f6c93333aa3caf47056f9d01bcdec07 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 20:39:11 +0100
Subject: [PATCH 89/91] FIx #15551
---
htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 3 +++
1 file changed, 3 insertions(+)
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index 994e5d89495..a7cb8a4729f 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -335,3 +335,6 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (72
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1);
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
+
+-- VMYSQL4.3 ALTER TABLE llx_mrp_mo MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
+
From 6a8ddacb33a49403a7b1dd9f6abe3e3362555623 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 21:01:57 +0100
Subject: [PATCH 90/91] Prepare database to allow to disconnect other session
after a password change
---
htdocs/install/mysql/tables/llx_user.sql | 2 +-
htdocs/user/class/user.class.php | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index e12b4e3c24e..8aa0d381e26 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -80,7 +80,7 @@ create table llx_user
model_pdf varchar(255) DEFAULT NULL,
datelastlogin datetime,
datepreviouslogin datetime,
- datelastpassvalidation datetime,
+ datelastpassvalidation datetime, -- last date we change password or we made a disconnect all
datestartvalidity datetime,
dateendvalidity datetime,
iplastlogin varchar(250),
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 41e1d55ea7c..7a40af26ac0 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -412,6 +412,7 @@ class User extends CommonObject
$sql .= " u.tms as datem,";
$sql .= " u.datelastlogin as datel,";
$sql .= " u.datepreviouslogin as datep,";
+ $sql .= " u.datelastpassvalidation,";
$sql .= " u.datestartvalidity,";
$sql .= " u.dateendvalidity,";
$sql .= " u.photo as photo,";
From 58eaef37d28c3f6fa1578d301a6e6c68434d7756 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Sun, 29 Nov 2020 21:29:22 +0100
Subject: [PATCH 91/91] Fix regression
---
htdocs/core/lib/functions.lib.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 02a78b87c92..2a9052d0916 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4723,7 +4723,9 @@ function price2num($amount, $rounding = '', $option = 0)
// Convert value to universal number format (no thousand separator, '.' as decimal separator)
if ($option != 1) { // If not a PHP number or unknown, we change or clean format
//print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).' ';
- $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\-]/', '', $amount);
+ if (!is_numeric($amount)) {
+ $amount = preg_replace('/[a-zA-Z\/\\\*\(\)\<\>\-]/', '', $amount);
+ }
if ($option == 2 && $thousand == '.' && preg_match('/\.(\d\d\d)$/', (string) $amount)) { // It means the . is used as a thousand separator and string come frominput data, so 1.123 is 1123
$amount = str_replace($thousand, '', $amount);