From 5e2d8eac2b13bbce11fbf4a9d4094cec5a369b87 Mon Sep 17 00:00:00 2001
From: Laurent De Coninck
Date: Mon, 20 Sep 2021 22:51:43 +0200
Subject: [PATCH 1/6] Allow to edit the header of receipt by using HTML
In the current version the WYSIWYG oesn't allow any HTML by thus fix you
can use any button from the wysiwyg and it displays on the receipe.
[see: X]
---
htdocs/takepos/admin/receipt.php | 4 ++--
htdocs/takepos/receipt.php | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php
index 01873d317c4..61fd71bdf29 100644
--- a/htdocs/takepos/admin/receipt.php
+++ b/htdocs/takepos/admin/receipt.php
@@ -42,8 +42,8 @@ if (GETPOST('action', 'alpha') == 'set')
{
$db->begin();
- $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
- $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'none'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'none'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php
index 6a305362839..a37c4a6c880 100644
--- a/htdocs/takepos/receipt.php
+++ b/htdocs/takepos/receipt.php
@@ -109,7 +109,7 @@ if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeTe
$substitutionarray = getCommonSubstitutionArray($langs);
if (!empty($conf->global->TAKEPOS_HEADER)) $newfreetext .= make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray);
if (!empty($conf->global->{$constFreeText})) $newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray);
- print $newfreetext;
+ print nl2br($newfreetext);
}
?>
From 70e66627fed60b611adda6d1fab22f4647580914 Mon Sep 17 00:00:00 2001
From: Laurent De Coninck
Date: Wed, 22 Sep 2021 20:14:47 +0200
Subject: [PATCH 2/6] restrict the html
---
htdocs/takepos/admin/receipt.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php
index 61fd71bdf29..3350da50104 100644
--- a/htdocs/takepos/admin/receipt.php
+++ b/htdocs/takepos/admin/receipt.php
@@ -42,8 +42,8 @@ if (GETPOST('action', 'alpha') == 'set')
{
$db->begin();
- $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'none'), 'chaine', 0, '', $conf->entity);
- $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'none'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
From 6abe6462e6c1dde1f9e1cba2ba2049e52723e512 Mon Sep 17 00:00:00 2001
From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com>
Date: Mon, 27 Sep 2021 14:33:57 +0200
Subject: [PATCH 3/6] FIX: products/services card: hidden extrafields were
overridden
---
htdocs/product/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index d74cab0ada4..542c66dee25 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -487,7 +487,7 @@ if (empty($reshook))
if ($accountancy_code_buy_export <= 0) { $object->accountancy_code_buy_export = ''; } else { $object->accountancy_code_buy_export = $accountancy_code_buy_export; }
// Fill array 'array_options' with data from add form
- $ret = $extrafields->setOptionalsFromPost(null, $object);
+ $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) $error++;
if (!$error && $object->check())
From 332fa77d902b87338c07904718dde58be55b3b07 Mon Sep 17 00:00:00 2001
From: Florian HENRY
Date: Thu, 30 Sep 2021 13:49:02 +0200
Subject: [PATCH 4/6] fix: search code on tva dict
---
htdocs/admin/dict.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 5542ad43b2a..5e5793cc361 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1048,6 +1048,7 @@ if ($id)
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
+ elseif ($search_code != '' && $id == 10) $sql .= natural_search("t.code", $search_code);
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
if ($sortfield)
From 620d7109b5b243237e6a53181edcc31f63cde198 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Thu, 30 Sep 2021 14:04:56 +0200
Subject: [PATCH 5/6] Update dict.php
---
htdocs/admin/dict.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 5e5793cc361..32db04c455f 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1048,7 +1048,7 @@ if ($id)
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
- elseif ($search_code != '' && $id == 10) $sql .= natural_search("t.code", $search_code);
+ elseif ($search_code != '' && $id == 10) $sql .= natural_search("t.code", $search_code);
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
if ($sortfield)
From fc4a16b356a6e720f80ebca24cbc9a74af577e6f Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Thu, 30 Sep 2021 16:18:07 +0200
Subject: [PATCH 6/6] Fix avoid error when trigger run on downgraded version.
---
.../triggers/interface_90_modSociete_ContactRoles.class.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
index e2759eb3926..15c84bc41a1 100644
--- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
+++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
@@ -79,7 +79,11 @@ class InterfaceContactRoles extends DolibarrTriggers
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contactdefault = new Contact($this->db);
$contactdefault->socid = $socid;
- $TContact = $contactdefault->getContactRoles($object->element);
+
+ $TContact = array();
+ if (method_exists($contactdefault, 'getContactRoles')) { // For backward compatibility
+ $TContact = $contactdefault->getContactRoles($object->element);
+ }
if (is_array($TContact) && !empty($TContact)) {
$TContactAlreadyLinked = array();