From 1b7e138e0169928c0857cc1b2a655beb993a8a8f Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Tue, 29 Oct 2019 17:27:30 +0100 Subject: [PATCH 01/45] fix: delete function optional and id value --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fb9539f6e62..6c743e32da9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3585,7 +3585,7 @@ class CommandeFournisseurLigne extends CommonOrderLine * @param int $notrigger 1=Disable call to triggers * @return int <0 if KO, >0 if OK */ - public function delete($notrigger) + public function delete($notrigger = 0) { global $user; @@ -3593,7 +3593,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->db->begin(); - $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->rowid; + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid=".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); From 1963e5c95917a72380ac907b14db00b1a36991ba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 09:35:45 +0100 Subject: [PATCH 02/45] add comment --- htdocs/holiday/class/holiday.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 0eb02e006e5..ffb727120aa 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -53,7 +53,10 @@ class Holiday extends CommonObject * @var int Field with ID of parent key if this field has a parent */ public $fk_element = 'fk_holiday'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'holiday'; /** From 345a060bbe6abd9d119f108a818c04630025932d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 30 Oct 2019 08:36:59 +0000 Subject: [PATCH 03/45] Fixing style errors. --- htdocs/holiday/class/holiday.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index ffb727120aa..7a86d471948 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -53,7 +53,7 @@ class Holiday extends CommonObject * @var int Field with ID of parent key if this field has a parent */ public $fk_element = 'fk_holiday'; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From a80243e5282db20ca9dbd760a7f65380ead6f78d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 09:48:34 +0100 Subject: [PATCH 04/45] add comment --- htdocs/core/modules/mailings/advthirdparties.modules.php | 4 ++++ htdocs/core/modules/mailings/contacts1.modules.php | 4 ++++ htdocs/core/modules/mailings/example.modules.php | 4 ++++ htdocs/core/modules/mailings/fraise.modules.php | 4 ++++ htdocs/core/modules/mailings/pomme.modules.php | 4 ++++ htdocs/core/modules/mailings/thirdparties.modules.php | 4 ++++ .../mailings/thirdparties_services_expired.modules.php | 4 ++++ htdocs/core/modules/mailings/xinputfile.modules.php | 4 ++++ htdocs/core/modules/mailings/xinputuser.modules.php | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 581fca03f8b..2e4f0be6ed8 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -31,6 +31,10 @@ class mailing_advthirdparties extends MailingTargets public $require_admin=0; public $require_module=array("none"); // This module should not be displayed as Selector in mailling + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index aa951426a12..4ec70504e4d 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -37,6 +37,10 @@ class mailing_contacts1 extends MailingTargets public $desc='Contacts of thirdparties (prospects, customers, suppliers...)'; public $require_module=array("societe"); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='contact'; /** diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index a96457c2625..394def035b0 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -36,6 +36,10 @@ class mailing_example extends MailingTargets public $tooltip='MyTooltipLangKey'; public $require_module=array(); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto=''; /** diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 25ffcb717fd..74a2d5b3296 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -40,6 +40,10 @@ class mailing_fraise extends MailingTargets public $require_admin=0; public $require_module=array('adherent'); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='user'; /** diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 970339e4dbb..36708ae34e4 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -35,6 +35,10 @@ class mailing_pomme extends MailingTargets public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=1; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='user'; /** diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 68cb49e10d9..97b744ca977 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -30,6 +30,10 @@ class mailing_thirdparties extends MailingTargets public $require_admin=0; public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 75dc4b9499b..1af4ba0961d 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -28,6 +28,10 @@ class mailing_thirdparties_services_expired extends MailingTargets public $require_admin=0; public $require_module=array('contrat'); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='company'; /** diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 4987c9ebc17..172d29cf957 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -35,6 +35,10 @@ class mailing_xinputfile extends MailingTargets public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='generic'; public $tooltip='UseFormatFileEmailToTarget'; diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 8d4ecf0b72e..01f89f31e6d 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -35,6 +35,10 @@ class mailing_xinputuser extends MailingTargets public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='generic'; public $tooltip='UseFormatInputEmailToTarget'; From 445d09cf8ae10a03efeb95ee9f8605b28ff084e5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 09:50:06 +0100 Subject: [PATCH 05/45] add comment --- htdocs/core/modules/printing/printgcp.modules.php | 4 ++++ htdocs/core/modules/printing/printipp.modules.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index eeef6ab34e5..6d842244fbf 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -37,6 +37,10 @@ class printing_printgcp extends PrintingDriver { public $name = 'printgcp'; public $desc = 'PrintGCPDesc'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'printer'; public $active = 'PRINTING_PRINTGCP'; public $conf = array(); diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 1d76fe6f574..9b67ea05c1e 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -32,6 +32,10 @@ class printing_printipp extends PrintingDriver { public $name = 'printipp'; public $desc = 'PrintIPPDesc'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'printer'; public $active = 'PRINTING_PRINTIPP'; public $conf = array(); From 2fc09b3530008be8ec712b2e8cb0b947a0a669d9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 09:52:25 +0100 Subject: [PATCH 06/45] add comment --- htdocs/expensereport/class/expensereport.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 485373c5840..0b91f2c2699 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -46,6 +46,10 @@ class ExpenseReport extends CommonObject public $table_element_line = 'expensereport_det'; public $fk_element = 'fk_expensereport'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'trip'; public $lines=array(); From af288e1fc61b7f360e928a44db075c595a633834 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 09:53:12 +0100 Subject: [PATCH 07/45] add comment --- htdocs/fichinter/class/fichinterrec.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index f88653e70eb..9d7173b578b 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -42,6 +42,10 @@ class FichinterRec extends Fichinter public $table_element = 'fichinter_rec'; public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'intervention'; public $title; From ed9a13621187d25e1bbab3eed43eb7f013a5d9a5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 30 Oct 2019 08:58:19 +0000 Subject: [PATCH 08/45] Fixing style errors. --- htdocs/core/modules/mailings/advthirdparties.modules.php | 2 +- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- htdocs/core/modules/mailings/example.modules.php | 2 +- htdocs/core/modules/mailings/fraise.modules.php | 2 +- htdocs/core/modules/mailings/pomme.modules.php | 2 +- htdocs/core/modules/mailings/thirdparties.modules.php | 2 +- .../modules/mailings/thirdparties_services_expired.modules.php | 2 +- htdocs/core/modules/mailings/xinputfile.modules.php | 2 +- htdocs/core/modules/mailings/xinputuser.modules.php | 2 +- htdocs/core/modules/printing/printgcp.modules.php | 2 +- htdocs/core/modules/printing/printipp.modules.php | 2 +- htdocs/expensereport/class/expensereport.class.php | 2 +- htdocs/fichinter/class/fichinterrec.class.php | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 2e4f0be6ed8..558744d87e8 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -31,7 +31,7 @@ class mailing_advthirdparties extends MailingTargets public $require_admin=0; public $require_module=array("none"); // This module should not be displayed as Selector in mailling - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 4ec70504e4d..b3687e4f603 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -37,7 +37,7 @@ class mailing_contacts1 extends MailingTargets public $desc='Contacts of thirdparties (prospects, customers, suppliers...)'; public $require_module=array("societe"); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index 394def035b0..88af802ecfe 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -36,7 +36,7 @@ class mailing_example extends MailingTargets public $tooltip='MyTooltipLangKey'; public $require_module=array(); - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 74a2d5b3296..7dc4bf78121 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -40,7 +40,7 @@ class mailing_fraise extends MailingTargets public $require_admin=0; public $require_module=array('adherent'); - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 36708ae34e4..8d55bd86adc 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -35,7 +35,7 @@ class mailing_pomme extends MailingTargets public $desc='Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=1; // Module mailing actif pour user admin ou non - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 97b744ca977..e0c148e4f9f 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -30,7 +30,7 @@ class mailing_thirdparties extends MailingTargets public $require_admin=0; public $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 1af4ba0961d..7e3b468fc6d 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -28,7 +28,7 @@ class mailing_thirdparties_services_expired extends MailingTargets public $require_admin=0; public $require_module=array('contrat'); - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 172d29cf957..a69800230b1 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -35,7 +35,7 @@ class mailing_xinputfile extends MailingTargets public $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 01f89f31e6d..7014f5f894d 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -35,7 +35,7 @@ class mailing_xinputuser extends MailingTargets public $desc='EMails input by user'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e public $require_module=array(); // Module mailing actif si modules require_module actifs public $require_admin=0; // Module mailing actif pour user admin ou non - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 6d842244fbf..1477f4d65f3 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -37,7 +37,7 @@ class printing_printgcp extends PrintingDriver { public $name = 'printgcp'; public $desc = 'PrintGCPDesc'; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 9b67ea05c1e..37659cec199 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -32,7 +32,7 @@ class printing_printipp extends PrintingDriver { public $name = 'printipp'; public $desc = 'PrintIPPDesc'; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0b91f2c2699..572d1345824 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -46,7 +46,7 @@ class ExpenseReport extends CommonObject public $table_element_line = 'expensereport_det'; public $fk_element = 'fk_expensereport'; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index 9d7173b578b..783faac70f8 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -42,7 +42,7 @@ class FichinterRec extends Fichinter public $table_element = 'fichinter_rec'; public $table_element_line = 'fichinter_rec'; public $fk_element = 'fk_fichinter'; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From ccb957623cea9c1c73c89fa3f205167a6282a200 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:00:52 +0100 Subject: [PATCH 09/45] add some comment --- htdocs/fourn/class/fournisseur.commande.class.php | 5 ++++- htdocs/fourn/class/fournisseur.facture.class.php | 3 +++ htdocs/fourn/class/paiementfourn.class.php | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a6d4751169e..4ef407c4a0e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -62,7 +62,10 @@ class CommandeFournisseur extends CommonOrder */ public $fk_element = 'fk_commande'; - public $picto='order'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='order'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0e28c5302ce..ca207ad4e73 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -63,6 +63,9 @@ class FactureFournisseur extends CommonInvoice */ public $fk_element='fk_facture_fourn'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='bill'; /** diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 14d09c20d6e..979c7803dc4 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -46,6 +46,9 @@ class PaiementFourn extends Paiement */ public $table_element='paiementfourn'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'payment'; public $statut; //Status of payment. 0 = unvalidated; 1 = validated From 991e1b8767542844ea83a5317bf72c28feda78ba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:02:44 +0100 Subject: [PATCH 10/45] add some comment --- htdocs/hrm/class/establishment.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 863f519231d..20c80d07981 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -55,7 +55,10 @@ class Establishment extends CommonObject */ public $ismultientitymanaged = 1; - public $picto='building'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='building'; /** * @var int ID From 3f15c4e3a9f3bb05a013f907821e86cd3ddcd49d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:03:15 +0100 Subject: [PATCH 11/45] add some comment --- htdocs/loan/class/loan.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index c8e241186d2..f54375135a8 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -41,6 +41,9 @@ class Loan extends CommonObject */ public $table_element='loan'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'bill'; /** From a1bd895e4170154a4ed3a8557eec9e077230310b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:04:03 +0100 Subject: [PATCH 12/45] add some comment --- .../mailings/mailinglist_mymodule_myobject.modules.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 854e7f37bd5..7ebd90a3298 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -26,6 +26,10 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets public $enabled=0; public $require_module=array(); + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='mymodule@mymodule'; /** From ae2dc713c48888fed88a429f400c118f42563916 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 30 Oct 2019 09:03:43 +0000 Subject: [PATCH 13/45] Fixing style errors. --- .../modules/mailings/mailinglist_mymodule_myobject.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 7ebd90a3298..43970122919 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -26,7 +26,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets public $enabled=0; public $require_module=array(); - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From 99a41604b81e93e73802b67c2a377e1ed07c2a4d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:06:45 +0100 Subject: [PATCH 14/45] add some comment --- htdocs/opensurvey/class/opensurveysondage.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 786ed7220b5..b1cdeac1f36 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -44,6 +44,9 @@ class Opensurveysondage extends CommonObject */ public $table_element='opensurvey_sondage'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'opensurvey'; public $id_sondage; From b029febff13439443e0a8b77437504ff2c48b84b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:07:54 +0100 Subject: [PATCH 15/45] add some comment --- htdocs/product/stock/class/entrepot.class.php | 3 +++ htdocs/product/stock/class/productlot.class.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 35b433c5a28..d84d33cd116 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -44,6 +44,9 @@ class Entrepot extends CommonObject */ public $table_element='entrepot'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='stock'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 3848a592f21..bcac4bb9a36 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -45,6 +45,9 @@ class Productlot extends CommonObject */ public $table_element = 'product_lot'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='barcode'; /** From e02da55c2d65575d1ba2fa380af220ea4eb99120 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:08:36 +0100 Subject: [PATCH 16/45] add some comment --- htdocs/projet/class/project.class.php | 3 +++ htdocs/projet/class/task.class.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a873b53dbc0..0848f87ed19 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -60,6 +60,9 @@ class Project extends CommonObject */ public $ismultientitymanaged = 1; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'projectpub'; /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 1bd044bc985..b4d556cda78 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -47,6 +47,9 @@ class Task extends CommonObject */ public $fk_element='fk_task'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'task'; /** From 7eb3e2ff3cd36ae1a866b23c6df25da69a02c19d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:09:08 +0100 Subject: [PATCH 17/45] add some comment --- htdocs/reception/class/reception.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index dd819adff0a..72c5187b307 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -48,7 +48,11 @@ class Reception extends CommonObject public $table_element="reception"; public $table_element_line="commande_fournisseur_dispatch"; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'reception'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'reception'; public $socid; public $ref_supplier; From 9407afcacb12890ac8d1bba72ba0a7427678dfaa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:09:37 +0100 Subject: [PATCH 18/45] add some comment --- htdocs/resource/class/dolresource.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index c85f040f896..db64c635fd5 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -39,7 +39,10 @@ class Dolresource extends CommonObject */ public $table_element='resource'; - public $picto = 'resource'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'resource'; public $resource_id; public $resource_type; From d0a468e11bee845682b6d5c7fe10c1987a150577 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 30 Oct 2019 09:10:12 +0000 Subject: [PATCH 19/45] Fixing style errors. --- htdocs/reception/class/reception.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 72c5187b307..820e39d78f4 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -48,7 +48,7 @@ class Reception extends CommonObject public $table_element="reception"; public $table_element_line="commande_fournisseur_dispatch"; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ From 502d08af0cc9277e8645107ad4767752475c0de0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:10:22 +0100 Subject: [PATCH 20/45] add some comment --- htdocs/societe/class/societe.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b20f80f5439..74288d54e08 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -69,6 +69,9 @@ class Societe extends CommonObject */ protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_account", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'company'; /** From 213f40f4804409abe94130e1efae3590732fb01b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:12:15 +0100 Subject: [PATCH 21/45] add some comment --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index be272ee2d36..0aef06f58c6 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -66,6 +66,9 @@ class SupplierProposal extends CommonObject */ public $fk_element='fk_supplier_proposal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** From 1a0723c1cdd1cc260f68d8a8e7e1b7eb74e7cbcf Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 10:13:57 +0100 Subject: [PATCH 22/45] add some comment --- htdocs/user/class/usergroup.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index b624bdb34d9..40bc6c08fb7 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -52,7 +52,10 @@ class UserGroup extends CommonObject */ public $ismultientitymanaged = 1; - public $picto='group'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='group'; /** * @var int Entity of group From b7e1a849a031a0fa567d9edd1fdb99fb48fa84cc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 30 Oct 2019 15:23:24 +0100 Subject: [PATCH 23/45] fix payment mode issue --- htdocs/don/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 54d4e392f61..133b533cc71 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -564,7 +564,7 @@ if (! empty($id) && $action == 'edit') } // Payment mode print "".$langs->trans("PaymentMode")."\n"; - if ($object->modepaymentid) $selected = $object->modepaymentid; + if ($object->mode_reglement_id) $selected = $object->mode_reglement_id; else $selected = ''; $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1); print "\n"; @@ -708,7 +708,7 @@ if (! empty($id) && $action != 'edit') // Payment mode print "".$langs->trans("PaymentMode").""; - $form->form_modes_reglement(null, $object->modepaymentid, 'none'); + $form->form_modes_reglement(null, $object->mode_reglement_id, 'none'); print "\n"; // Other attributes From 78c1e8dfbe3d1961f1f4b6c1bb5cd9fb1018de3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 08:25:58 +0100 Subject: [PATCH 24/45] Update define_holiday.php --- htdocs/holiday/define_holiday.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 9add71da395..ec2b12f9bf5 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -173,6 +173,10 @@ llxHeader('', $langs->trans('CPTitreMenu')); $typeleaves=$holiday->getTypes(1, 1); +$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. +if ($result < 0) { + setEventMessages($holiday->error, $holiday->errors, 'errors'); +} print '
'; @@ -189,14 +193,12 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; $lastUpdate = $holiday->getConfCP('lastUpdate'); -if ($lastUpdate) -{ - $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; - $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; - print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')), 'dayhour', 'tzuser').''; - print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +if ($lastUpdate) { + print ''.dol_print_date($db->jdate($lastUpdate), 'dayhour').''; + print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).''."\n"; +} else { + print $langs->trans('None'); } -else print $langs->trans('None'); print "

\n"; $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. From 400defd93d1943dfb62ce0016709403364f0fa6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:04:37 +0100 Subject: [PATCH 25/45] form_select_status_action returns void --- htdocs/comm/action/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 1b33e5da9b8..ac474881732 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -488,7 +488,7 @@ if ($resql) if (! empty($arrayfields['a.tms']['checked'])) print ''; if (! empty($arrayfields['a.percent']['checked'])) { print ''; - print $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); + $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); print ajax_combobox('selectstatus'); print ''; } From da238e94e10c96fade8cc90669a28dc326d13b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:21:21 +0100 Subject: [PATCH 26/45] php is > 5.4 --- htdocs/core/lib/functions.lib.php | 76 ++++++++++++++----------------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 56b0dc93c35..70f6e57eb4b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1984,56 +1984,48 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $ if ($second< 0 || $second > 60) return ''; } - if (method_exists('DateTime', 'getTimestamp')) + if (empty($gm) || $gm === 'server') { - if (empty($gm) || $gm === 'server') - { - $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' + $default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin' + $localtz = new DateTimeZone($default_timezone); + } + elseif ($gm === 'user') + { + // We use dol_tz_string first because it is more reliable. + $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' + try { $localtz = new DateTimeZone($default_timezone); } - elseif ($gm === 'user') + catch(Exception $e) { - // We use dol_tz_string first because it is more reliable. - $default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin' - try { - $localtz = new DateTimeZone($default_timezone); - } - catch(Exception $e) - { - dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING); - $default_timezone=@date_default_timezone_get(); - } + dol_syslog("Warning dol_tz_string contains an invalid value ".$_SESSION["dol_tz_string"], LOG_WARNING); + $default_timezone=@date_default_timezone_get(); } - elseif (strrpos($gm, "tz,") !== false) - { - $timezone=str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin' - try - { - $localtz = new DateTimeZone($timezone); - } - catch(Exception $e) - { - dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING); - } - } - - if (empty($localtz)) { - $localtz = new DateTimeZone('UTC'); - } - //var_dump($localtz); - //var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute); - $dt = new DateTime(null, $localtz); - $dt->setDate((int) $year, (int) $month, (int) $day); - $dt->setTime((int) $hour, (int) $minute, (int) $second); - $date=$dt->getTimestamp(); // should include daylight saving time - //var_dump($date); - return $date; } - else + elseif (strrpos($gm, "tz,") !== false) { - dol_print_error('', 'PHP version must be 5.4+'); - return ''; + $timezone=str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin' + try + { + $localtz = new DateTimeZone($timezone); + } + catch(Exception $e) + { + dol_syslog("Warning passed timezone contains an invalid value ".$timezone, LOG_WARNING); + } } + + if (empty($localtz)) { + $localtz = new DateTimeZone('UTC'); + } + //var_dump($localtz); + //var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute); + $dt = new DateTime(null, $localtz); + $dt->setDate((int) $year, (int) $month, (int) $day); + $dt->setTime((int) $hour, (int) $minute, (int) $second); + $date=$dt->getTimestamp(); // should include daylight saving time + //var_dump($date); + return $date; } From 0f80ba5353be4990929026e5ae945fc542745e01 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 1 Nov 2019 15:36:48 +0100 Subject: [PATCH 27/45] FIX prices by customer API --- htdocs/product/class/api_products.class.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index d6066b1a03a..1b5e8adf862 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -445,7 +445,6 @@ class Products extends DolibarrApi //'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code ); } - /** * Get prices per customer for a product * @@ -471,13 +470,18 @@ class Products extends DolibarrApi 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)); + + if ($result > 0) { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($this->db); + $result = $prodcustprice->fetch_all('', '', 0, 0, array('t.fk_product' => $id)); } - throw new RestException(501, 'Feature not yet available'); - //return $result; + if ( empty($prodcustprice->lines)) { + throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($prodcustprice->error), $prodcustprice->errors)); + } + + return $prodcustprice->lines; } /** From bc5e6c867f4969a5b1697e164e1f033562144661 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 1 Nov 2019 14:37:21 +0000 Subject: [PATCH 28/45] Fixing style errors. --- htdocs/product/class/api_products.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 1b5e8adf862..5b179d487a9 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -470,11 +470,11 @@ class Products extends DolibarrApi 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); - $result = $prodcustprice->fetch_all('', '', 0, 0, array('t.fk_product' => $id)); + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($this->db); + $result = $prodcustprice->fetch_all('', '', 0, 0, array('t.fk_product' => $id)); } if ( empty($prodcustprice->lines)) { From 44c8cd9d2338145242db1aa00d28e1dc8cf8180c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:48:55 +0100 Subject: [PATCH 29/45] give a value by default The variable $fileurlnb does not seem to be defined for all execution paths --- htdocs/core/boxes/box_graph_invoices_permonth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index ba0e24ddaab..19a923ad4e1 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -135,7 +135,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); From 931f2b809d7e822bca1d0767a4ec365954aa43c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:52:13 +0100 Subject: [PATCH 30/45] Update box_graph_orders_permonth.php --- htdocs/core/boxes/box_graph_orders_permonth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 6e5bf253832..a67c3b94f92 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -135,7 +135,8 @@ class box_graph_orders_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); @@ -144,7 +145,8 @@ class box_graph_orders_permonth extends ModeleBoxes { $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) From 5bdb9da5c5ca063f78a6bef5ecfb65d3cb36023e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:56:15 +0100 Subject: [PATCH 31/45] Update box_graph_invoices_supplier_permonth.php --- htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 4393e9db790..e70da7fe680 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -132,7 +132,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessuppliernbinyear-'.$year.'.png'; $px1 = new DolGraph(); @@ -143,7 +144,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) From 93b00038f8c059ef08a4b1ebab193fb306294daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:57:40 +0100 Subject: [PATCH 32/45] Update box_graph_orders_supplier_permonth.php --- htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 443f374346d..911ac7a91b1 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -134,7 +134,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssuppliernbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); @@ -143,7 +144,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes { $px1->SetData($data1); unset($data1); - $i=$startyear;$legend=array(); + $i=$startyear; + $legend=array(); while ($i <= $endyear) { if ($startmonth != 1) @@ -177,7 +179,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=orderssupplieramountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); From dab8aabb16d3064caa2bbb75e1f5c17d6ff20fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:58:30 +0100 Subject: [PATCH 33/45] Update box_graph_invoices_supplier_permonth.php --- htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index e70da7fe680..6d65ea7f534 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -179,7 +179,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$year.'.png'; $px2 = new DolGraph(); From d14015e3df581bfb2cf6efc8febe1b8048c2e2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 15:59:17 +0100 Subject: [PATCH 34/45] Update box_graph_invoices_permonth.php --- htdocs/core/boxes/box_graph_invoices_permonth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 19a923ad4e1..5f951362be7 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -181,7 +181,8 @@ class box_graph_invoices_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); From 18b662e430feecc6ccded8b909b203d60c4d8b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 16:01:08 +0100 Subject: [PATCH 35/45] Update box_graph_orders_permonth.php --- htdocs/core/boxes/box_graph_orders_permonth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index a67c3b94f92..53952bb437b 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -180,7 +180,8 @@ class box_graph_orders_permonth extends ModeleBoxes $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, (GETPOST('action', 'aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0), $startmonth); $filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; + // default value for customer mode + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png'; if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$endyear.'.png'; $px2 = new DolGraph(); From ec05e8e2c5729d7ad8d3a9e7bf296c6ad97b1dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 16:13:40 +0100 Subject: [PATCH 36/45] $key is overwriting a variable from outer foreach loop --- htdocs/admin/notification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6d1a5c57cf6..52de58b80b8 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -236,7 +236,7 @@ foreach($listofnotifiedevents as $notifiedevent) $s=''; // Do not use type="email" here, we must be able to enter a list of email with , separator. $arrayemail=explode(',', $value); $showwarning=0; - foreach($arrayemail as $key=>$valuedet) + foreach($arrayemail as $keydet => $valuedet) { $valuedet=trim($valuedet); if (! empty($valuedet) && ! isValidEmail($valuedet, 1)) $showwarning++; From 12b6e4fae6f41141a6be9555231f15889674aaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 16:25:22 +0100 Subject: [PATCH 37/45] Update translation.php Are you sure the usage of print_barre_liste($title... '', 0, '', '', $limit) is correct as it seems to always return null. --- htdocs/admin/translation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4d234e266e8..967d7826aa0 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -458,7 +458,7 @@ if ($mode == 'searchkey') //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; $title = $langs->trans("TranslationKeySearch"); if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; - print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; print ''; print ''; @@ -466,7 +466,7 @@ if ($mode == 'searchkey') print '
'; print ''; print ''; - print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder).''; + print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); From e98619745ff92a77092da1e0d0eace5b47fac7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 16:27:30 +0100 Subject: [PATCH 38/45] Update translation.php --- htdocs/admin/translation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 967d7826aa0..52ef490ceae 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -458,7 +458,7 @@ if ($mode == 'searchkey') //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; $title = $langs->trans("TranslationKeySearch"); if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit); print ''; print ''; From bb9b4358755241694b6b3948bd9d4744769be9c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 17:12:07 +0100 Subject: [PATCH 39/45] doxygen for actioncomm class --- htdocs/comm/action/class/actioncomm.class.php | 228 +++++++++++++----- 1 file changed, 162 insertions(+), 66 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8432ba786a1..1b926a97453 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,43 +45,67 @@ class ActionComm extends CommonObject */ public $table_element = 'actioncomm'; + /** + * @var string Name of id column + */ public $table_rowid = 'id'; /** - * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + * @var string Name of icon for actioncomm object. Filename of icon is object_action.png */ public $picto = 'action'; /** - * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - * @var int + * @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; /** - * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty - * @var integer + * @var integer 0=Default + * 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user + * 2=Same than 1 but accept record if fksoc is empty */ public $restrictiononfksoc = 2; /** - * Id of the event - * @var int + * @var int Id of the event */ public $id; /** - * Id of the event. Use $id as possible - * @var int + * @var int Id of the event. Use $id as possible */ public $ref; - public $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set) - public $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + /** + * @var int Id into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type_id; + + /** + * @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH. + */ + public $type_code; + + /** + * @var string Type label + */ public $type_label; - public $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set) - public $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set) - public $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + + /** + * @var string Label into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type; + + /** + * @var string Color into parent table llx_c_actioncomm (used only if option to use type is set) + */ + public $type_color; + + /** + * @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) + */ + public $code; /** * @var string Agenda event label @@ -89,72 +113,56 @@ class ActionComm extends CommonObject public $label; /** - * Date creation record (datec) - * - * @var integer + * @var integer Date creation record (datec) */ public $datec; /** - * Date end record (datef) - * - * @var integer + * @var integer Date end record (datef) */ public $datef; /** - * Duration (duree) - * - * @var integer + * @var integer Duration (duree) */ public $duree; /** - * Date modification record (tms) - * - * @var integer + * @var integer Date modification record (tms) */ public $datem; /** - * Object user that create action - * @var User + * @var User Object user that create action * @deprecated * @see $authorid */ public $author; /** - * Object user that modified action - * @var User + * @var User Object user that modified action * @deprecated * @see $usermodid */ public $usermod; /** - * Id user that create action - * @var int + * @var int Id user that create action */ public $authorid; /** - * Id user that modified action - * @var int + * @var int Id user that modified action */ public $usermodid; /** - * Date action start (datep) - * - * @var integer + * @var integer Date action start (datep) */ public $datep; /** - * Date action end (datep2) - * - * @var integer + * @var integer Date action end (datep2) */ public $datep2; @@ -163,90 +171,178 @@ class ActionComm extends CommonObject * @deprecated */ public $durationp = -1; - public $fulldayevent = 0; // 1=Event on full day /** - * Milestone - * @var int + * @var int 1=Event on full day + */ + public $fulldayevent = 0; + + /** + * @var int Milestone * @deprecated Milestone is already event with end date = start date */ public $punctual = 1; - public $percentage; // Percentage - public $location; // Location - public $transparency; // Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) - public $priority; // Small int (0 By default) + /** + * @var integer Percentage + */ + public $percentage; - public $userassigned = array(); // Array of user ids - public $userownerid; // Id of user owner = fk_user_action into table - public $userdoneid; // Id of user done (deprecated) + /** + * @var string Location + */ + public $location; - public $socpeopleassigned = array(); // Array of contact ids + /** + * @var int Transparency (ical standard). Used to say if people assigned to event are busy or not by event. 0=available, 1=busy, 2=busy (refused events) + */ + public $transparency; - public $otherassigned = array(); // Array of other contact emails (not user, not contact) + /** + * @var int (0 By default) + */ + public $priority; + + /** + * @var int[] Array of user ids + */ + public $userassigned = array(); + + /** + * @var int Id of user owner = fk_user_action into table + */ + public $userownerid; + + /** + * @var int Id of user done (deprecated) + * @deprecated + */ + public $userdoneid; + + /** + * @var int[] Array of contact ids + */ + public $socpeopleassigned = array(); + + /** + * @var int[] Array of other contact emails (not user, not contact) + */ + public $otherassigned = array(); - /** - * Object user of owner - * @var User + /** + * @var User Object user of owner * @deprecated * @see userownerid */ public $usertodo; /** - * Object user that did action - * @var User + * @var User Object user that did action * @deprecated * @see userdoneid */ public $userdone; + /** + * @var int thirdparty id linked to action + */ public $socid; + + /** + * @var int socpeople id linked to action + */ public $contactid; /** - * Company linked to action (optional) - * @var Societe|null + * @var Societe|null Company linked to action (optional) * @deprecated * @see socid */ public $societe; /** - * Contact linked to action (optional) - * @var Contact|null + * @var Contact|null Contact linked to action (optional) * @deprecated * @see contactid */ public $contact; // Properties for links to other objects + /** + * @var int Id of linked object + */ public $fk_element; // Id of record - public $elementid; // Id of record alternative for API - public $elementtype; // Type of record. This if property ->element of object linked to. - // Ical + /** + * @var int Id of record alternative for API + */ + public $elementid; + + /** + * @var string Type of record. This if property ->element of object linked to. + */ + public $elementtype; + + /** + * @var string Ical name + */ public $icalname; + + /** + * @var string Ical color + */ public $icalcolor; + /** + * @var array Actions + */ public $actions=array(); - // Fields for emails + /** + * @var string Email msgid + */ public $email_msgid; + + /** + * @var string Email from + */ public $email_from; + + /** + * @var string Email sender + */ public $email_sender; + + /** + * @var string Email to + */ public $email_to; + + /** + * @var string Email tocc + */ public $email_tocc; + /** + * @var string Email tobcc + */ public $email_tobcc; + + /** + * @var string Email subject + */ public $email_subject; + + /** + * @var string Email errors to + */ public $errors_to; /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { From 6f7788568676a219e60729650b1408e0aaf9389e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Fri, 1 Nov 2019 20:26:39 +0100 Subject: [PATCH 40/45] Update api_products.class.php --- htdocs/product/class/api_products.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 5b179d487a9..e7046e07f43 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -445,16 +445,18 @@ class Products extends DolibarrApi //'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code ); } + /** * Get prices per customer for a product * * @param int $id ID of product + * @param string $thirdparty_id Thirdparty id to filter orders of (example '1') {@pattern /^[0-9,]*$/i} * * @return mixed * * @url GET {id}/selling_multiprices/per_customer */ - public function getCustomerPricesPerCustomer($id) + public function getCustomerPricesPerCustomer($id, $thirdparty_id = '') { global $conf; @@ -470,15 +472,18 @@ class Products extends DolibarrApi 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); - $result = $prodcustprice->fetch_all('', '', 0, 0, array('t.fk_product' => $id)); + $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(503, 'Error when retrieve prices list : '.array_merge(array($prodcustprice->error), $prodcustprice->errors)); + throw new RestException(404, 'Prices not found'); } return $prodcustprice->lines; From 0e260c859b92d1dc533dcec7874ffb29ff6fbc82 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 1 Nov 2019 19:28:39 +0000 Subject: [PATCH 41/45] Fixing style errors. --- htdocs/product/class/api_products.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index e7046e07f43..1b0020faa25 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -445,7 +445,7 @@ class Products extends DolibarrApi //'multiprices_default_vat_code'=>$this->product->multiprices_default_vat_code ); } - + /** * Get prices per customer for a product * @@ -472,13 +472,13 @@ class Products extends DolibarrApi 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; + if ($thirdparty_id) $filter['t.fk_soc'] .= $thirdparty_id; $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); } From 7bd88f33a05903e158ee83c7ff64e3062414ac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 22:22:07 +0100 Subject: [PATCH 42/45] Update define_holiday.php --- htdocs/holiday/define_holiday.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index ec2b12f9bf5..c5ab5e0e5ec 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -201,11 +201,6 @@ if ($lastUpdate) { } print "
\n"; -$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. -if ($result < 0) -{ - setEventMessages($holiday->error, $holiday->errors, 'errors'); -} $filters = ''; From 8569020e34249f384ab42cc4ce608f8141205557 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 2 Nov 2019 10:30:29 +0100 Subject: [PATCH 43/45] add some comment --- htdocs/livraison/class/livraison.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 1e7fdebaa64..7f886fbc1a5 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -64,7 +64,12 @@ class Livraison extends CommonObject public $ref_customer; public $date_delivery; // Date really received + + /** + * @var integer|string date_creation + */ public $date_creation; + public $date_valid; public $model_pdf; From 3ff5389c4eef08e72bcb1feeffb51687f8a7816c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 2 Nov 2019 10:35:43 +0100 Subject: [PATCH 44/45] add some comment --- htdocs/reception/class/reception.class.php | 10 ++++++++-- htdocs/societe/class/societe.class.php | 7 ++++--- htdocs/societe/class/societeaccount.class.php | 6 ++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index eae8ab9de34..7663789c127 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -80,8 +80,14 @@ class Reception extends CommonObject * @var int */ public $date_reception; - public $date_creation; - public $date_valid; + + /** + * @var integer|string date_creation + */ + public $date_creation; + + + public $date_valid; public $meths; public $listmeths; // List of carriers diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ca17077a47b..f930e79239d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -316,11 +316,12 @@ class Societe extends CommonObject * @var string */ public $user_modification; - /** - * Date of creation - * @var string + + /** + * @var integer|string date_creation */ public $date_creation; + /** * User that created the thirdparty * @var User diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index bf94c522f68..22fd3baf7a8 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -124,7 +124,13 @@ class SocieteAccount extends CommonObject public $date_last_login; public $date_previous_login; public $note_private; + + /** + * @var integer|string date_creation + */ public $date_creation; + + public $tms; /** From dc97a54d82bc7e1145112b636a34cd8f6de368b4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 2 Nov 2019 09:39:05 +0000 Subject: [PATCH 45/45] Fixing style errors. --- htdocs/livraison/class/livraison.class.php | 8 ++++---- htdocs/reception/class/reception.class.php | 6 +++--- htdocs/societe/class/societe.class.php | 6 +++--- htdocs/societe/class/societeaccount.class.php | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 7f886fbc1a5..dcf95b37ad6 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -64,12 +64,12 @@ class Livraison extends CommonObject public $ref_customer; public $date_delivery; // Date really received - - /** + + /** * @var integer|string date_creation - */ + */ public $date_creation; - + public $date_valid; public $model_pdf; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 7663789c127..d9ba10113bb 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -80,13 +80,13 @@ class Reception extends CommonObject * @var int */ public $date_reception; - + /** * @var integer|string date_creation */ public $date_creation; - - + + public $date_valid; public $meths; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f930e79239d..9d2f86e5d77 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -316,12 +316,12 @@ class Societe extends CommonObject * @var string */ public $user_modification; - - /** + + /** * @var integer|string date_creation */ public $date_creation; - + /** * User that created the thirdparty * @var User diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 22fd3baf7a8..f93dfd0ea68 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -124,13 +124,13 @@ class SocieteAccount extends CommonObject public $date_last_login; public $date_previous_login; public $note_private; - + /** * @var integer|string date_creation */ public $date_creation; - - + + public $tms; /**