From 5e2d8eac2b13bbce11fbf4a9d4094cec5a369b87 Mon Sep 17 00:00:00 2001
From: Laurent De Coninck
Date: Mon, 20 Sep 2021 22:51:43 +0200
Subject: [PATCH 01/23] 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 02/23] 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 03/23] 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 2472dff67bd84284d36a121c4e5f832b19c51272 Mon Sep 17 00:00:00 2001
From: Indelog
Date: Tue, 28 Sep 2021 12:08:45 +0200
Subject: [PATCH 04/23] Fix FormFile::list_of_autoecmfiles object_instance
classname after hook
FormFile::list_of_autoecmfiles() can instantiate object with parameters
resulting of hook `addSectionECMAuto` but for do this,
it use `${$hookmanager->resArray['classname']}` which return a
`null`. Instead we should do this
`$hookmanager->resArray['classname']`.
---
htdocs/core/class/html.formfile.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 60054ecf5ad..71d8c02b5f2 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1672,7 +1672,7 @@ class FormFile
dol_include_once($hookmanager->resArray['classpath']);
if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
if (class_exists($hookmanager->resArray['classname'])) {
- $object_instance = new ${$hookmanager->resArray['classname']}($this->db);
+ $object_instance = new $hookmanager->resArray['classname']($this->db);
}
}
}
From 5b8b55cfba0e9459126fcffb6f2923b472cea8ba Mon Sep 17 00:00:00 2001
From: Indelog
Date: Tue, 28 Sep 2021 15:26:08 +0200
Subject: [PATCH 05/23] Fix append module suffix on src_object_type when create
ecm file
Files added to `llx_ecm_files` for externals modules never be removed on
object deletion.
When `CommonObject::deleteEcmFiles()` is called with `mode=1`, it use
this sql filter to find the file related to the object which is removed
:
```
$sql .= " WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".((int) $this->id).")";
```
We see it append `'@'.$this->module` to `$this->table_element` but when
file is add to the `llx_ecm_files` by
`CommonObject::commonGenerateDocument()` , it added whiteout the
`'@'.$this->module` suffix. So the file is never remove from
`llx_ecm_files` when object is deleted.
This fix it by appending module suffix on `src_object_type` if object
has `module` property when add document to the `llx_ecm_files`.
---
htdocs/core/class/commonobject.class.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d53b8829686..858d21d5e4d 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5297,7 +5297,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
- $ecmfile->src_object_type = $this->table_element;
+ $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
From fae0337b3e58cc160afdd2bc20343a6563af47c2 Mon Sep 17 00:00:00 2001
From: Indelog
Date: Tue, 28 Sep 2021 16:22:28 +0200
Subject: [PATCH 06/23] Fix show for external module in ecm index auto page
This set the correct `modulepart` parameter for link generated to
`document.php` of ecm auto index page if `src_object_type` for
ecm document has a module suffix (`@modulename`).
---
htdocs/core/class/html.formfile.class.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 60054ecf5ad..55460c587d8 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1811,9 +1811,11 @@ class FormFile
print '';
// File
+ // Check if document source has external module part, if it the case use it for module part on document.php
+ preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '
';
print '%s directory). Using this feature is not normally necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server.
PurgeDeleteLogFile=Delete log files, including %s defined for Syslog module (no risk of losing data)
PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago.
-PurgeDeleteTemporaryFilesShort=Delete log and temporary files
+PurgeDeleteTemporaryFilesShort=Delete log and temporary files (no risk of losing data)
PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory: %s. This will delete all generated documents related to elements (third parties, invoices etc...), files uploaded into the ECM module, database backup dumps and temporary files.
PurgeRunNow=Purge now
PurgeNothingToDelete=No directory or files to delete.
From fca39d91792ce0cb443704c84d8af3f9f71c0739 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Thu, 30 Sep 2021 01:15:36 +0200
Subject: [PATCH 17/23] css
---
htdocs/compta/index.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ca7cd08a6fe..9cb9bca667b 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -206,6 +206,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
print '