From 430e3cab2bc8baff83926ea89039d17328581603 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Aug 2023 14:07:36 +0200 Subject: [PATCH 1/4] Debug v18 --- htdocs/supplier_proposal/class/api_supplier_proposals.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 4588e1eba41..568d49116c8 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -73,7 +73,7 @@ class SupplierProposals extends DolibarrApi throw new RestException(404, 'Supplier Proposal not found'); } - if (!DolibarrApi::_checkAccessToResource('supplier_proposal', $this->propal->id)) { + if (!DolibarrApi::_checkAccessToResource('supplier_proposal', $this->supplier_proposal->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From d4b343b6910da1a47a323dc8ff7d3d02a968b159 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Aug 2023 15:22:55 +0200 Subject: [PATCH 2/4] Fix migration with bad default date on task_date --- htdocs/install/mysql/migration/17.0.0-18.0.0.sql | 6 ++++++ htdocs/install/mysql/migration/repair.sql | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 50a3f6fdfaf..e2f75349e18 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -106,6 +106,12 @@ ALTER TABLE llx_bordereau_cheque ADD COLUMN type VARCHAR(6) DEFAULT 'CHQ'; -- Element time ALTER TABLE llx_projet_task_time RENAME TO llx_element_time; + +-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; +-- VMYSQL4.1 update llx_element_time set task_date = NULL where DATE(STR_TO_DATE(task_date, '%Y-%m-%d')) IS NULL; +-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; +-- VMYSQL4.1 update llx_element_time set task_date = NULL where DATE(STR_TO_DATE(task_date, '%Y-%m-%d')) IS NULL; + ALTER TABLE llx_element_time CHANGE COLUMN fk_task fk_element integer NOT NULL; ALTER TABLE llx_element_time CHANGE COLUMN task_date element_date date; ALTER TABLE llx_element_time CHANGE COLUMN task_datehour element_datehour datetime; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index ee51a92a70f..d7fba7d6918 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -54,6 +54,10 @@ -- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; -- VMYSQL4.1 update llx_facture set date_pointoftax = NULL where DATE(STR_TO_DATE(date_pointoftax, '%Y-%m-%d')) IS NULL; +-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; +-- VMYSQL4.1 update llx_element_time set task_date = NULL where DATE(STR_TO_DATE(task_date, '%Y-%m-%d')) IS NULL; +-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE'; +-- VMYSQL4.1 update llx_element_time set task_date = NULL where DATE(STR_TO_DATE(task_date, '%Y-%m-%d')) IS NULL; -- Requests to clean corrupted data From a2548ac469448f481f31402b875a2f8428505dba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Aug 2023 16:58:11 +0200 Subject: [PATCH 3/4] Trans --- htdocs/core/tpl/filemanager.tpl.php | 2 +- htdocs/langs/en_US/ecm.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index f02f736de2a..403bd6bd01d 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -208,7 +208,7 @@ if ($action == 'confirmconvertimgwebp') { $param = ''; if (!empty($sortfield)) $param .= '&sortfield='.urlencode($sortfield); if (!empty($sortorder)) $param .= '&sortorder='.urlencode($sortorder); - print $form->formconfirm($_SERVER["PHP_SELF"].($param ? '?'.$param : ''), empty($file) ? $langs->trans('ConfirmImgWebpCreation') : $langs->trans('ConfirmChosenImgWebpCreation'), empty($file) ? $langs->trans('ConfirmGenerateImgWebp') : $langs->trans('ConfirmGenerateChosenImgWebp'), 'convertimgwebp', $formquestion, "yes", 1); + print $form->formconfirm($_SERVER["PHP_SELF"].($param ? '?'.$param : ''), empty($file) ? $langs->trans('ConfirmImgWebpCreation') : $langs->trans('ConfirmChosenImgWebpCreation'), empty($file) ? $langs->trans('ConfirmGenerateImgWebp') : $langs->trans('ConfirmGenerateChosenImgWebp', basename($file)), 'convertimgwebp', $formquestion, "yes", 1); $action = 'file_manager'; } diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 4ef0bb2f0b9..8edbef2108f 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -48,7 +48,7 @@ GenerateImgWebp=Duplicate all images with another version with .webp format ConfirmGenerateImgWebp=If you confirm, you will generate an image in .webp format for all images currently into this folder (subfolders are not included)... ConfirmImgWebpCreation=Confirm all images duplication GenerateChosenImgWebp=Duplicate chosen image with another version with .webp format -ConfirmGenerateChosenImgWebp=If you confirm, you will generate an image in .webp format for the image +ConfirmGenerateChosenImgWebp=If you confirm, you will generate an image in .webp format for the image %s ConfirmChosenImgWebpCreation=Confirm chosen images duplication SucessConvertImgWebp=Images successfully duplicated SucessConvertChosenImgWebp=Chosen image successfully duplicated From b470b54125d84b70c96a631ae6684f0432570be5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Aug 2023 18:34:36 +0200 Subject: [PATCH 4/4] Fix warning --- htdocs/compta/facture/class/facture-rec.class.php | 10 +--------- htdocs/compta/facture/class/facture.class.php | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index dc2181e8e46..4b641b65668 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -669,15 +669,6 @@ class FactureRec extends CommonInvoice $this->lines = array(); - // Retrieve all extrafield for line - // fetch optionals attributes and labels - /*if (!is_object($extrafields)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - } - $extrafields->fetch_name_optionals_label($this->table_element_line, true); - */ - dol_syslog('FactureRec::fetch_lines', LOG_DEBUG); $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, '; @@ -2098,6 +2089,7 @@ class FactureLigneRec extends CommonInvoiceLine public $fk_fournprice; // For backward compatibility public $rang; + //public $situation_percent; // Not supported on recurring invoice line public $desc; public $description; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4fade5c5b6f..3db6e8f56fa 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1082,7 +1082,7 @@ class Facture extends CommonInvoice $buyprice, $_facrec->lines[$i]->label, empty($_facrec->lines[$i]->array_options) ?null:$_facrec->lines[$i]->array_options, - $_facrec->lines[$i]->situation_percent, + 100, // situation percent is undefined on recurring invoice lines '', $_facrec->lines[$i]->fk_unit, $_facrec->lines[$i]->multicurrency_subprice,