From ccb9d62a145846b885fa1803e0f4f27530392083 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:13:46 +0200 Subject: [PATCH 01/66] Change comment to fixe a lot of undefined method --- .../core/modules/contract/doc/pdf_strato.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index a3c549c48a7..4df4ec431c3 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011 Fabrice CHERRIER - * Copyright (C) 2013-2019 Philippe Grand + * Copyright (C) 2013-2020 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Frédéric France * @@ -500,7 +500,7 @@ class pdf_strato extends ModelePDFContract /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -550,7 +550,7 @@ class pdf_strato extends ModelePDFContract /** * Show footer signature of page - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param int $tab_top tab height position * @param int $tab_height tab height * @param Translate $outputlangs Object language for output @@ -579,8 +579,8 @@ class pdf_strato extends ModelePDFContract /** * Show top header of page. * - * @param PDF $pdf Object PDF - * @param CommonObject $object Object to show + * @param TCPDF &$pdf Object PDF + * @param CommonObject $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @return void From 0b7528010466177b212f2f2afd539de473743c94 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:19:55 +0200 Subject: [PATCH 02/66] Change comment to fixe a lot of undefined method --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 2602caf8034..ddd08558b7a 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -671,7 +671,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid * @param int $posy Start Position @@ -772,7 +772,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -822,7 +822,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1065,7 +1065,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 83d1ff2a6cfaf6f1935a95eadfc32597cdfb5ced Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:25:17 +0200 Subject: [PATCH 03/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 5fbec0b2c68..c8035036307 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -438,7 +438,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -480,7 +480,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -509,7 +509,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output From 8bdf15a6a60c25e5a98e5fa4e0300a5642ab3a59 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:28:25 +0200 Subject: [PATCH 04/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index dc29b6411f5..48141b36b4d 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -662,7 +662,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -769,7 +769,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -857,7 +857,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output From 38f4e0392d44850b0fb4aac14f261c5e44df0bcd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:30:31 +0200 Subject: [PATCH 05/66] Change comment to fixe a lot of undefined method --- .../modules/expensereport/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 6d3bc5e8e65..6cdc7f4ffbc 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -642,7 +642,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -866,7 +866,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param int $tab_top Tab top * @param int $tab_height Tab height * @param int $nexY next y @@ -980,7 +980,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1092,7 +1092,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 0e0adcbe43dcb210c64a54ee5a0fc3c8b46ad8c9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:33:19 +0200 Subject: [PATCH 06/66] Change comment to fixe a lot of undefined method --- .../core/modules/facture/doc/pdf_crabe.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index cd2f711d23a..51f554295ec 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -780,7 +780,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -965,7 +965,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -1139,7 +1139,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart @@ -1464,7 +1464,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1586,7 +1586,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1889,7 +1889,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 857505a8873349ee681cd1d1020de3ab471c986b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:36:23 +0200 Subject: [PATCH 07/66] Change comment to fixe a lot of undefined method --- .../modules/facture/doc/pdf_sponge.modules.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 8695a46cae5..827e09081e7 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -917,7 +917,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1055,7 +1055,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param tcpdf $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -1225,7 +1225,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show total to pay * - * @param TCPDI $pdf Object PDF + * @param TCPDI $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart @@ -1760,7 +1760,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show table for lines * - * @param tcpdf $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1820,7 +1820,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show top header of page. * - * @param Tcpdf $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -2141,7 +2141,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -2157,8 +2157,8 @@ class pdf_sponge extends ModelePDFFactures /** * Define Array Column Field * - * @param object $object common object - * @param Translate $outputlangs langs + * @param object $object common object + * @param Translate $outputlangs langs * @param int $hidedetails Do not show line details * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref From c7bf47a00b74a4cf0984b0297bc64d181101d248 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:38:05 +0200 Subject: [PATCH 08/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 59bed960d1e..5d4ecff0983 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -472,7 +472,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -536,7 +536,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -709,7 +709,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 2c4d8bceb683ea6c081b98354160e6cde1fc3c8b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:39:54 +0200 Subject: [PATCH 09/66] Change comment to fixe a lot of undefined method --- .../core/modules/livraison/doc/pdf_typhon.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index b74f25d340a..891d5fce6fa 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Chiptronik - * Copyright (C) 2011-2019 Philippe Grand + * Copyright (C) 2011-2020 Philippe Grand * Copyright (C) 2015 Marcos García * This program is free software; you can redistribute it and/or modify @@ -627,7 +627,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -656,7 +656,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -722,7 +722,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -896,7 +896,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From ed6d83687c892203a403b6037f027f53ff2b5fe1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:44:44 +0200 Subject: [PATCH 10/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 6 +++--- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 7a1b0a0bfe4..c36444dc405 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -516,7 +516,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -567,7 +567,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -658,7 +658,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 334fc16ca18..a43e6e628cc 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -691,7 +691,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -742,7 +742,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -809,7 +809,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 703de5286f29335dc39846ce08e9bd3f5f7abe09 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:46:07 +0200 Subject: [PATCH 11/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/project/doc/pdf_timespent.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index a6bf7fdace7..77bc4758391 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -447,7 +447,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -498,7 +498,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -589,7 +589,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 8ff27f89e5c6dd8fc92947704bca46640e517982 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:48:25 +0200 Subject: [PATCH 12/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 279b5be2569..d97da48126e 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1023,7 +1023,7 @@ class pdf_azur extends ModelePDFPropales /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Propal $object Object propal * @param int $deja_regle Amount already paid * @param int $posy Start position @@ -1297,7 +1297,7 @@ class pdf_azur extends ModelePDFPropales /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1414,7 +1414,7 @@ class pdf_azur extends ModelePDFPropales /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1665,7 +1665,7 @@ class pdf_azur extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -1683,7 +1683,7 @@ class pdf_azur extends ModelePDFPropales /** * Show area for the customer to sign * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs From 3b80e9a08e922b0cb93b1431da1bf311e55531cc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:50:30 +0200 Subject: [PATCH 13/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 705294979dc..f804e236d25 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1145,7 +1145,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1432,7 +1432,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1486,7 +1486,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1737,7 +1737,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -1753,7 +1753,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show area for the customer to sign * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs From 9fd520b5d4cc2e18858dffbf97186d4551d6dca2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:52:11 +0200 Subject: [PATCH 14/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index b5fe6c53c36..dd3d62fca03 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -573,7 +573,7 @@ class pdf_squille extends ModelePdfReception /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -675,7 +675,7 @@ class pdf_squille extends ModelePdfReception /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -757,7 +757,7 @@ class pdf_squille extends ModelePdfReception /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1003,7 +1003,7 @@ class pdf_squille extends ModelePdfReception /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From d446a38b34b8b4ac33bef9106e2c030e129c59c6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:54:19 +0200 Subject: [PATCH 15/66] Change comment to fixe a lot of undefined method --- .../supplier_invoice/doc/pdf_canelle.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 11ff7780002..974f3e186c3 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -617,7 +617,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart @@ -843,7 +843,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -949,7 +949,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1040,7 +1040,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1252,7 +1252,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param FactureFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 1ea21ee1b850c175c9b05b1a52eca6445a676162 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:56:48 +0200 Subject: [PATCH 16/66] Change comment to fixe a lot of undefined method --- .../supplier_order/doc/pdf_cornas.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 1fdb8b09aef..10acc9d27e2 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -808,7 +808,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -824,7 +824,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -890,7 +890,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1103,7 +1103,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1176,7 +1176,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1416,7 +1416,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param CommandeFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 3a2e5274545558c971c0492660005d4cff19f3fd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 09:58:47 +0200 Subject: [PATCH 17/66] Change comment to fixe a lot of undefined method --- .../supplier_order/doc/pdf_muscadet.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 5dd240fb544..a2907d8b5cf 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -693,7 +693,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -709,7 +709,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -775,7 +775,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -988,7 +988,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1094,7 +1094,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1333,7 +1333,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param CommandeFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 6fa3e8df4e6bf6a0cf909b2af6a79c2765b8b049 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 10:00:20 +0200 Subject: [PATCH 18/66] Change comment to fixe a lot of undefined method --- .../modules/supplier_payment/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index a4f9bc93823..db6ce567305 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -508,7 +508,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param PaiementFourn $object Object PaiementFourn * @param int $posy Position depart * @param Translate $outputlangs Objet langs @@ -567,7 +567,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param integer $tab_top Top position of table * @param integer $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -612,7 +612,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -788,7 +788,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param FactureFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From d6c84ef5ce5aca5acc41aef504720cb9c41fd4a9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 10:02:25 +0200 Subject: [PATCH 19/66] Change comment to fixe a lot of undefined method --- .../supplier_proposal/doc/pdf_aurore.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 608b3fbd392..4a0dc601fbf 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -691,7 +691,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show payments table * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object proposal * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -707,7 +707,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -874,7 +874,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show total to pay * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1145,7 +1145,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1251,7 +1251,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1463,7 +1463,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 0d6274c8fe6b9b46fdd5255d998926d20cfc31a6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 10:04:54 +0200 Subject: [PATCH 20/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 3aa46add2ac..05bb4636e53 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -292,7 +292,7 @@ class pdf_ban extends ModeleBankAccountDoc /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -377,7 +377,7 @@ class pdf_ban extends ModeleBankAccountDoc /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 85b2adaaec3e5f07e4cdd9381acc82680ed5c897 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 10:13:18 +0200 Subject: [PATCH 21/66] Change comment to fixe a lot of undefined method --- .../core/modules/bank/doc/pdf_sepamandate.modules.php | 10 +++++----- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index e50acfb6c2a..5aa63711ba0 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -424,7 +424,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show table for lines * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -447,7 +447,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -485,7 +485,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show area for the customer to sign * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs @@ -527,7 +527,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show top header of page. * - * @param PDF $pdf Object PDF + * @param TCPDF &$pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -617,7 +617,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index ec6f52dfec7..30b0ea62b46 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -213,7 +213,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Generate Header * - * @param PDF $pdf Pdf object + * @param TCPDF &$pdf Pdf object * @param int $page Current page number * @param int $pages Total number of pages * @param Translate $outputlangs Object language for output @@ -321,7 +321,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Output array * - * @param PDF $pdf PDF object + * @param TCPDF &$pdf PDF object * @param int $pagenb Page nb * @param int $pages Pages * @param Translate $outputlangs Object lang @@ -390,7 +390,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Show footer of page. Need this->emetteur object * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -404,6 +404,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $showdetails = $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; // Line of free text + $substitutionarray = pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); $newfreetext = ''; $paramfreetext = 'BANK_CHEQUERECEIPT_FREE_TEXT'; if (!empty($conf->global->$paramfreetext)) From 42fcb64700336b1235578cedf55fa472a63d8ae5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 3 Aug 2020 10:26:01 +0200 Subject: [PATCH 22/66] Change comment to fixe a lot of undefined method --- htdocs/core/modules/member/doc/pdf_standard.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index dd4b15d6135..9ba2956857a 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -37,7 +37,7 @@ class pdf_standard extends CommonStickerGenerator /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - * @param PDF $pdf PDF reference + * @param TCPDF &$pdf PDF reference * @param Translate $outputlangs Output langs * @param array $param Associative array containing label content and optional parameters * @return void @@ -53,7 +53,7 @@ class pdf_standard extends CommonStickerGenerator * - __LOGO__ is replace with company logo * - __PHOTO__ is replace with photo provided as parameter * - * @param PDF $pdf PDF + * @param TCPDF &$pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer From e4faa0228e0c69410574eead49e354bf684b73f6 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:40:42 +0200 Subject: [PATCH 23/66] Update pdf_strato.modules.php --- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 4df4ec431c3..7ffd79414d0 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -500,7 +500,7 @@ class pdf_strato extends ModelePDFContract /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -550,7 +550,7 @@ class pdf_strato extends ModelePDFContract /** * Show footer signature of page - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param int $tab_top tab height position * @param int $tab_height tab height * @param Translate $outputlangs Object language for output @@ -579,7 +579,7 @@ class pdf_strato extends ModelePDFContract /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommonObject $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output From 6874feb09a617d43e3082fb10f738c953713bb12 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:42:14 +0200 Subject: [PATCH 24/66] Update pdf_ban.modules.php --- htdocs/core/modules/bank/doc/pdf_ban.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 05bb4636e53..51dea857f61 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -292,7 +292,7 @@ class pdf_ban extends ModeleBankAccountDoc /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -377,7 +377,7 @@ class pdf_ban extends ModeleBankAccountDoc /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 2627bec686d2bc3d3bfe0b945320d4b51f863cdb Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:43:28 +0200 Subject: [PATCH 25/66] Update pdf_sepamandate.modules.php --- .../core/modules/bank/doc/pdf_sepamandate.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 5aa63711ba0..464e2dffb36 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -424,7 +424,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -447,7 +447,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -485,7 +485,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show area for the customer to sign * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs @@ -527,7 +527,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -617,7 +617,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 3fcacf7196be429751ac2f5cdaf1a6e0741998fc Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:44:25 +0200 Subject: [PATCH 26/66] Update pdf_blochet.class.php --- htdocs/core/modules/cheque/doc/pdf_blochet.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 30b0ea62b46..3850b0ef4ba 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -213,7 +213,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Generate Header * - * @param TCPDF &$pdf Pdf object + * @param TCPDF $pdf Pdf object * @param int $page Current page number * @param int $pages Total number of pages * @param Translate $outputlangs Object language for output @@ -321,7 +321,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Output array * - * @param TCPDF &$pdf PDF object + * @param TCPDF $pdf PDF object * @param int $pagenb Page nb * @param int $pages Pages * @param Translate $outputlangs Object lang @@ -390,7 +390,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From f94d4413a99f0169b2bf3b581db7cd0621914886 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:45:52 +0200 Subject: [PATCH 27/66] Update pdf_espadon.modules.php --- .../core/modules/expedition/doc/pdf_espadon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index ddd08558b7a..c4813d9dfb3 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -671,7 +671,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid * @param int $posy Start Position @@ -772,7 +772,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -822,7 +822,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1065,7 +1065,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 19fb6e827e50c665ee6516300586c52cbcfb69a9 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:47:00 +0200 Subject: [PATCH 28/66] Update pdf_merou.modules.php --- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index c8035036307..bf54298d264 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -438,7 +438,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -480,7 +480,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -509,7 +509,7 @@ class pdf_merou extends ModelePdfExpedition /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output From 001662af3d08a4e60d758ae1c6a852841ad0f493 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:49:47 +0200 Subject: [PATCH 29/66] Update pdf_rouget.modules.php --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 48141b36b4d..a188ae4c0dc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -662,7 +662,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -769,7 +769,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -857,7 +857,7 @@ class pdf_rouget extends ModelePdfExpedition /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output From 85879a0baa71f8100f06c3ede53a0dee6d78ed1a Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:51:35 +0200 Subject: [PATCH 30/66] Update pdf_standard.modules.php --- .../modules/expensereport/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 6cdc7f4ffbc..87001fc9fdc 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -642,7 +642,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -866,7 +866,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param int $tab_top Tab top * @param int $tab_height Tab height * @param int $nexY next y @@ -980,7 +980,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1092,7 +1092,7 @@ class pdf_standard extends ModeleExpenseReport /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From d97a9c9b0d5669dcb154db3cdde731bb9f981b0b Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:53:20 +0200 Subject: [PATCH 31/66] Update pdf_crabe.modules.php --- .../core/modules/facture/doc/pdf_crabe.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 51f554295ec..96cdf62a53b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -780,7 +780,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -965,7 +965,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -1139,7 +1139,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart @@ -1464,7 +1464,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1586,7 +1586,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1889,7 +1889,7 @@ class pdf_crabe extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 51cbbcd3b86c8fade728cb68755cd07f5d733216 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:55:14 +0200 Subject: [PATCH 32/66] Update pdf_sponge.modules.php --- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 827e09081e7..8bc0afe3023 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -917,7 +917,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1055,7 +1055,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -1760,7 +1760,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1820,7 +1820,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -2141,7 +2141,7 @@ class pdf_sponge extends ModelePDFFactures /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From ea72d5dc828368a0b49239d8bef5f5ea3ca45de0 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:56:17 +0200 Subject: [PATCH 33/66] Update pdf_soleil.modules.php --- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 5d4ecff0983..47abbc3640a 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -472,7 +472,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -536,7 +536,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -709,7 +709,7 @@ class pdf_soleil extends ModelePDFFicheinter /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 6937efa3bab455eb3f4fb363959f8cd4d8a6aab9 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:57:25 +0200 Subject: [PATCH 34/66] Update pdf_typhon.modules.php --- htdocs/core/modules/livraison/doc/pdf_typhon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 891d5fce6fa..3d3e2a1d26e 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -627,7 +627,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -656,7 +656,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -722,7 +722,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -896,7 +896,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From e8f92fe5bc7edeb7d6d36ffdf44a19e69b10e3af Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 15:59:23 +0200 Subject: [PATCH 35/66] Update pdf_standard.class.php --- htdocs/core/modules/member/doc/pdf_standard.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 9ba2956857a..0051862d52e 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -37,7 +37,7 @@ class pdf_standard extends CommonStickerGenerator /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - * @param TCPDF &$pdf PDF reference + * @param TCPDF $pdf PDF reference * @param Translate $outputlangs Output langs * @param array $param Associative array containing label content and optional parameters * @return void @@ -53,7 +53,7 @@ class pdf_standard extends CommonStickerGenerator * - __LOGO__ is replace with company logo * - __PHOTO__ is replace with photo provided as parameter * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param string $textleft Text left * @param string $header Header * @param string $footer Footer From d781a7cf62779da44c4a30b94b09a2dc3e2d38af Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:00:12 +0200 Subject: [PATCH 36/66] Update pdf_espadon.modules.php --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index c4813d9dfb3..95f8e1ac7b1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -671,7 +671,7 @@ class pdf_espadon extends ModelePdfExpedition /** * Show total to pay * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Amount already paid * @param int $posy Start Position From 81b484ecc8aa3354526fa94a354577935973fae3 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:01:28 +0200 Subject: [PATCH 37/66] Update pdf_baleine.modules.php --- htdocs/core/modules/project/doc/pdf_baleine.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index c36444dc405..597e4ae3186 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -516,7 +516,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -567,7 +567,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -658,7 +658,7 @@ class pdf_baleine extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From d9c260c7f1a2427444a6d9efedc91fed36b772ea Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:02:19 +0200 Subject: [PATCH 38/66] Update pdf_beluga.modules.php --- htdocs/core/modules/project/doc/pdf_beluga.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index a43e6e628cc..91e33e12002 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -691,7 +691,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -742,7 +742,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -809,7 +809,7 @@ class pdf_beluga extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 54878e2916741ed3e61f2a5f6de7858921743677 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:03:28 +0200 Subject: [PATCH 39/66] Update pdf_timespent.modules.php --- htdocs/core/modules/project/doc/pdf_timespent.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 77bc4758391..f56d901568a 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -447,7 +447,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -498,7 +498,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Project $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -589,7 +589,7 @@ class pdf_timespent extends ModelePDFProjects /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Project $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From f4a4444c794987f1499e01c082498bd9887226da Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:04:54 +0200 Subject: [PATCH 40/66] Update pdf_azur.modules.php --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d97da48126e..2915304a496 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1023,7 +1023,7 @@ class pdf_azur extends ModelePDFPropales /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Propal $object Object propal * @param int $deja_regle Amount already paid * @param int $posy Start position @@ -1297,7 +1297,7 @@ class pdf_azur extends ModelePDFPropales /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1414,7 +1414,7 @@ class pdf_azur extends ModelePDFPropales /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1665,7 +1665,7 @@ class pdf_azur extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text @@ -1683,7 +1683,7 @@ class pdf_azur extends ModelePDFPropales /** * Show area for the customer to sign * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs From 4d1743ffcfd7c891fef8da753c57510e81598e7a Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:06:01 +0200 Subject: [PATCH 41/66] Update pdf_cyan.modules.php --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f804e236d25..cdb084aa861 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1145,7 +1145,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1432,7 +1432,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1486,7 +1486,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1737,7 +1737,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 49c99cfa70a63b8fd55c7c80ef984dfe307428db Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:07:21 +0200 Subject: [PATCH 42/66] Update pdf_squille.modules.php --- htdocs/core/modules/reception/doc/pdf_squille.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index dd3d62fca03..7e931c4b1cf 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -573,7 +573,7 @@ class pdf_squille extends ModelePdfReception /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -675,7 +675,7 @@ class pdf_squille extends ModelePdfReception /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y @@ -757,7 +757,7 @@ class pdf_squille extends ModelePdfReception /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1003,7 +1003,7 @@ class pdf_squille extends ModelePdfReception /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 62c49b2ce3977e06d4bb82f01fbf3daa282727e7 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:08:43 +0200 Subject: [PATCH 43/66] Update pdf_canelle.modules.php --- .../supplier_invoice/doc/pdf_canelle.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 974f3e186c3..fdf4e2a827a 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -617,7 +617,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart @@ -843,7 +843,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -949,7 +949,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -1040,7 +1040,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1252,7 +1252,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param FactureFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 79be00f0aa07bdecaf038ca83b0e358025e7970d Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:10:06 +0200 Subject: [PATCH 44/66] Update pdf_cornas.modules.php --- .../supplier_order/doc/pdf_cornas.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 10acc9d27e2..88438a6555d 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -808,7 +808,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -824,7 +824,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -890,7 +890,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1103,7 +1103,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1176,7 +1176,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1416,7 +1416,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param CommandeFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From c6b4c4392c0481ee7f77bc9e54782c6d3c3cc1cf Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:11:25 +0200 Subject: [PATCH 45/66] Update pdf_muscadet.modules.php --- .../supplier_order/doc/pdf_muscadet.modules.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index a2907d8b5cf..aa6238f84a8 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -693,7 +693,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object order * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -709,7 +709,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -775,7 +775,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -988,7 +988,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1094,7 +1094,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param CommandeFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1333,7 +1333,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param CommandeFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From 6a24aed42aebc11e6a0f024ea0ef4d17516975d1 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:12:21 +0200 Subject: [PATCH 46/66] Update pdf_standard.modules.php --- .../modules/supplier_payment/doc/pdf_standard.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index db6ce567305..d2e2327dd10 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -508,7 +508,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param PaiementFourn $object Object PaiementFourn * @param int $posy Position depart * @param Translate $outputlangs Objet langs @@ -567,7 +567,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param integer $tab_top Top position of table * @param integer $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -612,7 +612,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -788,7 +788,7 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param FactureFournisseur $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From bc8651802014f3fac1c6b4732e817031b05dbf09 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 4 Aug 2020 16:13:35 +0200 Subject: [PATCH 47/66] Update pdf_aurore.modules.php --- .../supplier_proposal/doc/pdf_aurore.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 4a0dc601fbf..e503f3cee56 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -691,7 +691,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show payments table * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object proposal * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output @@ -874,7 +874,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show total to pay * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart @@ -1145,7 +1145,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show table for lines * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param string $tab_top Top position of table * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) @@ -1251,7 +1251,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show top header of page. * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output @@ -1463,7 +1463,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show footer of page. Need this->emetteur object * - * @param TCPDF &$pdf PDF + * @param TCPDF $pdf PDF * @param Object $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text From ea829913b0f3b490d599cd2bf33e1e0981b881ca Mon Sep 17 00:00:00 2001 From: asolslk <52134143+asolslk@users.noreply.github.com> Date: Sat, 8 Aug 2020 19:07:55 +0800 Subject: [PATCH 48/66] Update accounting.lib.php --- htdocs/core/lib/accounting.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 317c639ad91..24ba8ced2e4 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -96,7 +96,7 @@ function length_accountg($account) if ($account < 0 || is_empty($account)) return ''; - if (!is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; + if (is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $account; $g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT; if (!is_empty($g)) { @@ -131,7 +131,7 @@ function length_accounta($accounta) if ($accounta < 0 || is_empty($accounta)) return ''; - if (!is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta; + if (is_empty($conf->global->ACCOUNTING_MANAGE_ZERO)) return $accounta; $a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT; if (!is_empty($a)) { From f35893ceb4f465a474cb4e0b00d7182c35dcefbd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 8 Aug 2020 15:12:29 +0200 Subject: [PATCH 49/66] fix deprecated --- .../doc/pdf_muscadet.modules.php | 58 +++++++++---------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index aa6238f84a8..206935e7323 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -717,13 +717,12 @@ class pdf_muscadet extends ModelePDFSuppliersOrders */ protected function _tableau_info(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable - global $conf, $mysoc; - $default_font_size = pdf_getPDFFontSize($outputlangs); + // phpcs:enable + global $conf, $mysoc; + $default_font_size = pdf_getPDFFontSize($outputlangs); - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) - { + // If France, show VAT mention if not applicable + if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); @@ -733,39 +732,36 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $posxval = 52; - // Show payments conditions - if (!empty($object->cond_reglement_code) || $object->cond_reglement) - { - $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + // Show payments conditions + if (!empty($object->cond_reglement_code) || $object->cond_reglement_id) { + $pdf->SetFont('', 'B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentConditions") . ':'; + $pdf->MultiCell(80, 4, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) != ('PaymentCondition' . $object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition" . $object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_id); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); - $posy = $pdf->GetY() + 3; - } + $posy = $pdf->GetY() + 3; + } - // Show payment mode - if (!empty($object->mode_reglement_code)) - { - $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentMode").':'; - $pdf->MultiCell(80, 5, $titre, 0, 'L'); + // Show payment mode + if (!empty($object->mode_reglement_code)) { + $pdf->SetFont('', 'B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentMode") . ':'; + $pdf->MultiCell(80, 5, $titre, 0, 'L'); - $pdf->SetFont('', '', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); - $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); - - $posy = $pdf->GetY() + 2; - } + $pdf->SetFont('', '', $default_font_size - 2); + $pdf->SetXY($posxval, $posy); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) != ('PaymentType' . $object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType" . $object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); + $posy = $pdf->GetY() + 2; + } return $posy; } @@ -1174,7 +1170,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($posx, $posy); $langs->load("projects"); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : ".(empty($object->project->ref) ? '' : $object->projet->ref), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : ".(empty($object->project->ref) ? '' : $object->project->ref), '', 'R'); } } From fe24c2f8b8da65c2e83e6061d2945bc14a28dea0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 8 Aug 2020 15:29:53 +0200 Subject: [PATCH 50/66] fix undefined variable --- .../supplier_proposal/doc/pdf_aurore.modules.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e503f3cee56..e44be9f1bb3 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -707,7 +707,7 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * Show miscellaneous information (payment mode, payment term, ...) * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Object $object Object to show * @param int $posy Y * @param Translate $outputlangs Langs object @@ -746,7 +746,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); //$dlp=dol_print_date($object->date_livraison,"daytext",false,$outputlangs,true); - $pdf->MultiCell(80, 4, $dlp, 0, 'L'); + $pdf->MultiCell(80, 4, '', 0, 'L'); $posy = $pdf->GetY() + 1; } @@ -1093,13 +1093,10 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetTextColor(0, 0, 0); - /* $resteapayer = $object->total_ttc - $deja_regle; - if (! empty($object->paye)) $resteapayer=0; - */ + if (!empty($object->paye)) $resteapayer = 0; - if ($deja_regle > 0) - { + if ($deja_regle > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); From e7bea7c5ce8b629a7c3547bb015f381fd1d49535 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Sat, 8 Aug 2020 15:34:38 +0200 Subject: [PATCH 51/66] Update pdf_cyan.modules.php --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index cdb084aa861..e023465d8e3 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1753,7 +1753,7 @@ class pdf_cyan extends ModelePDFPropales /** * Show area for the customer to sign * - * @param TCPDF &$pdf Object PDF + * @param TCPDF $pdf Object PDF * @param Facture $object Object invoice * @param int $posy Position depart * @param Translate $outputlangs Objet langs From bb16564b982636ae5e54ddcf579702441661804b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:08:46 +0200 Subject: [PATCH 52/66] NEW triggers create, modify, delete Also modified deleteByFkAttribute() to use the function delete() --- .../class/ProductAttributeValue.class.php | 99 ++++++++++++++----- 1 file changed, 75 insertions(+), 24 deletions(-) diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index 0a26b3eace2..2c48a6ce7ce 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -16,17 +16,18 @@ * along with this program. If not, see . */ +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; /** * Class ProductAttributeValue * Used to represent a product attribute value */ -class ProductAttributeValue +class ProductAttributeValue extends CommonObject { /** * Database handler * @var DoliDB */ - private $db; + public $db; /** * Attribute value id @@ -144,14 +145,24 @@ class ProductAttributeValue /** * Creates a value for a product attribute * - * @param User $user Object user - * @return int <0 KO >0 OK + * @param User $user Object user + * @param int $notrigger Do not execute trigger + * @return int <0 KO >0 OK */ - public function create(User $user) + public function create(User $user, $notrigger = 0) { if (!$this->fk_product_attribute) { return -1; } + + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_CREATE', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } // Ref must be uppercase $this->ref = strtoupper($this->ref); @@ -173,11 +184,21 @@ class ProductAttributeValue /** * Updates a product attribute value * - * @param User $user Object user - * @return int <0 if KO, >0 if OK + * @param User $user Object user + * @param int $notrigger Do not execute trigger + * @return int <0 if KO, >0 if OK */ - public function update(User $user) + public function update(User $user, $notrigger = 0) { + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_MODIFY', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + //Ref must be uppercase $this->ref = trim(strtoupper($this->ref)); $this->value = trim($this->value); @@ -196,33 +217,63 @@ class ProductAttributeValue /** * Deletes a product attribute value * + * @param User $user Object user + * @param int $notrigger Do not execute trigger * @return int <0 KO, >0 OK */ - public function delete() + public function delete(User $user, $notrigger = 0) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE rowid = ".(int) $this->id; - - if ($this->db->query($sql)) { - return 1; - } - - return -1; + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_DELETE', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE rowid = ".(int) $this->id; + + if ($this->db->query($sql)) { + return 1; + } + + return -1; } /** * Deletes all product attribute values by a product attribute id * * @param int $fk_attribute Product attribute id + * @param int $notrigger Do not execute trigger * @return int <0 KO, >0 OK */ - public function deleteByFkAttribute($fk_attribute) + public function deleteByFkAttribute($fk_attribute, User $user) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE fk_product_attribute = ".(int) $fk_attribute; - - if ($this->db->query($sql)) { - return 1; - } - - return -1; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE fk_product_attribute = ".(int) $fk_attribute; + + $query = $this->db->query($sql); + + if (!$query) { + return -1; + } + + if (!$this->db->num_rows($query)) { + return 1; + } + + while ($obj = $this->db->fetch_object($query)) { + $tmp = new ProductAttributeValue($this->db); + if ($tmp->fetch($obj->rowid) > 0) { + $result = $tmp->delete($user); + if ($result < 0) { + return -1; + } + } else { + return -1; + } + } + + return 1; } } From e73a7c78f768c64ec0d46bfcae86349e96ab07f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:10:50 +0200 Subject: [PATCH 53/66] NEW triggers create, modify, delete --- .../variants/class/ProductAttribute.class.php | 52 +++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 36b4823b51b..6d9fadf0101 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -16,17 +16,18 @@ * along with this program. If not, see . */ +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; /** * Class ProductAttribute * Used to represent a product attribute */ -class ProductAttribute +class ProductAttribute extends CommonObject { /** * Database handler * @var DoliDB */ - private $db; + public $db; /** * Id of the product attribute @@ -119,7 +120,8 @@ class ProductAttribute $return[] = $tmp; } - } else dol_print_error($this->db); + } + else dol_print_error($this->db); return $return; } @@ -127,11 +129,21 @@ class ProductAttribute /** * Creates a product attribute * - * @param User $user Object user that create + * @param User $user Object user + * @param int $notrigger Do not execute trigger * @return int <0 KO, Id of new variant if OK */ - public function create(User $user) + public function create(User $user, $notrigger = 0) { + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_CREATE', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + //Ref must be uppercase $this->ref = strtoupper($this->ref); @@ -152,11 +164,21 @@ class ProductAttribute /** * Updates a product attribute * - * @param User $user Object user + * @param User $user Object user + * @param int $notrigger Do not execute trigger * @return int <0 KO, >0 OK */ - public function update(User $user) + public function update(User $user, $notrigger = 0) { + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_MODIFY', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + //Ref must be uppercase $this->ref = trim(strtoupper($this->ref)); $this->label = trim($this->label); @@ -173,11 +195,21 @@ class ProductAttribute /** * Deletes a product attribute * - * @param User $user Object user - * @return int <0 KO, >0 OK + * @param User $user Object user + * @param int $notrigger Do not execute trigger + * @return int <0 KO, >0 OK */ - public function delete($user = null) + public function delete(User $user, $notrigger = 0) { + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_DELETE', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute WHERE rowid = ".(int) $this->id; if ($this->db->query($sql)) { From ef57bb7e842d804c66052eca42388f9498d8a25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:14:53 +0200 Subject: [PATCH 54/66] pass $user to delete functions --- htdocs/variants/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 0669964ba57..6d077e85ad1 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -90,9 +90,9 @@ if ($confirm == 'yes') { if ($action == 'confirm_delete') { $db->begin(); - $res = $objectval->deleteByFkAttribute($object->id); + $res = $objectval->deleteByFkAttribute($object->id, $user); - if ($res < 1 || ($object->delete() < 1)) { + if ($res < 1 || ($object->delete($user) < 1)) { $db->rollback(); setEventMessages($langs->trans('CoreErrorMessage'), $object->errors, 'errors'); header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); @@ -105,7 +105,7 @@ if ($confirm == 'yes') { } elseif ($action == 'confirm_deletevalue') { if ($objectval->fetch($valueid) > 0) { - if ($objectval->delete() < 1) { + if ($objectval->delete($user) < 1) { setEventMessages($langs->trans('CoreErrorMessage'), $objectval->errors, 'errors'); } else { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); From ed1a2cd917e8c9722889fabd7f3c0483344d7031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:45:51 +0200 Subject: [PATCH 55/66] Update 1 --- .../class/ProductAttributeValue.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index 2c48a6ce7ce..c655e188c5d 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -154,27 +154,28 @@ class ProductAttributeValue extends CommonObject if (!$this->fk_product_attribute) { return -1; } - - if (empty($notrigger)) { - // Call trigger - $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_CREATE', $user); - if ($result < 0) { - return -1; - } - // End call triggers - } // Ref must be uppercase $this->ref = strtoupper($this->ref); + $this->value = $this->db->escape($this->value); $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_attribute_value (fk_product_attribute, ref, value, entity) VALUES ('".(int) $this->fk_product_attribute."', '".$this->db->escape($this->ref)."', - '".$this->db->escape($this->value)."', ".(int) $this->entity.")"; + '".$this->value."', ".(int) $this->entity.")"; $query = $this->db->query($sql); if ($query) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'product_attribute_value'); + if (empty($notrigger)) { + // Call trigger + $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_CREATE', $user); + if ($result < 0) { + return -1; + } + // End call triggers + } + return 1; } @@ -223,6 +224,7 @@ class ProductAttributeValue extends CommonObject */ public function delete(User $user, $notrigger = 0) { + if (empty($notrigger)) { // Call trigger $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_DELETE', $user); @@ -231,9 +233,7 @@ class ProductAttributeValue extends CommonObject } // End call triggers } - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE rowid = ".(int) $this->id; - if ($this->db->query($sql)) { return 1; } From 9b00a1f61a873438eab5e91c3587fdc85e6c6e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 22:48:21 +0200 Subject: [PATCH 56/66] Some updates for attributes triggers --- htdocs/product/class/api_products.class.php | 630 ++++++++++---------- 1 file changed, 322 insertions(+), 308 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 89c9a78ddaa..a63709b5c4b 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -41,17 +41,17 @@ class Products extends DolibarrApi 'ref', 'label' ); - + /** * @var Product $product {@type Product} */ public $product; - + /** * @var ProductFournisseur $productsupplier {@type ProductFournisseur} */ public $productsupplier; - + /** * Constructor */ @@ -62,7 +62,7 @@ class Products extends DolibarrApi $this->product = new Product($this->db); $this->productsupplier = new ProductFournisseur($this->db); } - + /** * Get properties of a product object by id * @@ -81,7 +81,7 @@ class Products extends DolibarrApi { return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by ref * @@ -103,7 +103,7 @@ class Products extends DolibarrApi { return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by ref_ext * @@ -125,7 +125,7 @@ class Products extends DolibarrApi { return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by barcode * @@ -147,7 +147,7 @@ class Products extends DolibarrApi { return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts); } - + /** * List products * @@ -165,11 +165,11 @@ class Products extends DolibarrApi public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '') { global $db, $conf; - + $obj_ret = array(); - + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; - + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; $sql .= " FROM ".MAIN_DB_PREFIX."product as t"; if ($category > 0) { @@ -196,17 +196,17 @@ class Products extends DolibarrApi $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql .= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { $page = 0; } $offset = $limit * $page; - + $sql .= $db->plimit($limit + 1, $offset); } - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -229,7 +229,7 @@ class Products extends DolibarrApi } return $obj_ret; } - + /** * Create product object * @@ -243,17 +243,17 @@ class Products extends DolibarrApi } // Check mandatory fields $result = $this->_validate($request_data); - + foreach ($request_data as $field => $value) { $this->product->$field = $value; } if ($this->product->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating product", array_merge(array($this->product->error), $this->product->errors)); } - + return $this->product->id; } - + /** * Update product. * Price will be updated by this API only if option is set on "One price per product". See other APIs for other price modes. @@ -268,38 +268,38 @@ class Products extends DolibarrApi public function put($id, $request_data = null) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $oldproduct = dol_clone($this->product, 0); - + foreach ($request_data as $field => $value) { if ($field == 'id') { continue; } - if ($field == 'stock_reel') { - throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead'); + if ($field == 'stock_reel') { + throw new RestException(400, 'Stock reel cannot be updated here. Use the /stockmovements endpoint instead'); } $this->product->$field = $value; } - + $updatetype = false; if ($this->product->type != $oldproduct->type && ($this->product->isProduct() || $this->product->isService())) { $updatetype = true; } - + $result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update', $updatetype); - + // If price mode is 1 price per product if ($result > 0 && !empty($conf->global->PRODUCT_PRICE_UNIQ)) { // We update price only if it was changed @@ -312,7 +312,7 @@ class Products extends DolibarrApi } if ($this->product->default_vat_code != $oldproduct->default_vat_code) { $pricemodified = true; } - + if ($this->product->price_base_type == 'TTC') { if ($this->product->price_ttc != $oldproduct->price_ttc) { $pricemodified = true; } @@ -325,30 +325,30 @@ class Products extends DolibarrApi } } } - + if ($pricemodified) { $newvat = $this->product->tva_tx; $newnpr = $this->product->tva_npr; $newvatsrccode = $this->product->default_vat_code; - + $newprice = $this->product->price; $newpricemin = $this->product->price_min; if ($this->product->price_base_type == 'TTC') { $newprice = $this->product->price_ttc; $newpricemin = $this->product->price_min_ttc; } - + $result = $this->product->updatePrice($newprice, $this->product->price_base_type, DolibarrApiAccess::$user, $newvat, $newpricemin, 0, $newnpr, 0, 0, array(), $newvatsrccode); } } - + if ($result <= 0) { throw new RestException(500, "Error updating product", array_merge(array($this->product->error), $this->product->errors)); } - + return $this->get($id); } - + /** * Delete product * @@ -364,18 +364,18 @@ class Products extends DolibarrApi if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + // The Product::delete() method uses the global variable $user. global $user; $user = DolibarrApiAccess::$user; - + return $this->product->delete(DolibarrApiAccess::$user); } - + /** * Get the list of subproducts of the product. * @@ -393,22 +393,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $childsArbo = $this->product->getChildsArbo($id, 1); - + $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); } - + return $childs; } - + /** * Add subproduct. * @@ -431,18 +431,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->product->add_sousproduit($id, $subproduct_id, $qty, $incdec); if ($result <= 0) { throw new RestException(500, "Error adding product child"); } return $result; } - + /** * Remove subproduct. * @@ -462,19 +462,19 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->product->del_sousproduit($id, $subproduct_id); if ($result <= 0) { throw new RestException(500, "Error while removing product child"); } return $result; } - - + + /** * Get categories for a product * @@ -493,22 +493,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->categorie->lire) { throw new RestException(401); } - + $categories = new Categorie($this->db); - + $result = $categories->getListForItem($id, 'product', $sortfield, $sortorder, $limit, $page); - + if (empty($result)) { throw new RestException(404, 'No category found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); } - + return $result; } - + /** * Get prices per segment for a product * @@ -521,24 +521,24 @@ class Products extends DolibarrApi public function getCustomerPricesPerSegment($id) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_MULTIPRICES)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } - + return array( 'multiprices'=>$this->product->multiprices, 'multiprices_inc_tax'=>$this->product->multiprices_ttc, @@ -549,7 +549,7 @@ class Products extends DolibarrApi //'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code ); } - + /** * Get prices per customer for a product * @@ -563,36 +563,36 @@ class Products extends DolibarrApi public function getCustomerPricesPerCustomer($id, $thirdparty_id = '') { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result > 0) { - require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; - $prodcustprice = new Productcustomerprice($this->db); - $filter = array(); - $filter['t.fk_product'] .= $id; - if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id; - $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($this->db); + $filter = array(); + $filter['t.fk_product'] .= $id; + if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id; + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); } - + if (empty($prodcustprice->lines)) { throw new RestException(404, 'Prices not found'); } - + return $prodcustprice->lines; } - + /** * Get prices per quantity for a product * @@ -605,30 +605,30 @@ class Products extends DolibarrApi public function getCustomerPricesPerQuantity($id) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } - + return array( - 'prices_by_qty'=>$this->product->prices_by_qty[0], // 1 if price by quantity was activated for the product - 'prices_by_qty_list'=>$this->product->prices_by_qty_list[0] + 'prices_by_qty'=>$this->product->prices_by_qty[0], // 1 if price by quantity was activated for the product + 'prices_by_qty_list'=>$this->product->prices_by_qty_list[0] ); } - + /** * Add/Update purchase prices for a product. * @@ -641,11 +641,11 @@ class Products extends DolibarrApi * @param string $ref_fourn Supplier ref * @param float $tva_tx New VAT Rate (For example 8.5. Should not be a string) * @param string $charges costs affering to product - * @param float $remise_percent Discount regarding qty (percent) - * @param float $remise Discount regarding qty (amount) - * @param int $newnpr Set NPR or not - * @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined. - * @param string $supplier_reputation Reputation with this product to the defined supplier (empty, FAVORITE, DONOTORDER) + * @param float $remise_percent Discount regarding qty (percent) + * @param float $remise Discount regarding qty (amount) + * @param int $newnpr Set NPR or not + * @param int $delivery_time_days Delay in days for delivery (max). May be '' if not defined. + * @param string $supplier_reputation Reputation with this product to the defined supplier (empty, FAVORITE, DONOTORDER) * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). * @param string $newdefaultvatcode Default vat code * @param float $multicurrency_buyprice Purchase price for the quantity min in currency @@ -667,35 +667,35 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $result = $this->productsupplier->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->productsupplier->add_fournisseur(DolibarrApiAccess::$user, $fourn_id, $ref_fourn, $qty); if ($result < 0) { throw new RestException(500, "Error adding supplier to product : ".$this->db->lasterror()); } - + $fourn = new Fournisseur($this->db); $result = $fourn->fetch($fourn_id); if ($result <= 0) { throw new RestException(404, 'Supplier not found'); } - + $result = $this->productsupplier->update_buyprice($qty, $buyprice, DolibarrApiAccess::$user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges, $remise_percent, $remise, $newnpr, $delivery_time_days, $supplier_reputation, $localtaxes_array, $newdefaultvatcode, $multicurrency_buyprice, $multicurrency_price_base_type, $multicurrency_tx, $multicurrency_code, $desc_fourn, $barcode, $fk_barcode_type); - + if ($result <= 0) { throw new RestException(500, "Error updating buy price : ".$this->db->lasterror()); } return (int) $this->productsupplier->product_fourn_price_id; } - + /** * Delete purchase price for a product * @@ -719,19 +719,19 @@ class Products extends DolibarrApi if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $resultsupplier = 0; if ($result > 0) { $resultsupplier = $this->productsupplier->remove_product_fournisseur_price($priceid); } - + return $resultsupplier; } - + /** * Get a list of all purchase prices of products * @@ -749,79 +749,79 @@ class Products extends DolibarrApi */ public function getSupplierProducts($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $supplier = 0, $sqlfilters = '') { - global $db, $conf; - $obj_ret = array(); - $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; - $sql = "SELECT t.rowid, t.ref, t.ref_ext"; - $sql .= " FROM ".MAIN_DB_PREFIX."product as t"; - if ($category > 0) { - $sql .= ", ".MAIN_DB_PREFIX."categorie_product as c"; - } - $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; - - $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; - - if ($supplier > 0) { - $sql .= " AND s.fk_soc = ".$db->escape($supplier); - } - $sql .= " AND s.fk_product = t.rowid"; - // Select products of given category - if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$db->escape($category); - $sql .= " AND c.fk_product = t.rowid"; - } - if ($mode == 1) { - // Show only products - $sql .= " AND t.fk_product_type = 0"; - } elseif ($mode == 2) { - // Show only services - $sql .= " AND t.fk_product_type = 1"; - } - // Add sql filters - if ($sqlfilters) { - if (!DolibarrApi::_checkFilters($sqlfilters)) { - throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); - } - $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; - $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; - } - $sql .= $db->order($sortfield, $sortorder); - if ($limit) { - if ($page < 0) { - $page = 0; - } - $offset = $limit * $page; - $sql .= $db->plimit($limit + 1, $offset); - } - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $min = min($num, ($limit <= 0 ? $num : $limit)); - $i = 0; - while ($i < $min) - { - $obj = $db->fetch_object($result); - - $product_fourn = new ProductFournisseur($this->db); - $product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0); - foreach ($product_fourn_list as $tmpobj) { - $this->_cleanObjectDatas($tmpobj); - } - - //var_dump($product_fourn_list->db);exit; - $obj_ret[$obj->rowid] = $product_fourn_list; - - $i++; - } - } else { - throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); - } - if (!count($obj_ret)) { - throw new RestException(404, 'No product found'); - } - return $obj_ret; + global $db, $conf; + $obj_ret = array(); + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; + $sql .= " FROM ".MAIN_DB_PREFIX."product as t"; + if ($category > 0) { + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as c"; + } + $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; + + $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; + + if ($supplier > 0) { + $sql .= " AND s.fk_soc = ".$db->escape($supplier); + } + $sql .= " AND s.fk_product = t.rowid"; + // Select products of given category + if ($category > 0) { + $sql .= " AND c.fk_categorie = ".$db->escape($category); + $sql .= " AND c.fk_product = t.rowid"; + } + if ($mode == 1) { + // Show only products + $sql .= " AND t.fk_product_type = 0"; + } elseif ($mode == 2) { + // Show only services + $sql .= " AND t.fk_product_type = 1"; + } + // Add sql filters + if ($sqlfilters) { + if (!DolibarrApi::_checkFilters($sqlfilters)) { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + $sql .= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + $sql .= $db->plimit($limit + 1, $offset); + } + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + $i = 0; + while ($i < $min) + { + $obj = $db->fetch_object($result); + + $product_fourn = new ProductFournisseur($this->db); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0); + foreach ($product_fourn_list as $tmpobj) { + $this->_cleanObjectDatas($tmpobj); + } + + //var_dump($product_fourn_list->db);exit; + $obj_ret[$obj->rowid] = $product_fourn_list; + + $i++; + } + } else { + throw new RestException(503, 'Error when retrieve product list : '.$db->lasterror()); + } + if (!count($obj_ret)) { + throw new RestException(404, 'No product found'); + } + return $obj_ret; } - + /** * Get purchase prices for a product * @@ -846,36 +846,36 @@ class Products extends DolibarrApi if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) { throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode'); } - + $id = (empty($id) ? 0 : $id); - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(403); } - + $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $product_fourn_list = array(); - + if ($result) { $product_fourn = new ProductFournisseur($this->db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0); } - + foreach ($product_fourn_list as $tmpobj) { $this->_cleanObjectDatas($tmpobj); } - + return $this->_cleanObjectDatas($product_fourn_list); } - + /** * Get attributes. * @@ -890,11 +890,11 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); return $prodattr->fetchAll(); } - + /** * Get attribute by ID. * @@ -912,17 +912,17 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $result = $prodattr->fetch((int) $id); - + if ($result < 0) { throw new RestException(404, "Attribute not found"); } - + return $prodattr; } - + /** * Get attributes by ref. * @@ -939,26 +939,26 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, ref, label, rang FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".trim($ref)."' AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$this->db->num_rows($query)) { throw new RestException(404); } - + $result = $this->db->fetch_object($query); - + $attr = []; $attr['id'] = $result->rowid; $attr['ref'] = $result->ref; $attr['label'] = $result->label; $attr['rang'] = $result->rang; - + return $attr; } - + /** * Add attributes. * @@ -976,18 +976,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $prodattr->label = $label; $prodattr->ref = $ref; - + $resid = $prodattr->create(DolibarrApiAccess::$user); if ($resid <= 0) { throw new RestException(500, "Error creating new attribute"); } return $resid; } - + /** * Update attributes by id. * @@ -1006,22 +1006,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); - + $result = $prodattr->fetch((int) $id); if ($result == 0) { throw new RestException(404, 'Attribute not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute"); } - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $prodattr->$field = $value; } - + if ($prodattr->update(DolibarrApiAccess::$user) > 0) { $result = $prodattr->fetch((int) $id); if ($result == 0) { @@ -1034,7 +1034,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error updating attribute"); } - + /** * Delete attributes by id. * @@ -1051,18 +1051,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $prodattr->id = (int) $id; $result = $prodattr->delete(DolibarrApiAccess::$user); - + if ($result <= 0) { - throw new RestException(500, "Error deleting attribute"); + throw new RestException(500, "Error deleting attribute"); } - + return $result; } - + /** * Get attribute value by id. * @@ -1079,30 +1079,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE rowid = ".(int) $id." AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$query) { throw new RestException(401); } - + if (!$this->db->num_rows($query)) { throw new RestException(404, 'Attribute value not found'); } - + $result = $this->db->fetch_object($query); - + $attrval = []; $attrval['id'] = $result->rowid; $attrval['fk_product_attribute'] = $result->fk_product_attribute; $attrval['ref'] = $result->ref; $attrval['value'] = $result->value; - + return $attrval; } - + /** * Get attribute value by ref. * @@ -1120,30 +1120,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$query) { throw new RestException(401); } - + if (!$this->db->num_rows($query)) { throw new RestException(404, 'Attribute value not found'); } - + $result = $this->db->fetch_object($query); - + $attrval = []; $attrval['id'] = $result->rowid; $attrval['fk_product_attribute'] = $result->fk_product_attribute; $attrval['ref'] = $result->ref; $attrval['value'] = $result->value; - + return $attrval; } - + /** * Delete attribute value by ref. * @@ -1160,16 +1160,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id; - - if ($this->db->query($sql)) { + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; + $query = $this->db->query($sql); + + if (!$query) { + throw new RestException(401); + } + + if (!$this->db->num_rows($query)) { + throw new RestException(404, 'Attribute value not found'); + } + + $result = $this->db->fetch_object($query); + + $attrval = new ProductAttributeValue($this->db); + $attrval->id = $result->rowid; + $result = $attrval->delete(DolibarrApiAccess::$user); + if ($result > 0) { return 1; } - + throw new RestException(500, "Error deleting attribute value"); } - + /** * Get all values for an attribute id. * @@ -1186,11 +1200,11 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); return $objectval->fetchAllByProductAttribute((int) $id); } - + /** * Get all values for an attribute ref. * @@ -1206,28 +1220,28 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $return = array(); - + $sql = 'SELECT '; $sql .= 'v.fk_product_attribute, v.rowid, v.ref, v.value FROM '.MAIN_DB_PREFIX.'product_attribute_value v '; $sql .= "WHERE v.fk_product_attribute = ( SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".strtoupper(trim($ref))."' LIMIT 1)"; - + $query = $this->db->query($sql); - + while ($result = $this->db->fetch_object($query)) { $tmp = new ProductAttributeValue($this->db); $tmp->fk_product_attribute = $result->fk_product_attribute; $tmp->id = $result->rowid; $tmp->ref = $result->ref; $tmp->value = $result->value; - + $return[] = $tmp; } - + return $return; } - + /** * Add attribute value. * @@ -1246,22 +1260,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($ref) || empty($value)) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $objectval->fk_product_attribute = $id; $objectval->ref = $ref; $objectval->value = $value; - + if ($objectval->create(DolibarrApiAccess::$user) > 0) { return $objectval->id; } throw new RestException(500, "Error creating new attribute value"); } - + /** * Update attribute value. * @@ -1279,22 +1293,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $result = $objectval->fetch((int) $id); - + if ($result == 0) { throw new RestException(404, 'Attribute value not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute value"); } - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $objectval->$field = $value; } - + if ($objectval->update(DolibarrApiAccess::$user) > 0) { $result = $objectval->fetch((int) $id); if ($result == 0) { @@ -1307,7 +1321,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error updating attribute"); } - + /** * Delete attribute value by id. * @@ -1324,16 +1338,16 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $objectval->id = (int) $id; - - if ($objectval->delete() > 0) { + + if ($objectval->delete(DolibarrApiAccess::$user) > 0) { return 1; } throw new RestException(500, "Error deleting attribute value"); } - + /** * Get product variants. * @@ -1350,18 +1364,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $combinations = $prodcomb->fetchAllByFkProductParent((int) $id); - + foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); } - + return $combinations; } - + /** * Get product variants by Product ref. * @@ -1378,23 +1392,23 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $result = $this->product->fetch('', $ref); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); $combinations = $prodcomb->fetchAllByFkProductParent((int) $this->product->id); - + foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); } - + return $combinations; } - + /** * Add variant. * @@ -1419,14 +1433,14 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($id) || empty($features) || !is_array($features)) { throw new RestException(401); } - + $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - + $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db); foreach ($features as $id_attr => $id_value) { @@ -1437,23 +1451,23 @@ class Products extends DolibarrApi throw new RestException(401); } } - + $result = $this->product->fetch((int) $id); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); - + $result = $prodcomb->createProductCombination(DolibarrApiAccess::$user, $this->product, $features, array(), $price_impact_is_percent, $price_impact, $weight_impact, $reference); if ($result > 0) { - return $result; + return $result; } else { - throw new RestException(500, "Error creating new product variant"); + throw new RestException(500, "Error creating new product variant"); } } - + /** * Add variant by product ref. * @@ -1477,14 +1491,14 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($ref) || empty($features) || !is_array($features)) { throw new RestException(401); } - + $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - + $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db); foreach ($features as $id_attr => $id_value) { @@ -1495,12 +1509,12 @@ class Products extends DolibarrApi throw new RestException(404); } } - + $result = $this->product->fetch('', trim($ref)); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); if (!$prodcomb->fetchByProductCombination2ValuePairs($this->product->id, $features)) { @@ -1515,7 +1529,7 @@ class Products extends DolibarrApi return $prodcomb->id; } } - + /** * Put product variants. * @@ -1533,16 +1547,16 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $prodcomb->fetch((int) $id); - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $prodcomb->$field = $value; } - + $result = $prodcomb->update(DolibarrApiAccess::$user); if ($result > 0) { @@ -1550,7 +1564,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error editing variant"); } - + /** * Delete product variants. * @@ -1567,17 +1581,17 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $prodcomb->id = (int) $id; $result = $prodcomb->delete(DolibarrApiAccess::$user); if ($result <= 0) { - throw new RestException(500, "Error deleting variant"); + throw new RestException(500, "Error deleting variant"); } return $result; } - + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas @@ -1589,24 +1603,24 @@ class Products extends DolibarrApi { // phpcs:enable $object = parent::_cleanObjectDatas($object); - + unset($object->regeximgext); unset($object->price_by_qty); unset($object->prices_by_qty_id); unset($object->libelle); unset($object->product_id_already_linked); unset($object->reputations); - + unset($object->name); unset($object->firstname); unset($object->lastname); unset($object->civility_id); - + unset($object->recuperableonly); - + return $object; } - + /** * Validate fields before create or update object * @@ -1625,7 +1639,7 @@ class Products extends DolibarrApi } return $product; } - + /** * Get properties of a product object * @@ -1648,48 +1662,48 @@ class Products extends DolibarrApi if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) { throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode'); } - + $id = (empty($id) ? 0 : $id); - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(403); } - + $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if ($includestockdata) { - $this->product->load_stock(); - - if (is_array($this->product->stock_warehouse)) { - foreach ($this->product->stock_warehouse as $keytmp => $valtmp) { - if (is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { - foreach ($this->product->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { - unset($this->product->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); - } - } - } - } + $this->product->load_stock(); + + if (is_array($this->product->stock_warehouse)) { + foreach ($this->product->stock_warehouse as $keytmp => $valtmp) { + if (is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { + foreach ($this->product->stock_warehouse[$keytmp]->detail_batch as $keytmp2 => $valtmp2) { + unset($this->product->stock_warehouse[$keytmp]->detail_batch[$keytmp2]->db); + } + } + } + } } - + if ($includesubproducts) { $childsArbo = $this->product->getChildsArbo($id, 1); - + $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); } - + $this->product->sousprods = $childs; } - + return $this->_cleanObjectDatas($this->product); } } From d7a65a540e47a88517d7d342a9f5823ac3878599 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 8 Aug 2020 20:58:51 +0000 Subject: [PATCH 57/66] Fixing style errors. --- htdocs/product/class/api_products.class.php | 426 +++++++++--------- .../variants/class/ProductAttribute.class.php | 6 +- .../class/ProductAttributeValue.class.php | 18 +- 3 files changed, 225 insertions(+), 225 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index a63709b5c4b..f1b3e91617b 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -41,17 +41,17 @@ class Products extends DolibarrApi 'ref', 'label' ); - + /** * @var Product $product {@type Product} */ public $product; - + /** * @var ProductFournisseur $productsupplier {@type ProductFournisseur} */ public $productsupplier; - + /** * Constructor */ @@ -62,7 +62,7 @@ class Products extends DolibarrApi $this->product = new Product($this->db); $this->productsupplier = new ProductFournisseur($this->db); } - + /** * Get properties of a product object by id * @@ -81,7 +81,7 @@ class Products extends DolibarrApi { return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by ref * @@ -103,7 +103,7 @@ class Products extends DolibarrApi { return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by ref_ext * @@ -125,7 +125,7 @@ class Products extends DolibarrApi { return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts); } - + /** * Get properties of a product object by barcode * @@ -147,7 +147,7 @@ class Products extends DolibarrApi { return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts); } - + /** * List products * @@ -165,11 +165,11 @@ class Products extends DolibarrApi public function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '') { global $db, $conf; - + $obj_ret = array(); - + $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : ''; - + $sql = "SELECT t.rowid, t.ref, t.ref_ext"; $sql .= " FROM ".MAIN_DB_PREFIX."product as t"; if ($category > 0) { @@ -196,17 +196,17 @@ class Products extends DolibarrApi $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; } - + $sql .= $db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { $page = 0; } $offset = $limit * $page; - + $sql .= $db->plimit($limit + 1, $offset); } - + $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -229,7 +229,7 @@ class Products extends DolibarrApi } return $obj_ret; } - + /** * Create product object * @@ -243,17 +243,17 @@ class Products extends DolibarrApi } // Check mandatory fields $result = $this->_validate($request_data); - + foreach ($request_data as $field => $value) { $this->product->$field = $value; } if ($this->product->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, "Error creating product", array_merge(array($this->product->error), $this->product->errors)); } - + return $this->product->id; } - + /** * Update product. * Price will be updated by this API only if option is set on "One price per product". See other APIs for other price modes. @@ -268,22 +268,22 @@ class Products extends DolibarrApi public function put($id, $request_data = null) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $oldproduct = dol_clone($this->product, 0); - + foreach ($request_data as $field => $value) { if ($field == 'id') { continue; } @@ -292,14 +292,14 @@ class Products extends DolibarrApi } $this->product->$field = $value; } - + $updatetype = false; if ($this->product->type != $oldproduct->type && ($this->product->isProduct() || $this->product->isService())) { $updatetype = true; } - + $result = $this->product->update($id, DolibarrApiAccess::$user, 1, 'update', $updatetype); - + // If price mode is 1 price per product if ($result > 0 && !empty($conf->global->PRODUCT_PRICE_UNIQ)) { // We update price only if it was changed @@ -312,7 +312,7 @@ class Products extends DolibarrApi } if ($this->product->default_vat_code != $oldproduct->default_vat_code) { $pricemodified = true; } - + if ($this->product->price_base_type == 'TTC') { if ($this->product->price_ttc != $oldproduct->price_ttc) { $pricemodified = true; } @@ -325,30 +325,30 @@ class Products extends DolibarrApi } } } - + if ($pricemodified) { $newvat = $this->product->tva_tx; $newnpr = $this->product->tva_npr; $newvatsrccode = $this->product->default_vat_code; - + $newprice = $this->product->price; $newpricemin = $this->product->price_min; if ($this->product->price_base_type == 'TTC') { $newprice = $this->product->price_ttc; $newpricemin = $this->product->price_min_ttc; } - + $result = $this->product->updatePrice($newprice, $this->product->price_base_type, DolibarrApiAccess::$user, $newvat, $newpricemin, 0, $newnpr, 0, 0, array(), $newvatsrccode); } } - + if ($result <= 0) { throw new RestException(500, "Error updating product", array_merge(array($this->product->error), $this->product->errors)); } - + return $this->get($id); } - + /** * Delete product * @@ -364,18 +364,18 @@ class Products extends DolibarrApi if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + // The Product::delete() method uses the global variable $user. global $user; $user = DolibarrApiAccess::$user; - + return $this->product->delete(DolibarrApiAccess::$user); } - + /** * Get the list of subproducts of the product. * @@ -393,22 +393,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $childsArbo = $this->product->getChildsArbo($id, 1); - + $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); } - + return $childs; } - + /** * Add subproduct. * @@ -431,18 +431,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->product->add_sousproduit($id, $subproduct_id, $qty, $incdec); if ($result <= 0) { throw new RestException(500, "Error adding product child"); } return $result; } - + /** * Remove subproduct. * @@ -462,19 +462,19 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (!DolibarrApi::_checkAccessToResource('product', $id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->product->del_sousproduit($id, $subproduct_id); if ($result <= 0) { throw new RestException(500, "Error while removing product child"); } return $result; } - - + + /** * Get categories for a product * @@ -493,22 +493,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->categorie->lire) { throw new RestException(401); } - + $categories = new Categorie($this->db); - + $result = $categories->getListForItem($id, 'product', $sortfield, $sortorder, $limit, $page); - + if (empty($result)) { throw new RestException(404, 'No category found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors)); } - + return $result; } - + /** * Get prices per segment for a product * @@ -521,24 +521,24 @@ class Products extends DolibarrApi public function getCustomerPricesPerSegment($id) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_MULTIPRICES)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } - + return array( 'multiprices'=>$this->product->multiprices, 'multiprices_inc_tax'=>$this->product->multiprices_ttc, @@ -549,7 +549,7 @@ class Products extends DolibarrApi //'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code ); } - + /** * Get prices per customer for a product * @@ -563,20 +563,20 @@ class Products extends DolibarrApi public function getCustomerPricesPerCustomer($id, $thirdparty_id = '') { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result > 0) { require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php'; $prodcustprice = new Productcustomerprice($this->db); @@ -585,14 +585,14 @@ class Products extends DolibarrApi if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id; $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); } - + if (empty($prodcustprice->lines)) { throw new RestException(404, 'Prices not found'); } - + return $prodcustprice->lines; } - + /** * Get prices per quantity for a product * @@ -605,30 +605,30 @@ class Products extends DolibarrApi public function getCustomerPricesPerQuantity($id) { global $conf; - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + if (empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { throw new RestException(400, 'API not available: this mode of pricing is not enabled by setup'); } - + $result = $this->product->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if ($result < 0) { throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors)); } - + return array( 'prices_by_qty'=>$this->product->prices_by_qty[0], // 1 if price by quantity was activated for the product 'prices_by_qty_list'=>$this->product->prices_by_qty_list[0] ); } - + /** * Add/Update purchase prices for a product. * @@ -667,35 +667,35 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $result = $this->productsupplier->fetch($id); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $result = $this->productsupplier->add_fournisseur(DolibarrApiAccess::$user, $fourn_id, $ref_fourn, $qty); if ($result < 0) { throw new RestException(500, "Error adding supplier to product : ".$this->db->lasterror()); } - + $fourn = new Fournisseur($this->db); $result = $fourn->fetch($fourn_id); if ($result <= 0) { throw new RestException(404, 'Supplier not found'); } - + $result = $this->productsupplier->update_buyprice($qty, $buyprice, DolibarrApiAccess::$user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges, $remise_percent, $remise, $newnpr, $delivery_time_days, $supplier_reputation, $localtaxes_array, $newdefaultvatcode, $multicurrency_buyprice, $multicurrency_price_base_type, $multicurrency_tx, $multicurrency_code, $desc_fourn, $barcode, $fk_barcode_type); - + if ($result <= 0) { throw new RestException(500, "Error updating buy price : ".$this->db->lasterror()); } return (int) $this->productsupplier->product_fourn_price_id; } - + /** * Delete purchase price for a product * @@ -719,19 +719,19 @@ class Products extends DolibarrApi if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->productsupplier->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $resultsupplier = 0; if ($result > 0) { $resultsupplier = $this->productsupplier->remove_product_fournisseur_price($priceid); } - + return $resultsupplier; } - + /** * Get a list of all purchase prices of products * @@ -758,9 +758,9 @@ class Products extends DolibarrApi $sql .= ", ".MAIN_DB_PREFIX."categorie_product as c"; } $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur_price as s"; - + $sql .= ' WHERE t.entity IN ('.getEntity('product').')'; - + if ($supplier > 0) { $sql .= " AND s.fk_soc = ".$db->escape($supplier); } @@ -801,16 +801,16 @@ class Products extends DolibarrApi while ($i < $min) { $obj = $db->fetch_object($result); - + $product_fourn = new ProductFournisseur($this->db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($obj->rowid, '', '', 0, 0); foreach ($product_fourn_list as $tmpobj) { $this->_cleanObjectDatas($tmpobj); } - + //var_dump($product_fourn_list->db);exit; $obj_ret[$obj->rowid] = $product_fourn_list; - + $i++; } } else { @@ -821,7 +821,7 @@ class Products extends DolibarrApi } return $obj_ret; } - + /** * Get purchase prices for a product * @@ -846,36 +846,36 @@ class Products extends DolibarrApi if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) { throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode'); } - + $id = (empty($id) ? 0 : $id); - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(403); } - + $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + $product_fourn_list = array(); - + if ($result) { $product_fourn = new ProductFournisseur($this->db); $product_fourn_list = $product_fourn->list_product_fournisseur_price($this->product->id, '', '', 0, 0); } - + foreach ($product_fourn_list as $tmpobj) { $this->_cleanObjectDatas($tmpobj); } - + return $this->_cleanObjectDatas($product_fourn_list); } - + /** * Get attributes. * @@ -890,11 +890,11 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); return $prodattr->fetchAll(); } - + /** * Get attribute by ID. * @@ -912,17 +912,17 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $result = $prodattr->fetch((int) $id); - + if ($result < 0) { throw new RestException(404, "Attribute not found"); } - + return $prodattr; } - + /** * Get attributes by ref. * @@ -939,26 +939,26 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, ref, label, rang FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".trim($ref)."' AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$this->db->num_rows($query)) { throw new RestException(404); } - + $result = $this->db->fetch_object($query); - + $attr = []; $attr['id'] = $result->rowid; $attr['ref'] = $result->ref; $attr['label'] = $result->label; $attr['rang'] = $result->rang; - + return $attr; } - + /** * Add attributes. * @@ -976,18 +976,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $prodattr->label = $label; $prodattr->ref = $ref; - + $resid = $prodattr->create(DolibarrApiAccess::$user); if ($resid <= 0) { throw new RestException(500, "Error creating new attribute"); } return $resid; } - + /** * Update attributes by id. * @@ -1006,22 +1006,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); - + $result = $prodattr->fetch((int) $id); if ($result == 0) { throw new RestException(404, 'Attribute not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute"); } - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $prodattr->$field = $value; } - + if ($prodattr->update(DolibarrApiAccess::$user) > 0) { $result = $prodattr->fetch((int) $id); if ($result == 0) { @@ -1034,7 +1034,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error updating attribute"); } - + /** * Delete attributes by id. * @@ -1051,18 +1051,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $prodattr = new ProductAttribute($this->db); $prodattr->id = (int) $id; $result = $prodattr->delete(DolibarrApiAccess::$user); - + if ($result <= 0) { throw new RestException(500, "Error deleting attribute"); } - + return $result; } - + /** * Get attribute value by id. * @@ -1079,30 +1079,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE rowid = ".(int) $id." AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$query) { throw new RestException(401); } - + if (!$this->db->num_rows($query)) { throw new RestException(404, 'Attribute value not found'); } - + $result = $this->db->fetch_object($query); - + $attrval = []; $attrval['id'] = $result->rowid; $attrval['fk_product_attribute'] = $result->fk_product_attribute; $attrval['ref'] = $result->ref; $attrval['value'] = $result->value; - + return $attrval; } - + /** * Get attribute value by ref. * @@ -1120,30 +1120,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $sql = "SELECT rowid, fk_product_attribute, ref, value FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; - + $query = $this->db->query($sql); - + if (!$query) { throw new RestException(401); } - + if (!$this->db->num_rows($query)) { throw new RestException(404, 'Attribute value not found'); } - + $result = $this->db->fetch_object($query); - + $attrval = []; $attrval['id'] = $result->rowid; $attrval['fk_product_attribute'] = $result->fk_product_attribute; $attrval['ref'] = $result->ref; $attrval['value'] = $result->value; - + return $attrval; } - + /** * Delete attribute value by ref. * @@ -1160,30 +1160,30 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE ref LIKE '".trim($ref)."' AND fk_product_attribute = ".(int) $id." AND entity IN (".getEntity('product').")"; $query = $this->db->query($sql); - + if (!$query) { throw new RestException(401); } - + if (!$this->db->num_rows($query)) { throw new RestException(404, 'Attribute value not found'); } - + $result = $this->db->fetch_object($query); - + $attrval = new ProductAttributeValue($this->db); $attrval->id = $result->rowid; $result = $attrval->delete(DolibarrApiAccess::$user); if ($result > 0) { return 1; } - + throw new RestException(500, "Error deleting attribute value"); } - + /** * Get all values for an attribute id. * @@ -1200,11 +1200,11 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); return $objectval->fetchAllByProductAttribute((int) $id); } - + /** * Get all values for an attribute ref. * @@ -1220,28 +1220,28 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $return = array(); - + $sql = 'SELECT '; $sql .= 'v.fk_product_attribute, v.rowid, v.ref, v.value FROM '.MAIN_DB_PREFIX.'product_attribute_value v '; $sql .= "WHERE v.fk_product_attribute = ( SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute WHERE ref LIKE '".strtoupper(trim($ref))."' LIMIT 1)"; - + $query = $this->db->query($sql); - + while ($result = $this->db->fetch_object($query)) { $tmp = new ProductAttributeValue($this->db); $tmp->fk_product_attribute = $result->fk_product_attribute; $tmp->id = $result->rowid; $tmp->ref = $result->ref; $tmp->value = $result->value; - + $return[] = $tmp; } - + return $return; } - + /** * Add attribute value. * @@ -1260,22 +1260,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($ref) || empty($value)) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $objectval->fk_product_attribute = $id; $objectval->ref = $ref; $objectval->value = $value; - + if ($objectval->create(DolibarrApiAccess::$user) > 0) { return $objectval->id; } throw new RestException(500, "Error creating new attribute value"); } - + /** * Update attribute value. * @@ -1293,22 +1293,22 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $result = $objectval->fetch((int) $id); - + if ($result == 0) { throw new RestException(404, 'Attribute value not found'); } elseif ($result < 0) { throw new RestException(500, "Error fetching attribute value"); } - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $objectval->$field = $value; } - + if ($objectval->update(DolibarrApiAccess::$user) > 0) { $result = $objectval->fetch((int) $id); if ($result == 0) { @@ -1321,7 +1321,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error updating attribute"); } - + /** * Delete attribute value by id. * @@ -1338,16 +1338,16 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $objectval = new ProductAttributeValue($this->db); $objectval->id = (int) $id; - + if ($objectval->delete(DolibarrApiAccess::$user) > 0) { return 1; } throw new RestException(500, "Error deleting attribute value"); } - + /** * Get product variants. * @@ -1364,18 +1364,18 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $combinations = $prodcomb->fetchAllByFkProductParent((int) $id); - + foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); } - + return $combinations; } - + /** * Get product variants by Product ref. * @@ -1392,23 +1392,23 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(401); } - + $result = $this->product->fetch('', $ref); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); $combinations = $prodcomb->fetchAllByFkProductParent((int) $this->product->id); - + foreach ($combinations as $key => $combination) { $prodc2vp = new ProductCombination2ValuePair($this->db); $combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id); } - + return $combinations; } - + /** * Add variant. * @@ -1433,14 +1433,14 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($id) || empty($features) || !is_array($features)) { throw new RestException(401); } - + $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - + $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db); foreach ($features as $id_attr => $id_value) { @@ -1451,14 +1451,14 @@ class Products extends DolibarrApi throw new RestException(401); } } - + $result = $this->product->fetch((int) $id); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); - + $result = $prodcomb->createProductCombination(DolibarrApiAccess::$user, $this->product, $features, array(), $price_impact_is_percent, $price_impact, $weight_impact, $reference); if ($result > 0) { @@ -1467,7 +1467,7 @@ class Products extends DolibarrApi throw new RestException(500, "Error creating new product variant"); } } - + /** * Add variant by product ref. * @@ -1491,14 +1491,14 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + if (empty($ref) || empty($features) || !is_array($features)) { throw new RestException(401); } - + $weight_impact = price2num($weight_impact); $price_impact = price2num($price_impact); - + $prodattr = new ProductAttribute($this->db); $prodattr_val = new ProductAttributeValue($this->db); foreach ($features as $id_attr => $id_value) { @@ -1509,12 +1509,12 @@ class Products extends DolibarrApi throw new RestException(404); } } - + $result = $this->product->fetch('', trim($ref)); if (!$result) { throw new RestException(404, 'Product not found'); } - + $prodcomb = new ProductCombination($this->db); if (!$prodcomb->fetchByProductCombination2ValuePairs($this->product->id, $features)) { @@ -1529,7 +1529,7 @@ class Products extends DolibarrApi return $prodcomb->id; } } - + /** * Put product variants. * @@ -1547,16 +1547,16 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $prodcomb->fetch((int) $id); - + foreach ($request_data as $field => $value) { if ($field == 'rowid') { continue; } $prodcomb->$field = $value; } - + $result = $prodcomb->update(DolibarrApiAccess::$user); if ($result > 0) { @@ -1564,7 +1564,7 @@ class Products extends DolibarrApi } throw new RestException(500, "Error editing variant"); } - + /** * Delete product variants. * @@ -1581,7 +1581,7 @@ class Products extends DolibarrApi if (!DolibarrApiAccess::$user->rights->produit->supprimer) { throw new RestException(401); } - + $prodcomb = new ProductCombination($this->db); $prodcomb->id = (int) $id; $result = $prodcomb->delete(DolibarrApiAccess::$user); @@ -1591,7 +1591,7 @@ class Products extends DolibarrApi } return $result; } - + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas @@ -1603,24 +1603,24 @@ class Products extends DolibarrApi { // phpcs:enable $object = parent::_cleanObjectDatas($object); - + unset($object->regeximgext); unset($object->price_by_qty); unset($object->prices_by_qty_id); unset($object->libelle); unset($object->product_id_already_linked); unset($object->reputations); - + unset($object->name); unset($object->firstname); unset($object->lastname); unset($object->civility_id); - + unset($object->recuperableonly); - + return $object; } - + /** * Validate fields before create or update object * @@ -1639,7 +1639,7 @@ class Products extends DolibarrApi } return $product; } - + /** * Get properties of a product object * @@ -1662,25 +1662,25 @@ class Products extends DolibarrApi if (empty($id) && empty($ref) && empty($ref_ext) && empty($barcode)) { throw new RestException(400, 'bad value for parameter id, ref, ref_ext or barcode'); } - + $id = (empty($id) ? 0 : $id); - + if (!DolibarrApiAccess::$user->rights->produit->lire) { throw new RestException(403); } - + $result = $this->product->fetch($id, $ref, $ref_ext, $barcode); if (!$result) { throw new RestException(404, 'Product not found'); } - + if (!DolibarrApi::_checkAccessToResource('product', $this->product->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - + if ($includestockdata) { $this->product->load_stock(); - + if (is_array($this->product->stock_warehouse)) { foreach ($this->product->stock_warehouse as $keytmp => $valtmp) { if (is_array($this->product->stock_warehouse[$keytmp]->detail_batch)) { @@ -1691,19 +1691,19 @@ class Products extends DolibarrApi } } } - + if ($includesubproducts) { $childsArbo = $this->product->getChildsArbo($id, 1); - + $keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec']; $childs = []; foreach ($childsArbo as $values) { $childs[] = array_combine($keys, $values); } - + $this->product->sousprods = $childs; } - + return $this->_cleanObjectDatas($this->product); } } diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 6d9fadf0101..6e2335c2f99 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -143,7 +143,7 @@ class ProductAttribute extends CommonObject } // End call triggers } - + //Ref must be uppercase $this->ref = strtoupper($this->ref); @@ -178,7 +178,7 @@ class ProductAttribute extends CommonObject } // End call triggers } - + //Ref must be uppercase $this->ref = trim(strtoupper($this->ref)); $this->label = trim($this->label); @@ -209,7 +209,7 @@ class ProductAttribute extends CommonObject } // End call triggers } - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute WHERE rowid = ".(int) $this->id; if ($this->db->query($sql)) { diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index c655e188c5d..b93f8b04c0b 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -175,7 +175,7 @@ class ProductAttributeValue extends CommonObject } // End call triggers } - + return 1; } @@ -199,7 +199,7 @@ class ProductAttributeValue extends CommonObject } // End call triggers } - + //Ref must be uppercase $this->ref = trim(strtoupper($this->ref)); $this->value = trim($this->value); @@ -224,7 +224,7 @@ class ProductAttributeValue extends CommonObject */ public function delete(User $user, $notrigger = 0) { - + if (empty($notrigger)) { // Call trigger $result = $this->call_trigger('PRODUCT_ATTRIBUTE_VALUE_DELETE', $user); @@ -237,7 +237,7 @@ class ProductAttributeValue extends CommonObject if ($this->db->query($sql)) { return 1; } - + return -1; } @@ -251,17 +251,17 @@ class ProductAttributeValue extends CommonObject public function deleteByFkAttribute($fk_attribute, User $user) { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_attribute_value WHERE fk_product_attribute = ".(int) $fk_attribute; - + $query = $this->db->query($sql); - + if (!$query) { return -1; } - + if (!$this->db->num_rows($query)) { return 1; } - + while ($obj = $this->db->fetch_object($query)) { $tmp = new ProductAttributeValue($this->db); if ($tmp->fetch($obj->rowid) > 0) { @@ -273,7 +273,7 @@ class ProductAttributeValue extends CommonObject return -1; } } - + return 1; } } From 3f233a3200f93990ef8cf1136c883831f681c969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Sat, 8 Aug 2020 23:01:41 +0200 Subject: [PATCH 58/66] Fix comment params --- htdocs/variants/class/ProductAttributeValue.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index b93f8b04c0b..ab998c6752b 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -244,8 +244,8 @@ class ProductAttributeValue extends CommonObject /** * Deletes all product attribute values by a product attribute id * - * @param int $fk_attribute Product attribute id - * @param int $notrigger Do not execute trigger + * @param int $fk_attribute Product attribute id + * @param User $user Object user * @return int <0 KO, >0 OK */ public function deleteByFkAttribute($fk_attribute, User $user) From 4aa71240d26e497b071a4761260116540e7dfa93 Mon Sep 17 00:00:00 2001 From: Egil Priskorn Date: Sun, 9 Aug 2020 16:33:34 +0200 Subject: [PATCH 59/66] Update README.md Fix spelling, grammar and a add a few clarifications. --- README.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fa5326079ec..d15808d2cac 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ ![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) -Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). +Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers. +It's Open Source Software (written in PHP) designed for small, medium or large companies, foundations and freelancers. -You can freely use, study, modify or distribute it according to its Free Software licence. +You can freely use, study, modify or distribute it according to its licence. -You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN. +You can use it as a standalone application or as a web application to access it from the Internet or a LAN. ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) @@ -35,11 +35,15 @@ Releases can be downloaded from [official website](https://www.dolibarr.org/). ### Advanced setup -You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. +You can use a web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. + +On GNU/Linux, first check if your distribution has already packaged Dolibarr. + +#### Generic install steps: - Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Versions). -- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you known git): +- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later): `git clone https://github.com/dolibarr/dolibarr -b x.y` (where x.y is main version like 3.6, 9.0, ...) @@ -70,11 +74,11 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING -- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr +- At first make a backup of your Dolibarr files & then read https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. -- At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process. -  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). +- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process. +  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). *Note: migration process can be safely done multiple times by calling the `/install/index.php` page* @@ -138,8 +142,8 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - customizable Dashboard - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- APIs -- An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture) +- SOAP & REST APIs +- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture) - Support a lot of country specific features: - Spanish Tax RE and ISPF - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) @@ -149,7 +153,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) - Compatible with European GDPR rules - ... -- PDF or ODT generation for invoice, proposals, orders... +- Flexible PDF & ODT generation for invoices, proposals, orders... - … ### System Environment / Requirements @@ -167,12 +171,12 @@ These are features that Dolibarr does **not** yet fully support: - Tasks dependencies in projects - Payroll module -- No native embedded Webmail +- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc. - Dolibarr can't do coffee (yet) ## DOCUMENTATION -Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](https://wiki.dolibarr.org). +Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org). ## CONTRIBUTING @@ -182,7 +186,7 @@ This project exists thanks to all the people who contribute. [[Contribute](https ## CREDITS -Dolibarr is the work of many contributors over the years and uses some fine libraries. +Dolibarr is the work of many contributors over the years and uses some fine PHP libraries. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file. From ca465373ea1021cecbe670b66e049c17c7f34816 Mon Sep 17 00:00:00 2001 From: Egil Priskorn Date: Sun, 9 Aug 2020 17:16:36 +0200 Subject: [PATCH 60/66] Update README.md Remove some paragraphs that are not essential to new users and 2 new paragraphs about preferred partners and upgrading supported all the way from 2.8 to 12 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fa5326079ec..52748e8000f 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ Dolibarr ERP & CRM is a modern software package to manage your organization's ac It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers. -You can freely use, study, modify or distribute it according to its Free Software licence. - You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN. +Dolibarr has a large community ready to help you and [oficially preferred partners ready to offer commercial support should you need it](https://wiki.dolibarr.org/index.php/List_of_Dolibarr_partners_and_providers) + ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) ## LICENSE @@ -70,14 +70,14 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING +Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from 2.8-12.0 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! + - At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). -*Note: migration process can be safely done multiple times by calling the `/install/index.php` page* - ## WHAT'S NEW See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. From dd7e673aee8050ccb7e9c5a06b6f96238d83ebb2 Mon Sep 17 00:00:00 2001 From: Egil Priskorn Date: Sun, 9 Aug 2020 17:24:09 +0200 Subject: [PATCH 61/66] Update README.md Written in PHP with optional JS --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fa5326079ec..564a4171116 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers. +It's an Open Source Software (written in PHP with optional JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers. You can freely use, study, modify or distribute it according to its Free Software licence. From d2db1a3557ac221f5d5d5b0f824334934fd32d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Aug 2020 23:38:19 +0200 Subject: [PATCH 62/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d15808d2cac..17d56c6ec62 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - customizable Dashboard - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- SOAP & REST APIs +- APIs - Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture) - Support a lot of country specific features: - Spanish Tax RE and ISPF From ab871f44be5e4f451b7f226c1bbd14c90bd6272b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Aug 2020 23:55:27 +0200 Subject: [PATCH 63/66] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 52748e8000f..a732c1cf1fd 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Dolibarr ERP & CRM is a modern software package to manage your organization's ac It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers. +You can freely use, study, modify or distribute it according to its Free Software licence. + You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN. Dolibarr has a large community ready to help you and [oficially preferred partners ready to offer commercial support should you need it](https://wiki.dolibarr.org/index.php/List_of_Dolibarr_partners_and_providers) From 867ae0c32d6d103c1f78581fcad0c6aaed180de9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Aug 2020 23:56:08 +0200 Subject: [PATCH 64/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a732c1cf1fd..9d6a168ac3a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can freely use, study, modify or distribute it according to its Free Softwar You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN. -Dolibarr has a large community ready to help you and [oficially preferred partners ready to offer commercial support should you need it](https://wiki.dolibarr.org/index.php/List_of_Dolibarr_partners_and_providers) +Dolibarr has a large community ready to help you and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) From bd5ad1aef2f3db9e553f8b3fcd19daa82ebb5b48 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Aug 2020 23:57:01 +0200 Subject: [PATCH 65/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d6a168ac3a..b14edb8d1da 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can freely use, study, modify or distribute it according to its Free Softwar You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN. -Dolibarr has a large community ready to help you and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) +Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_1920x1080.jpg) From 942a236c2ce197ad5fd48de9449e1e364c06b16e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Aug 2020 23:57:49 +0200 Subject: [PATCH 66/66] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b14edb8d1da..c35cbe6f536 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING -Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from 2.8-12.0 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! +Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).